From d53f297ef928933d2e0c955742d440d0c3d7a150 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 9 Nov 2010 23:41:52 +0530 Subject: Bump upower, update patch --- .../upower/files/upower-0.9.7-linux-2.6.36.patch | 26 +++++++++++++++++ .../upower-dell-samsung-sdi-battery-quirk.patch | 34 +++++++++++++++------- 2 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 sys-power/upower/files/upower-0.9.7-linux-2.6.36.patch (limited to 'sys-power/upower/files') 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 +Date: Thu, 04 Nov 2010 22:45:10 +0000 +Subject: Fix compilation eror against Linux 2.6.36 + +Include so that 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 + #include + #include ++#include + #include + #include + #include +-- +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 +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 + -- cgit v1.2.3-65-gdbad