* [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
@ 2026-10-03 19:45 ` Fabricio Akio via B4 Relay
2026-10-04 8:06 ` Krzysztof Kozlowski
2026-10-09 6:53 ` Krzysztof Kozlowski
2026-10-03 19:45 ` [PATCH 2/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
` (5 subsequent siblings)
6 siblings, 2 replies; 16+ messages in thread
From: Fabricio Akio via B4 Relay @ 2026-10-03 19:45 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel, Fabricio Akio
From: Fabricio Akio <fabricioakio@gmail.com>
The charger raises an interrupt when its charging state changes. Allow
it as an optional fifth interrupt.
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
.../devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
index 70f5cd6eaeab..7dfb0823ccbb 100644
--- a/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
@@ -19,14 +19,17 @@ properties:
maxItems: 1
interrupts:
- maxItems: 4
+ minItems: 4
+ maxItems: 5
interrupt-names:
+ minItems: 4
items:
- const: usb-plugin
- const: bat-ov
- const: wdog-bark
- const: usbin-icl-change
+ - const: chg-state-change
io-channels:
items:
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change
2026-10-03 19:45 ` [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change Fabricio Akio via B4 Relay
@ 2026-10-04 8:06 ` Krzysztof Kozlowski
2026-10-04 11:58 ` Fabricio Akio
2026-10-09 6:53 ` Krzysztof Kozlowski
1 sibling, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-04 8:06 UTC (permalink / raw)
To: Fabricio Akio
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, phone-devel,
Richard Acayan, linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On Sat, Oct 03, 2026 at 04:45:21PM -0300, Fabricio Akio wrote:
> The charger raises an interrupt when its charging state changes. Allow
Each of the ones mentioned in the binding?
> it as an optional fifth interrupt.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change
2026-10-04 8:06 ` Krzysztof Kozlowski
@ 2026-10-04 11:58 ` Fabricio Akio
0 siblings, 0 replies; 16+ messages in thread
From: Fabricio Akio @ 2026-10-04 11:58 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, phone-devel,
Richard Acayan, linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On Sun, Oct 04, 2026 at 10:06:52AM +0200, Krzysztof Kozlowski wrote:
> On Sat, Oct 03, 2026 at 04:45:21PM -0300, Fabricio Akio wrote:
> > The charger raises an interrupt when its charging state changes. Allow
>
> Each of the ones mentioned in the binding?
Yes, both. PMI8998 and PM660 have it as interrupt 1 of the charger
peripheral at 0x1000, as the downstream msm-pmi8998.dtsi and
msm-pm660.dtsi describe.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change
2026-10-03 19:45 ` [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change Fabricio Akio via B4 Relay
2026-10-04 8:06 ` Krzysztof Kozlowski
@ 2026-10-09 6:53 ` Krzysztof Kozlowski
1 sibling, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-09 6:53 UTC (permalink / raw)
To: Fabricio Akio
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, phone-devel,
Richard Acayan, linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On Sat, Oct 03, 2026 at 04:45:21PM -0300, Fabricio Akio wrote:
> The charger raises an interrupt when its charging state changes. Allow
> it as an optional fifth interrupt.
>
> Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
> ---
> .../devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
2026-10-03 19:45 ` [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change Fabricio Akio via B4 Relay
@ 2026-10-03 19:45 ` Fabricio Akio via B4 Relay
2026-10-22 22:46 ` Alexey Minnekhanov
2026-12-04 22:59 ` Andrey Derkach
2026-10-03 19:45 ` [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt Fabricio Akio via B4 Relay
` (4 subsequent siblings)
6 siblings, 2 replies; 16+ messages in thread
From: Fabricio Akio via B4 Relay @ 2026-10-03 19:45 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel, Fabricio Akio
From: Fabricio Akio <fabricioakio@gmail.com>
Nothing notifies consumers when the charging state changes on its own,
as when a charge completes, so they can keep a stale status.
Request the chg-state-change interrupt when the device tree provides
it, and notify consumers when it fires.
Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
drivers/power/supply/qcom_smbx.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
index f5557b8cc92a..3738eb8638bc 100644
--- a/drivers/power/supply/qcom_smbx.c
+++ b/drivers/power/supply/qcom_smbx.c
@@ -762,6 +762,15 @@ static irqreturn_t smb_handle_usb_icl_change(int irq, void *data)
return IRQ_HANDLED;
}
+static irqreturn_t smb_handle_chg_state_change(int irq, void *data)
+{
+ struct smb_chip *chip = data;
+
+ power_supply_changed(chip->chg_psy);
+
+ return IRQ_HANDLED;
+}
+
static irqreturn_t smb_handle_wdog_bark(int irq, void *data)
{
struct smb_chip *chip = data;
@@ -1078,6 +1087,21 @@ static int smb_probe(struct platform_device *pdev)
if (rc < 0)
return rc;
+ /* Optional: not every device tree lists it */
+ irq = platform_get_irq_byname_optional(pdev, "chg-state-change");
+ if (irq > 0) {
+ rc = devm_request_threaded_irq(chip->dev, irq, NULL,
+ smb_handle_chg_state_change,
+ IRQF_ONESHOT, "chg-state-change",
+ chip);
+ if (rc < 0)
+ return dev_err_probe(chip->dev, rc,
+ "Couldn't request irq chg-state-change\n");
+ } else if (irq != -ENXIO) {
+ return dev_err_probe(chip->dev, irq,
+ "Couldn't get irq chg-state-change\n");
+ }
+
devm_device_init_wakeup(chip->dev);
rc = devm_pm_set_wake_irq(chip->dev, chip->cable_irq);
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH 2/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 ` [PATCH 2/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
@ 2026-10-22 22:46 ` Alexey Minnekhanov
2026-12-04 22:59 ` Andrey Derkach
1 sibling, 0 replies; 16+ messages in thread
From: Alexey Minnekhanov @ 2026-10-22 22:46 UTC (permalink / raw)
To: fabricioakio, Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On 03.10.2026 22:45, Fabricio Akio via B4 Relay wrote:
> From: Fabricio Akio <fabricioakio@gmail.com>
>
> Nothing notifies consumers when the charging state changes on its own,
> as when a charge completes, so they can keep a stale status.
>
> Request the chg-state-change interrupt when the device tree provides
> it, and notify consumers when it fires.
>
> Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
> Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
> ---
> drivers/power/supply/qcom_smbx.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
> index f5557b8cc92a..3738eb8638bc 100644
> --- a/drivers/power/supply/qcom_smbx.c
> +++ b/drivers/power/supply/qcom_smbx.c
> @@ -762,6 +762,15 @@ static irqreturn_t smb_handle_usb_icl_change(int irq, void *data)
> return IRQ_HANDLED;
> }
>
> +static irqreturn_t smb_handle_chg_state_change(int irq, void *data)
> +{
> + struct smb_chip *chip = data;
> +
> + power_supply_changed(chip->chg_psy);
> +
> + return IRQ_HANDLED;
> +}
> +
> static irqreturn_t smb_handle_wdog_bark(int irq, void *data)
> {
> struct smb_chip *chip = data;
> @@ -1078,6 +1087,21 @@ static int smb_probe(struct platform_device *pdev)
> if (rc < 0)
> return rc;
>
> + /* Optional: not every device tree lists it */
> + irq = platform_get_irq_byname_optional(pdev, "chg-state-change");
> + if (irq > 0) {
> + rc = devm_request_threaded_irq(chip->dev, irq, NULL,
> + smb_handle_chg_state_change,
> + IRQF_ONESHOT, "chg-state-change",
> + chip);
> + if (rc < 0)
> + return dev_err_probe(chip->dev, rc,
> + "Couldn't request irq chg-state-change\n");
> + } else if (irq != -ENXIO) {
> + return dev_err_probe(chip->dev, irq,
> + "Couldn't get irq chg-state-change\n");
> + }
> +
> devm_device_init_wakeup(chip->dev);
>
> rc = devm_pm_set_wake_irq(chip->dev, chip->cable_irq);
>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
--
Regards,
Alexey Minnekhanov
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH 2/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 ` [PATCH 2/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
2026-10-22 22:46 ` Alexey Minnekhanov
@ 2026-12-04 22:59 ` Andrey Derkach
1 sibling, 0 replies; 16+ messages in thread
From: Andrey Derkach @ 2026-12-04 22:59 UTC (permalink / raw)
To: Fabricio Akio
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, Richard Acayan,
Sebastian Reichel, phone-devel, linux-arm-msm, linux-pm,
devicetree, linux-kernel
On Sat, Oct 03, 2026 at 04:45:22PM -0300, Fabricio Akio wrote:
> Nothing notifies consumers when the charging state changes on its own,
> as when a charge completes, so they can keep a stale status.
>
> Request the chg-state-change interrupt when the device tree provides
> it, and notify consumers when it fires.
Tested on a Xiaomi Mi 9 SE (SDM712, PM660) with patches 1-3 on top of
the sdm670-mainline 7.3.7 tree and the phone's device tree, which is not
upstream yet. With the battery full on the charger, the interrupt fired
when the cable was pulled, and again about a second after it was plugged
back in, when the charger went from "Not charging" back to "Full". The
usb-plugin count moved separately.
Tested-by: Andrey Derkach <gabin278@gmail.com> # Xiaomi Mi 9 SE (PM660)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
2026-10-03 19:45 ` [PATCH 1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change Fabricio Akio via B4 Relay
2026-10-03 19:45 ` [PATCH 2/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
@ 2026-10-03 19:45 ` Fabricio Akio via B4 Relay
2026-10-22 23:01 ` Alexey Minnekhanov
2026-12-04 22:59 ` Andrey Derkach
2026-10-03 19:45 ` [PATCH 4/4] arm64: dts: qcom: pmi8998: " Fabricio Akio via B4 Relay
` (3 subsequent siblings)
6 siblings, 2 replies; 16+ messages in thread
From: Fabricio Akio via B4 Relay @ 2026-10-03 19:45 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel, Fabricio Akio
From: Fabricio Akio <fabricioakio@gmail.com>
Describe the charger's chg-state-change interrupt, as the vendor device
tree does.
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
arch/arm64/boot/dts/qcom/pm660.dtsi | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
index 156b2ddff0dc..9e84f16f4b06 100644
--- a/arch/arm64/boot/dts/qcom/pm660.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
@@ -80,8 +80,13 @@ pm660_charger: charger@1000 {
interrupts = <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
- <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
- interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
+ <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
+ <0x0 0x10 0x1 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "usb-plugin",
+ "bat-ov",
+ "wdog-bark",
+ "usbin-icl-change",
+ "chg-state-change";
io-channels = <&pm660_rradc 3>,
<&pm660_rradc 4>;
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt
2026-10-03 19:45 ` [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt Fabricio Akio via B4 Relay
@ 2026-10-22 23:01 ` Alexey Minnekhanov
2026-12-04 22:59 ` Andrey Derkach
1 sibling, 0 replies; 16+ messages in thread
From: Alexey Minnekhanov @ 2026-10-22 23:01 UTC (permalink / raw)
To: fabricioakio, Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On 03.10.2026 22:45, Fabricio Akio via B4 Relay wrote:
> From: Fabricio Akio <fabricioakio@gmail.com>
>
> Describe the charger's chg-state-change interrupt, as the vendor device
> tree does.
>
> Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
> ---
> arch/arm64/boot/dts/qcom/pm660.dtsi | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
> index 156b2ddff0dc..9e84f16f4b06 100644
> --- a/arch/arm64/boot/dts/qcom/pm660.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
> @@ -80,8 +80,13 @@ pm660_charger: charger@1000 {
> interrupts = <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
> <0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
> <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
> - <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
> - interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
> + <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
> + <0x0 0x10 0x1 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "usb-plugin",
> + "bat-ov",
> + "wdog-bark",
> + "usbin-icl-change",
> + "chg-state-change";
>
> io-channels = <&pm660_rradc 3>,
> <&pm660_rradc 4>;
>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
--
Regards,
Alexey Minnekhanov
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt
2026-10-03 19:45 ` [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt Fabricio Akio via B4 Relay
2026-10-22 23:01 ` Alexey Minnekhanov
@ 2026-12-04 22:59 ` Andrey Derkach
1 sibling, 0 replies; 16+ messages in thread
From: Andrey Derkach @ 2026-12-04 22:59 UTC (permalink / raw)
To: Fabricio Akio
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, Richard Acayan,
Sebastian Reichel, phone-devel, linux-arm-msm, linux-pm,
devicetree, linux-kernel
On Sat, Oct 03, 2026 at 04:45:23PM -0300, Fabricio Akio wrote:
> Describe the charger's chg-state-change interrupt, as the vendor device
> tree does.
Tested together with 2/4 on a Xiaomi Mi 9 SE (SDM712, PM660): the
interrupt is requested and fires on charging state changes.
Tested-by: Andrey Derkach <gabin278@gmail.com> # Xiaomi Mi 9 SE (PM660)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/4] arm64: dts: qcom: pmi8998: Add the charger state change interrupt
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
` (2 preceding siblings ...)
2026-10-03 19:45 ` [PATCH 3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt Fabricio Akio via B4 Relay
@ 2026-10-03 19:45 ` Fabricio Akio via B4 Relay
2026-10-27 8:22 ` [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Adrian Nguyen
` (2 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Fabricio Akio via B4 Relay @ 2026-10-03 19:45 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel, Fabricio Akio
From: Fabricio Akio <fabricioakio@gmail.com>
Describe the charger's chg-state-change interrupt, as the vendor device
tree does.
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
---
arch/arm64/boot/dts/qcom/pmi8998.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
index cd3f0790fd42..bd07ff137947 100644
--- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
@@ -16,11 +16,13 @@ pmi8998_charger: charger@1000 {
interrupts = <0x2 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
<0x2 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
- <0x2 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
+ <0x2 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x10 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "usb-plugin",
"bat-ov",
"wdog-bark",
- "usbin-icl-change";
+ "usbin-icl-change",
+ "chg-state-change";
io-channels = <&pmi8998_rradc 3>,
<&pmi8998_rradc 4>;
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH 0/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
` (3 preceding siblings ...)
2026-10-03 19:45 ` [PATCH 4/4] arm64: dts: qcom: pmi8998: " Fabricio Akio via B4 Relay
@ 2026-10-27 8:22 ` Adrian Nguyen
2026-11-09 1:22 ` (subset) " Sebastian Reichel
2026-12-04 19:42 ` Bjorn Andersson
6 siblings, 0 replies; 16+ messages in thread
From: Adrian Nguyen @ 2026-10-27 8:22 UTC (permalink / raw)
To: Fabricio Akio
Cc: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Robin Snyders, David Heidelberg, Richard Acayan,
Sebastian Reichel, phone-devel, linux-arm-msm, linux-pm,
devicetree, linux-kernel
On Sat, 03 Oct 2026 16:45:20 -0300, Fabricio Akio wrote:
> qcom_smbx does not handle the charger's chg-state-change interrupt, so
> a charge completing is not notified and consumers can keep a stale
> status.
Tested on a Vsmart Active 1 (SDM660/PM660). Switching charge_behaviour
between inhibit-charge and auto now fires chg-state-change once per
switch, with a uevent carrying the new status. A charge_behaviour write
alone doesn't send one, so this is what lets userspace notice.
Tested-by: Adrian Nguyen <thenguyen1024@gmail.com> # Vsmart Active 1 (PM660)
(Test script and mail drafted with an LLM assistant.)
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: (subset) [PATCH 0/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
` (4 preceding siblings ...)
2026-10-27 8:22 ` [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Adrian Nguyen
@ 2026-11-09 1:22 ` Sebastian Reichel
2026-12-04 19:42 ` Bjorn Andersson
6 siblings, 0 replies; 16+ messages in thread
From: Sebastian Reichel @ 2026-11-09 1:22 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Fabricio Akio
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel
On Sat, 03 Oct 2026 16:45:20 -0300, Fabricio Akio wrote:
> qcom_smbx does not handle the charger's chg-state-change interrupt, so
> a charge completing is not notified and consumers can keep a stale
> status. Allow the interrupt in the binding, handle it in the driver,
> and describe it for PM660 and PMI8998.
>
> Tested on a Motorola Moto X4 (PM660) with the sdm660-mainline 7.2.3
> tree: each charging-state change is notified and the battery status
> follows. The PMI8998 patch is untested on hardware.
>
> [...]
Applied, thanks!
[1/4] dt-bindings: power: supply: qcom,pmi8998-charger: add chg-state-change
commit: 4e5927d83004c2ee0b3567f649eb63c5e444bde9
[2/4] power: supply: qcom_smbx: report charger state changes
commit: 275c40e43b0d3671d79fa143e664eb4fc0bed96f
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: (subset) [PATCH 0/4] power: supply: qcom_smbx: report charger state changes
2026-10-03 19:45 [PATCH 0/4] power: supply: qcom_smbx: report charger state changes Fabricio Akio via B4 Relay
` (5 preceding siblings ...)
2026-11-09 1:22 ` (subset) " Sebastian Reichel
@ 2026-12-04 19:42 ` Bjorn Andersson
2026-12-04 20:32 ` David Heidelberg
6 siblings, 1 reply; 16+ messages in thread
From: Bjorn Andersson @ 2026-12-04 19:42 UTC (permalink / raw)
To: Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Konrad Dybcio, Abel Vesa,
Fabricio Akio
Cc: Robin Snyders, David Heidelberg, phone-devel, Richard Acayan,
linux-arm-msm, linux-pm, devicetree, linux-kernel,
Sebastian Reichel
On Sat, 03 Oct 2026 16:45:20 -0300, Fabricio Akio wrote:
> qcom_smbx does not handle the charger's chg-state-change interrupt, so
> a charge completing is not notified and consumers can keep a stale
> status. Allow the interrupt in the binding, handle it in the driver,
> and describe it for PM660 and PMI8998.
>
> Tested on a Motorola Moto X4 (PM660) with the sdm660-mainline 7.2.3
> tree: each charging-state change is notified and the battery status
> follows. The PMI8998 patch is untested on hardware.
>
> [...]
Applied, thanks!
[3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt
commit: a44322df1f9a40d42f9f9bd8a5c27e11b76838c8
[4/4] arm64: dts: qcom: pmi8998: Add the charger state change interrupt
commit: 3e4becd5b74f3078803179a0f14a9296a07a70e6
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: (subset) [PATCH 0/4] power: supply: qcom_smbx: report charger state changes
2026-12-04 19:42 ` Bjorn Andersson
@ 2026-12-04 20:32 ` David Heidelberg
0 siblings, 0 replies; 16+ messages in thread
From: David Heidelberg @ 2026-12-04 20:32 UTC (permalink / raw)
To: Bjorn Andersson, Casey Connolly, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Konrad Dybcio, Abel Vesa,
Fabricio Akio
Cc: Robin Snyders, phone-devel, Richard Acayan, linux-arm-msm,
linux-pm, devicetree, linux-kernel, Sebastian Reichel
On 04/12/2026 20:42, Bjorn Andersson wrote:
>
> On Sat, 03 Oct 2026 16:45:20 -0300, Fabricio Akio wrote:
>> qcom_smbx does not handle the charger's chg-state-change interrupt, so
>> a charge completing is not notified and consumers can keep a stale
>> status. Allow the interrupt in the binding, handle it in the driver,
>> and describe it for PM660 and PMI8998.
>>
>> Tested on a Motorola Moto X4 (PM660) with the sdm660-mainline 7.2.3
>> tree: each charging-state change is notified and the battery status
>> follows. The PMI8998 patch is untested on hardware.
>>
>> [...]
>
> Applied, thanks!
>
> [3/4] arm64: dts: qcom: pm660: Add the charger state change interrupt
> commit: a44322df1f9a40d42f9f9bd8a5c27e11b76838c8
> [4/4] arm64: dts: qcom: pmi8998: Add the charger state change interrupt
> commit: 3e4becd5b74f3078803179a0f14a9296a07a70e6
Fabricio made 1/4, 2/4 Cc: stable, but DT changes seems to miss the stable tag,
Since without these changes the codepaths won't get executed, I would propose
these for stable later, would that be reasonable?
David
>
> Best regards,
^ permalink raw reply [flat|nested] 16+ messages in thread