linux-postmarketos-omap: upgrade to 6.10 (MR 5530)

This commit is contained in:
Mighty 2024-08-24 17:53:15 +05:30 committed by Robert Eckelmann
parent b384c00f28
commit dc430f8a21
No known key found for this signature in database
GPG Key ID: 30C0D50BEF63BF54
5 changed files with 5 additions and 179 deletions

View File

@ -1,30 +1,3 @@
diff --git a/Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt b/Documentation/devicetree/bindings/input/twl-pwrbutton.txt
similarity index 64%
rename from Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
rename to Documentation/devicetree/bindings/input/twl-pwrbutton.txt
index f5021214e..b49e2608f 100644
--- a/Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
+++ b/Documentation/devicetree/bindings/input/twl-pwrbutton.txt
@@ -1,6 +1,6 @@
-Texas Instruments TWL family (twl4030) pwrbutton module
+Texas Instruments TWL family pwrbutton module
-This module is part of the TWL4030. For more details about the whole
+This module is part of a TWL chip. For more details about the whole
chip see Documentation/devicetree/bindings/mfd/ti,twl.yaml.
This module provides a simple power button event via an Interrupt.
@@ -8,8 +8,9 @@ This module provides a simple power button event via an Interrupt.
Required properties:
- compatible: should be one of the following
- "ti,twl4030-pwrbutton": For controllers compatible with twl4030
+ - "ti,twl6030-pwrbutton": For controllers compatible with twl6030
- interrupts: should be one of the following
- - <8>: For controllers compatible with twl4030
+ - <8>: For controllers compatible with the twl
Example:
diff --git a/arch/arm/boot/dts/ti/omap/twl6030.dtsi b/arch/arm/boot/dts/ti/omap/twl6030.dtsi
index 9d588cfaa..ac033debf 100644
--- a/arch/arm/boot/dts/ti/omap/twl6030.dtsi

View File

@ -1,42 +0,0 @@
From 350df21c4f01137e3d29f445e36aeb6c82b85e34 Mon Sep 17 00:00:00 2001
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
Date: Mon, 11 Sep 2023 10:34:54 +0200
Subject: [PATCH 1/2] bq27xxx_battery: map edv1 to low battery capacity
EDV1 is the most reliable indicator for battery low state on the N900/bq27200,
and the driver already exposes it in the POWER_SUPPLY_PROP_CAPACITY_LEVEL (Low)
and POWER_SUPPLY_PROP_HEALTH (Dead) properties. However, most userspace,
including upower, does not use these properties for decision-making. Map EDV1
state to very low battery capacity to force userspace to act on EDV1.
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
drivers/power/supply/bq27xxx_battery.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 4296600e8912..0789061ae9a0 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -1851,7 +1851,17 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
cache.time_to_full = bq27xxx_battery_read_time(di, BQ27XXX_REG_TTF);
cache.charge_full = bq27xxx_battery_read_fcc(di);
- cache.capacity = bq27xxx_battery_read_soc(di);
+
+ /* HACK: If EDV1 flag is set, force capacity to report 1%, even though
+ * SEDV1 actually represents about 6.25%, per datasheet. This is to ensure
+ * that userspace, such as upower, can readily react to the true battery low
+ * state (EDV1 set) whether or not the reported SoC value is reliable.
+ */
+ if (cache.flags & BQ27000_FLAG_EDV1)
+ cache.capacity = 1;
+ else
+ cache.capacity = bq27xxx_battery_read_soc(di);
+
if (di->regs[BQ27XXX_REG_AE] != INVALID_REG_ADDR)
cache.energy = bq27xxx_battery_read_energy(di);
di->cache.flags = cache.flags;
--
2.40.1

View File

