linux/drivers/power
Rhyland Klein a7d9ace4eb bq20z75: Fix issues with present and suspend
There are a few issues found around the battery not being present. If the
battery isn't present, then a few undesirable things happen. The first was
excessive reporting of failed properties. This was fixed by instead
returning ENODATA for all properties other than PRESENT if the battery
isn't present. That way the callers can identify the difference between a
failure and the battery not being there.

The next issue was in the suspend logic. It was found that if the battery
wasn't present, then it would return a failure, preventing the system from
going into suspend. If there is no battery present, the io is expected to
fail, so in that case, we shouldn't return the failure and just
acknowledge that it was expected.

I also found that when a gpio was used, i didn't maintain the internal
is_present state properly. I added a set of that to fix that.

Lastly, the code to see io's fail and figure out that the battery isn't
present when not using a gpio had a problem. In that code, it looked for
the read to fail and if it did, then handled it. The problem is that in
function to get the property, it first writes a value and that write can
fail, causing the code to never reach the logic after the read. Fix is
to move the logic till after the write.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-16 16:40:58 +03:00
..
apm_power.c apm_power: Add missing break statement 2010-09-08 14:35:10 +04:00
bq20z75.c bq20z75: Fix issues with present and suspend 2011-03-16 16:40:58 +03:00
bq27x00_battery.c bq27x00: Use single i2c_transfer call for property read 2011-02-22 11:02:48 +01:00
collie_battery.c power_supply: Don't use flush_scheduled_work() 2010-12-22 02:39:56 +03:00
da9030_battery.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ds2760_battery.c Merge git://git.infradead.org/battery-2.6 2011-01-14 09:25:59 -08:00
ds2782_battery.c ds2782_battery: Add MODULE_DEVICE_TABLE 2011-03-01 22:28:06 +03:00
gpio-charger.c gpio-charger: Fix potential race between irq handler and probe/remove 2010-12-22 02:39:45 +03:00
intel_mid_battery.c Merge git://git.infradead.org/battery-2.6 2011-01-14 09:25:59 -08:00
isp1704_charger.c isp1704_charger: Detect charger after probe 2010-11-18 16:56:21 +03:00
jz4740-battery.c jz4740-battery: Should include linux/io.h 2010-12-22 02:52:25 +03:00
Kconfig bq27x00: Add bq27000 support 2011-02-22 11:02:42 +01:00
Makefile power_supply: Add MAX17042 Fuel Gauge Driver 2011-01-14 18:11:59 +03:00
max8925_power.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
max17040_battery.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
max17042_battery.c power_supply: Add MAX17042 Fuel Gauge Driver 2011-01-14 18:11:59 +03:00
olpc_battery.c olpc_battery: Fix up XO-1.5 properties list 2011-01-13 01:41:57 +03:00
pcf50633-charger.c pcf50633-charger: Add missing sysfs_remove_group() 2010-09-22 16:14:49 +04:00
pda_power.c pda_power: Add function callbacks for suspend and resume 2010-04-16 19:14:34 +04:00
pmu_battery.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
power_supply_core.c power_supply: Initialize changed_work before calling device_add 2011-02-22 11:01:42 +01:00
power_supply_leds.c power_supply: Add new LED trigger charging-blink-solid-full 2011-01-31 16:31:51 +03:00
power_supply_sysfs.c power_supply: Ignore -ENODATA errors when generating uevents 2011-02-22 06:47:52 +01:00
power_supply.h power_supply: Use attribute groups 2010-05-19 12:14:28 +04:00
s3c_adc_battery.c s3c_adc_battery: Fix method names when PM not set 2011-03-16 16:39:26 +03:00
test_power.c power_supply: Add test_power driver 2010-05-18 19:58:56 +04:00
tosa_battery.c power_supply: Don't use flush_scheduled_work() 2010-12-22 02:39:56 +03:00
twl4030_charger.c twl4030_charger: Make the driver atomic notifier safe 2011-02-28 17:31:51 +03:00
wm97xx_battery.c power_supply: Don't use flush_scheduled_work() 2010-12-22 02:39:56 +03:00
wm831x_backup.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
wm831x_power.c wm831x_power: Add missing kfree(wm831x_power) in wm831x_power_remove() 2010-09-28 15:52:34 +04:00
wm8350_power.c mfd: Update WM8350 drivers for changed interrupt numbers 2010-03-07 22:16:58 +01:00
z2_battery.c z2_battery: Fix count of properties 2011-03-16 16:39:54 +03:00