CHROMIUM: power: Allow bus used for power supply to be found
authorSimon Glass <sjg@chromium.org>
Sat, 2 Feb 2013 05:52:24 +0000 (21:52 -0800)
committerChromeBot <chrome-bot@google.com>
Wed, 20 Feb 2013 07:01:13 +0000 (23:01 -0800)
commit600f3afb25343c44a68e3598e881c1099dd89ba6
tree3b92736694844d7dbd90a1c5aa669d49976944b3
parent27773d808944e5e9f49c51deb8f670f725dcee9d
CHROMIUM: power: Allow bus used for power supply to be found

Some power supplies such as batteries are connected via a bus such as i2c.
When we want to resume the battery we must resume the bus also, otherwise
it will not be possible to communicate with it.

Add a function which returns the device that a power supply is connected
on, to permit a caller to resume the bus also.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Use charger-manager, with other changes, and see that in the
suspend_again() handler, the battery temperature can be read successfully.
This indicates that the i2c bus is working properly.
Change-Id: I1f19606861e0cb7f86621c2ad22415d7761cb060
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43012
Reviewed-by: Benson Leung <bleung@chromium.org>
drivers/power/sbs-battery.c
include/linux/power_supply.h