@ -1,65 +0,0 @@
From 456b5d133e026811fd735096ff3884823279879c Mon Sep 17 00:00:00 2001
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
Date: Mon, 11 Sep 2023 11:14:56 +0200
Subject: [PATCH] bq27xxx_battery: add voltage-based capacity estimation
Use battery voltage to approximate the battery capacity, if the fuel gauge does
not have valid data.
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
drivers/power/supply/bq27xxx_battery.c | 28 ++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 0789061ae9a0..9476caed0ef4 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -1017,6 +1017,8 @@ static struct {
static DEFINE_MUTEX(bq27xxx_list_lock);
static LIST_HEAD(bq27xxx_battery_devices);
+static int bq27xxx_battery_voltage(struct bq27xxx_device_info *di,
+ union power_supply_propval *val);
#define BQ27XXX_MSLEEP(i) usleep_range((i)*1000, (i)*1000+500)
@@ -1857,11 +1859,33 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
* that userspace, such as upower, can readily react to the true battery low
* state (EDV1 set) whether or not the reported SoC value is reliable.
*/
- if (cache.flags & BQ27000_FLAG_EDV1)
+ if (cache.flags & BQ27000_FLAG_EDV1) {
cache.capacity = 1;
- else
+ } else {
cache.capacity = bq27xxx_battery_read_soc(di);
+ /* Use voltage to estimate capacity if valid data is not available in the
+ * fuel gauge.
+ */
+ if ((cache.capacity == 0) &&
+ bq27xxx_battery_capacity_inaccurate(di, cache.flags)) {
+ union power_supply_propval bqval;
+ bq27xxx_battery_voltage(di, &bqval);
+ if (bqval.intval > 4000000)
+ cache.capacity = 90;
+ else if (bqval.intval > 3840000)
+ cache.capacity = 80;
+ else if (bqval.intval > 3680000)
+ cache.capacity = 50;
+ else if (bqval.intval > 3550000)
+ cache.capacity = 30;
+ else if (bqval.intval > 3450000)
+ cache.capacity = 20;
+ else
+ cache.capacity = 10;
+ }
+ }
+
if (di->regs[BQ27XXX_REG_AE] != INVALID_REG_ADDR)
cache.energy = bq27xxx_battery_read_energy(di);
di->cache.flags = cache.flags;
--
2.40.1

View File

@ -1,33 +0,0 @@
From 5ecf87e2f723fddf7437427678156288537b3525 Mon Sep 17 00:00:00 2001
From: Arthur Demchenkov <spinal.by@gmail.com>
Date: Wed, 28 Feb 2024 10:20:56 +0200
Subject: [PATCH] ARM: dts: n900: set charge current limit to 950mA
The vendor kernel used 950mA as the default. The same value works fine on
the mainline Linux kernel, and has been tested extensively under Maemo
Leste [1] and postmarketOS, who have been using it for a number of years.
[1] https://github.com/maemo-leste/n9xx-linux/commit/fbc4ce7a84e59215914a8981afe918002b191493
Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com>
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
arch/arm/boot/dts/ti/omap/omap3-n900.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ti/omap/omap3-n900.dts b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
index d33485341251..07c5b963af78 100644
--- a/arch/arm/boot/dts/ti/omap/omap3-n900.dts
+++ b/arch/arm/boot/dts/ti/omap/omap3-n900.dts
@@ -754,7 +754,7 @@ bq24150a: bq24150a@6b {
ti,current-limit = <100>;
ti,weak-battery-voltage = <3400>;
ti,battery-regulation-voltage = <4200>;
- ti,charge-current = <650>;
+ ti,charge-current = <950>;
ti,termination-current = <100>;
ti,resistor-sense = <68>;
--
2.43.0

View File

@ -3,15 +3,14 @@
# Kernel config based on: arch/arm/configs/omap2plus_defconfig
pkgname=linux-postmarketos-omap
pkgver=6.9.3
pkgrel=2
pkgver=6.10.6
pkgrel=0
pkgdesc="Mainline kernel fork for OMAP devices"
arch="armv7"
url="https://kernel.org/"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native pmb:kconfigcheck-community"
makedepends="bash bison findutils flex openssl-dev perl gmp-dev mpc1-dev mpfr-dev postmarketos-installkernel xz"
makedepends="bash bison findutils flex linux-headers openssl-dev perl gmp-dev mpc1-dev mpfr-dev postmarketos-installkernel xz"
_carch="arm"
_flavor="postmarketos-omap"
_config="config-$_flavor.armv7"
@ -42,9 +41,6 @@ source="
0007-hsi-ssi_port-force-pio-path.patch
0008-n900-dts-volume-keys.patch
0009-ARM-dts-disable-twl-off-idle-configuration-for-N900.patch
0010-bq27xxx_battery-map-edv1-to-low-battery-capacity.patch
0011-bq27xxx_battery-add-voltage-based-capacity-estimatio.patch
0012-ARM-dts-n900-set-charge-current-limit-to-950mA.patch
"
builddir="$srcdir/linux-$_kernver"
replaces="linux-samsung-espresso3g linux-nokia-n900"
@ -74,18 +70,15 @@ package() {
}
sha512sums="
119320627a73c260725a51ee4234942cc137aeb8b7c67428204ae14e3b518cf7b770e75a8dd0df7fa910333a64241146eb8f93463163f386dae8ddbd6943a631 linux-6.9.3.tar.xz
991ec7c7d2d490cb90b182a29e892dae586918eee7f3ff4b6e26f4ff9b31b6d7a31cdc31d25ca12243ecab59787aad75f0056b2fbe6997d0dfd68c357e7703af linux-6.10.6.tar.xz
b0bcd5aa9db5479d6daa310a9e167fd3316d523b5077c6aa25547af0c39249a4f1f94afb7e64b6bd626f05c949dd8baa76b3b55e4e642df55de9ffe786284564 config-postmarketos-omap.armv7
9a187d93885f07467ec67094621b2d762607d58622e67172bdfcd8ba5f3d6aab900ca5d233efd3d447540f9b906ba950083a35997c84b315801604e1cd5cddc3 0001-Add-TWL6032-dtsi.patch
f7d1a87088c65278a114125e732d5bebebb560a6245afb34e003083d808ef3f8c5f49ff23131953508a6daae111ab6adfffdbcf56b79260a6d4115f859c7bb3a 0002-arm-dts-Add-common-dtsi-for-espresso.patch
089ca0547997c7cd5d1b65924c134eb6b7703a7439729923d3639d125763412fa7e826d1cb839ac0b6cd22e614f69a3b52605a75b571e271c33f9a27ff6ac9c2 0003-arm-dts-Add-espresso7-support.patch
97f6671bd6fa02d095b726793a3ae68a5b94b0a89719006121a6eaf1607c477f74446489a0f62250edc3c193945f571c92196c85ec8043ae18a141ea9adffd51 0004-arm-dts-Add-espresso10-support.patch
fe9ce7ed5757a1e72663c15e80cef47531b80150e8c45fa94c03a291edc39a401c0678894c3f7afbe9b78b5cbe88529982bd6c90ab3f515c31199e6939aa3b96 0005-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
8d14c1e7946cee7f7301a909f4e41ed9c909f0de84190006dfc370558bccaf2113a5f00a303a6d623ebd7064098300db9d89b64506a4abd65cadc79d2be997fd 0005-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
1a68e3a32ae1e56d325c0f759ee66d64d14f46a5d52e75ae008dfddac335beb3aa7acaf62abb95b6d5ce1557f0cf9b4c31ab78e110af178db1ac963bb377dbf0 0006-iio-rescale-revert-logic.patch
c3af9715b3559c2d593f4fcfa078730722c7deeec132c5b83e085ff4d9815d85ef349384097c580efe1bbc37c60f42e18ef559f0abccfe236080670e4403fa77 0007-hsi-ssi_port-force-pio-path.patch
b98ce806b3d5a0122086e4c9670639174470ff6d29851c60258cc5d699ce9a479dbf4996b24299fc075d25e9fe8f6b1250fafdff742deea0ddeaf53d342a9d72 0008-n900-dts-volume-keys.patch
66abb5548910ad369608b08200f5835d5a8526c04cc3617221ef546f3e3d22cd944db91dc6727a5c26a102b24d8ef1306ea01254c9c382759afced91b31747ef 0009-ARM-dts-disable-twl-off-idle-configuration-for-N900.patch
6680b264db0c992826f9da0078256ba20ffae3de26a77978106b94499d96e72ed90d9a35bb42be38bae1e798e7ddf068e3c5e7fe63462b3bbad5031195622192 0010-bq27xxx_battery-map-edv1-to-low-battery-capacity.patch
cd91f0bb59e466c517b498a549357325be884bb1884986e593fef905a6210872024e0cab179df03833dfc6e8d1221441fa384466ae8227d82f6e70b22fce655c 0011-bq27xxx_battery-add-voltage-based-capacity-estimatio.patch
a11493d762b8f1ee90384e1d2baba7c6b7b37f4c11a8e6a876c1476de52b44a8f5a93db2bcd0fe68bb7e91dd54c76396b46727f8e94fc4aad1754feed3822061 0012-ARM-dts-n900-set-charge-current-limit-to-950mA.patch
"