wm831x_power: Only register WM831x battery charger if enabled
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 15 Aug 2011 23:37:42 +0000 (08:37 +0900)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Fri, 19 Aug 2011 17:03:23 +0000 (21:03 +0400)
commit35c3ae5eef3fc641c75c5e1e4307835c8efa5f6b
tree0fbd69761ff8080bb2d5615073f486612a1a7464
parent9ad63986c606c60e2e916b1b96f22991f966d9cc
wm831x_power: Only register WM831x battery charger if enabled

Don't tell the system about the battery charger if it's not enabled, we
can reasonably assume that if the charger is not enabled then no battery
will ever be connected so reporting state is at best going to waste time
and at worst going to cause confusing information in the UI.

For simplicity and robustness we continue to register and handle interrupts
from the charger.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/power_supply_sysfs.c
drivers/power/wm831x_power.c