diff options
author | 2021-07-16 12:03:58 +0200 | |
---|---|---|
committer | 2021-07-16 13:23:40 +0200 | |
commit | 052c810f21548e913e83f9e6d335ec5047a0eba0 (patch) | |
tree | f9497dda10ab77537dfde6c0aec7b1dbed70ba65 /sys-power/upower/files | |
parent | kde-misc/kdiff3: Drop 1.8.5 (diff) | |
download | gentoo-052c810f21548e913e83f9e6d335ec5047a0eba0.tar.gz gentoo-052c810f21548e913e83f9e6d335ec5047a0eba0.tar.bz2 gentoo-052c810f21548e913e83f9e6d335ec5047a0eba0.zip |
sys-power/upower: 0.99.12 version bump
- EAPI-8 bump
- Raise app-pda/libplist minimum version to >=2
- Drop virtual/libusb dependency
- Add notice about dropped support for old devices
Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Closes: https://bugs.gentoo.org/796896
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sys-power/upower/files')
-rw-r--r-- | sys-power/upower/files/upower-0.99.12-fix-power_now-energy_rate-readings.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sys-power/upower/files/upower-0.99.12-fix-power_now-energy_rate-readings.patch b/sys-power/upower/files/upower-0.99.12-fix-power_now-energy_rate-readings.patch new file mode 100644 index 000000000000..c3dd864a6b1d --- /dev/null +++ b/sys-power/upower/files/upower-0.99.12-fix-power_now-energy_rate-readings.patch @@ -0,0 +1,43 @@ +From 2949136b152e94aa3b57da5130bcb9022724debe Mon Sep 17 00:00:00 2001 +From: Philipp Zabel <p.zabel@pengutronix.de> +Date: Thu, 17 Jun 2021 18:14:53 +0200 +Subject: [PATCH] linux: Fix < 0.01 W energy-rate readings from power_now sysfs + property + +Currently, if a power supplies' power_now sysfs file reports discharge +rates < 0.01 W, the code will try to calculate the discharge rate from +the legacy sysfs files. On new kernels where those don't exist, this +produces wrong results. + +For example, on a dual-battery Thinkpad T450s, while the external +battery is discharging, the internal battery reports power_now = 0, +but the corresponding upower energy-rate field incorrectly reads +about 2.3 W. + +This patch fixes the issue by falling back to the legacy code only if +the legacy current_now sysfs file exists. + +Closes: #7, #44 +--- + src/linux/up-device-supply.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c +index 3ebbd88..4236ce4 100644 +--- a/src/linux/up-device-supply.c ++++ b/src/linux/up-device-supply.c +@@ -682,8 +682,9 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply, + state = up_device_supply_get_state (native); + + /* this is the new value in uW */ +- energy_rate = fabs (g_udev_device_get_sysfs_attr_as_double_uncached (native, "power_now") / 1000000.0); +- if (energy_rate < 0.01) { ++ if (g_udev_device_has_sysfs_attr (native, "power_now")) { ++ energy_rate = fabs (g_udev_device_get_sysfs_attr_as_double_uncached (native, "power_now") / 1000000.0); ++ } else { + gdouble charge_full; + + /* convert charge to energy */ +-- +GitLab + |