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 | |
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')
-rw-r--r-- | sys-power/upower/files/upower-0.9.7-linux-2.6.36.patch | 26 | ||||
-rw-r--r-- | sys-power/upower/files/upower-dell-samsung-sdi-battery-quirk.patch | 34 |
2 files changed, 50 insertions, 10 deletions
diff --git a/sys-power/upower/files/upower-0.9.7-linux-2.6.36.patch b/sys-power/upower/files/upower-0.9.7-linux-2.6.36.patch new file mode 100644 index 0000000..7510276 --- /dev/null +++ b/sys-power/upower/files/upower-0.9.7-linux-2.6.36.patch @@ -0,0 +1,26 @@ +From 04dd349103ac1db8660d5c4fd86e91e3b488650c Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martin.pitt@ubuntu.com> +Date: Thu, 04 Nov 2010 22:45:10 +0000 +Subject: Fix compilation eror against Linux 2.6.36 + +Include <stdint.h> so that <linux/fs.h> can use uint64_t. Arguably a bug in the +kernel headers, but it costs us nothing to safeguard against it. + + CC libupshared_la-up-device-idevice.lo +In file included from sysfs-utils.c:39:0: +/usr/include/linux/fs.h:37:2: error: expected specifier-qualifier-list before ‘uint64_t’ +--- +diff --git a/src/linux/sysfs-utils.c b/src/linux/sysfs-utils.c +index 01c3623..efba253 100644 +--- a/src/linux/sysfs-utils.c ++++ b/src/linux/sysfs-utils.c +@@ -36,6 +36,7 @@ + #include <fcntl.h> + #include <pwd.h> + #include <grp.h> ++#include <stdint.h> + #include <linux/fs.h> + #include <sys/ioctl.h> + #include <glib.h> +-- +cgit v0.8.3-6-g21f6 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 + |