charger-manager: Add support sysfs entry for charger
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 21 Sep 2012 09:49:37 +0000 (18:49 +0900)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Fri, 21 Sep 2012 23:32:40 +0000 (16:32 -0700)
commit3950c7865cd7c963982a2c94457182b96732f4c9
treee5fdab9c3c128362f3ac423d8275dc7b12e7439b
parent8fcfe088e21aa0db9d62eaf565757def673efba6
charger-manager: Add support sysfs entry for charger

This patch add support sysfs entry for each charger(regulator).
Charger-manager use one or more chargers for charging battery but some
charger isn't necessary on specific scenario. So, if some charger isn't
needed, can disable specific charger through 'externally_control' entry
while system is on state and confirm the information(name, state) of
charger.

The list of added sysfs entry
- /sys/class/power_supply/battery/chargers/charger.[index]/name
  show name of charger(regulator)
- /sys/class/power_supply/battery/chargers/charger.[index]/state
  show either enabled or disabled state of charger
- /sys/class/power_supply/battery/chargers/charger.[index]/externally_control

If 'externally_control' of specific charger is 1, Charger-manager cannot
enable regulator for charging when charger cable is attached and charger
must be maintained with disabled state. If 'externally_control' is zero,
Charger-manager usually can control to enable/disable regulator.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/charger-manager.c
include/linux/power/charger-manager.h