diff options
author | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2010-11-09 23:41:52 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2010-11-10 00:00:30 +0530 |
commit | d53f297ef928933d2e0c955742d440d0c3d7a150 (patch) | |
tree | 41cd2c1c4cca20be25137ced5bd82c4c362ad108 /sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch | |
parent | sys-power/upower: fix bad battery state when fully-charged (diff) | |
download | nirbheek-d53f297ef928933d2e0c955742d440d0c3d7a150.tar.gz nirbheek-d53f297ef928933d2e0c955742d440d0c3d7a150.tar.bz2 nirbheek-d53f297ef928933d2e0c955742d440d0c3d7a150.zip |
Bump upower, update patch
Diffstat (limited to 'sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch')
-rw-r--r-- | sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch b/sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch index 9781dbf..b0a3df1 100644 --- a/sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch +++ b/sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch @@ -1,3 +1,8 @@ +From 7849ca66af7f74bfdba968e979c4596c9e99ff3d Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan <nirbheek.chauhan@gmail.com> +Date: Tue, 9 Nov 2010 23:54:27 +0530 +Subject: [PATCH] Add Dell laptop battery always-discharging quirk + Once full, some Dell laptop batteries show battery state as "fully-charged" for a second, and then set battery state as "Discharging". However, the "on-battery" status is correct. Try to do some guesswork for this case. @@ -9,10 +14,16 @@ model: DELL U600P04 serial: 0000 technology: lithium-ion +https://bugs.freedesktop.org/show_bug.cgi?id=31196 --- ---- src/linux/up-device-supply.c -+++ src/linux/up-device-supply.c -@@ -405,6 +405,9 @@ + src/linux/up-device-supply.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 40 insertions(+), 0 deletions(-) + +diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c +index 341f5df..4294e04 100644 +--- a/src/linux/up-device-supply.c ++++ b/src/linux/up-device-supply.c +@@ -402,6 +402,9 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) UpDeviceState old_state; UpDeviceState state; UpDevice *device = UP_DEVICE (supply); @@ -22,7 +33,7 @@ technology: lithium-ion const gchar *native_path; GUdevDevice *native; gboolean is_present; -@@ -425,7 +428,9 @@ +@@ -422,7 +425,9 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) const gchar *recall_url = NULL; UpDaemon *daemon; gboolean on_battery; @@ -32,10 +43,10 @@ technology: lithium-ion native = G_UDEV_DEVICE (up_device_get_native (device)); native_path = g_udev_device_get_sysfs_path (native); -@@ -610,6 +615,41 @@ - state = UP_DEVICE_STATE_FULLY_CHARGED; +@@ -599,6 +604,41 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) + if (percentage > 100.0f) + percentage = 100.0f; } - + /* some batteries show themselves as 'discharging' once they're full */ + if (state == UP_DEVICE_STATE_DISCHARGING && percentage == 100.0f) { + state = UP_DEVICE_STATE_FULLY_CHARGED; @@ -54,7 +65,7 @@ technology: lithium-ion + continue; + + /* print what we're trying */ -+ egg_debug ("guessing battery state using power supply status:%i", ++ g_debug ("guessing battery state using power supply status:%i", + online); + + /* If any of the power supplies is not online, @@ -65,12 +76,15 @@ technology: lithium-ion + } + } + /* print what we did */ -+ egg_debug ("guessed battery state as '%s' using power supply status", ++ g_debug ("guessed battery state as '%s' using power supply status", + up_device_state_to_string (state)); + + g_ptr_array_unref (devices); + } + + /* the battery isn't charging or discharging, it's just * sitting there half full doing nothing: try to guess a state */ - if (state == UP_DEVICE_STATE_UNKNOWN) { +-- +1.7.2.2 + |