Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] power: supply: Correct AB8505 charger device tree
@ 2026-09-15 21:46 Linus Walleij
  2026-09-15 21:46 ` [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts Linus Walleij
  2026-09-15 21:46 ` [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts Linus Walleij
  0 siblings, 2 replies; 9+ messages in thread
From: Linus Walleij @ 2026-09-15 21:46 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

AB8505 retains the USB charger from AB8500 but omits the separate main
charger block. Its charger node consequently has nine valid interrupts,
not the fourteen interrupts used by AB8500.

Adjust the binding to describe the variant-specific interrupt sets and
remove the five nonexistent main-charger interrupts from the AB8505
device tree. The binding update also limits the autopower_cfg description
to AB8500, since the corresponding AB8505 register bit is reserved.

Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
Linus Walleij (2):
      dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
      ARM: dts: ux500: Drop AB8505 main charger interrupts

 .../power/supply/stericsson,ab8500-charger.yaml    | 44 ++++++++++++++--------
 arch/arm/boot/dts/st/ste-ab8505.dtsi               | 14 +------
 2 files changed, 30 insertions(+), 28 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260915-ab8500-charger-dt-99c2c4623a80

Best regards,
-- 
Linus Walleij <linusw@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
  2026-09-15 21:46 [PATCH 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
@ 2026-09-15 21:46 ` Linus Walleij
  2026-09-15 21:54   ` sashiko-bot
  2026-09-18  9:00   ` Krzysztof Kozlowski
  2026-09-15 21:46 ` [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts Linus Walleij
  1 sibling, 2 replies; 9+ messages in thread
From: Linus Walleij @ 2026-09-15 21:46 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

AB8505 has no main charger or main-charger interrupts. Permit its
nine USB charger interrupts as an alternative to the full set of
fourteen AB8500 interrupts.

Also clarify that autopower_cfg describes the AB8500 facility, since
the corresponding AB8505 register bit is reserved.

Fixes: eb917497734c ("dt-bindings: power: supply: ab8500: Convert to DT schema format")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
 .../power/supply/stericsson,ab8500-charger.yaml    | 44 ++++++++++++++--------
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
index 4f19744844e9..437b58e82e9a 100644
--- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
@@ -28,27 +28,39 @@ properties:
 
   autopower_cfg:
     type: boolean
-    description: automatic poweron after powerloss
+    description: AB8500 automatic poweron after powerloss
 
   interrupts:
+    minItems: 9
     maxItems: 14
 
   interrupt-names:
-    items:
-      - const: MAIN_CH_UNPLUG_DET
-      - const: MAIN_CHARGE_PLUG_DET
-      - const: MAIN_EXT_CH_NOT_OK
-      - const: MAIN_CH_TH_PROT_R
-      - const: MAIN_CH_TH_PROT_F
-      - const: VBUS_DET_F
-      - const: VBUS_DET_R
-      - const: USB_LINK_STATUS
-      - const: USB_CH_TH_PROT_R
-      - const: USB_CH_TH_PROT_F
-      - const: USB_CHARGER_NOT_OKR
-      - const: VBUS_OVV
-      - const: CH_WD_EXP
-      - const: VBUS_CH_DROP_END
+    oneOf:
+      - items:
+          - const: MAIN_CH_UNPLUG_DET
+          - const: MAIN_CHARGE_PLUG_DET
+          - const: MAIN_EXT_CH_NOT_OK
+          - const: MAIN_CH_TH_PROT_R
+          - const: MAIN_CH_TH_PROT_F
+          - const: VBUS_DET_F
+          - const: VBUS_DET_R
+          - const: USB_LINK_STATUS
+          - const: USB_CH_TH_PROT_R
+          - const: USB_CH_TH_PROT_F
+          - const: USB_CHARGER_NOT_OKR
+          - const: VBUS_OVV
+          - const: CH_WD_EXP
+          - const: VBUS_CH_DROP_END
+      - items:
+          - const: VBUS_DET_F
+          - const: VBUS_DET_R
+          - const: USB_LINK_STATUS
+          - const: USB_CH_TH_PROT_R
+          - const: USB_CH_TH_PROT_F
+          - const: USB_CHARGER_NOT_OKR
+          - const: VBUS_OVV
+          - const: CH_WD_EXP
+          - const: VBUS_CH_DROP_END
 
   io-channels:
     minItems: 2

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts
  2026-09-15 21:46 [PATCH 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
  2026-09-15 21:46 ` [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts Linus Walleij
@ 2026-09-15 21:46 ` Linus Walleij
  2026-09-15 21:53   ` sashiko-bot
  1 sibling, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2026-09-15 21:46 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

The AB8505 interrupt table explicitly omits the five interrupt
sources belonging to the AB8500 main charger. Remove these nonexistent
interrupts from the AB8505 charger node, leaving its nine USB charger
interrupts.

Fixes: bc324d447fba ("ARM: dts: ux500: Add interrupts to charger")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
 arch/arm/boot/dts/st/ste-ab8505.dtsi | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
index 131c82508e82..f7208e689d09 100644
--- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
@@ -138,12 +138,7 @@ ab8500_btemp {
 
 				ab8500_charger {
 					compatible = "stericsson,ab8500-charger";
-					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
-						     <11 IRQ_TYPE_LEVEL_HIGH>,
-						     <0 IRQ_TYPE_LEVEL_HIGH>,
-						     <107 IRQ_TYPE_LEVEL_HIGH>,
-						     <106 IRQ_TYPE_LEVEL_HIGH>,
-						     <14 IRQ_TYPE_LEVEL_HIGH>,
+					interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
 						     <15 IRQ_TYPE_LEVEL_HIGH>,
 						     <79 IRQ_TYPE_LEVEL_HIGH>,
 						     <105 IRQ_TYPE_LEVEL_HIGH>,
@@ -152,12 +147,7 @@ ab8500_charger {
 						     <22 IRQ_TYPE_LEVEL_HIGH>,
 						     <21 IRQ_TYPE_LEVEL_HIGH>,
 						     <16 IRQ_TYPE_LEVEL_HIGH>;
-					interrupt-names = "MAIN_CH_UNPLUG_DET",
-							  "MAIN_CHARGE_PLUG_DET",
-							  "MAIN_EXT_CH_NOT_OK",
-							  "MAIN_CH_TH_PROT_R",
-							  "MAIN_CH_TH_PROT_F",
-							  "VBUS_DET_F",
+					interrupt-names = "VBUS_DET_F",
 							  "VBUS_DET_R",
 							  "USB_LINK_STATUS",
 							  "USB_CH_TH_PROT_R",

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts
  2026-09-15 21:46 ` [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts Linus Walleij
@ 2026-09-15 21:53   ` sashiko-bot
  2026-09-16 12:58     ` Linus Walleij
  0 siblings, 1 reply; 9+ messages in thread
From: sashiko-bot @ 2026-09-15 21:53 UTC (permalink / raw)
  To: Linus Walleij; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] power: ab8500: probe fails due to missing main charger interrupts
--

commit e7da031c5be9d239332af239a1c3e397eaa17b40
Author: Linus Walleij <linusw@kernel.org>

ARM: dts: ux500: Drop AB8505 main charger interrupts

The AB8505 interrupt table explicitly omits the five interrupt
sources belonging to the AB8500 main charger. Remove these nonexistent
interrupts from the AB8505 charger node, leaving its nine USB charger
interrupts.

> diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
> index 131c82508e820..f7208e689d093 100644
> --- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
> +++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
> @@ -138,12 +138,7 @@ ab8500_btemp {
>  
>  				ab8500_charger {
>  					compatible = "stericsson,ab8500-charger";
> -					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
> -						     <11 IRQ_TYPE_LEVEL_HIGH>,
> -						     <0 IRQ_TYPE_LEVEL_HIGH>,
> -						     <107 IRQ_TYPE_LEVEL_HIGH>,
> -						     <106 IRQ_TYPE_LEVEL_HIGH>,
> -						     <14 IRQ_TYPE_LEVEL_HIGH>,
> +					interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,

[Severity: High]
Does removing these interrupts cause a probe failure in the ab8500_charger
driver?

Looking at ab8500_charger_probe() in drivers/power/supply/ab8500_charger.c, it
iterates over a hardcoded array of 14 interrupts:

	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
		if (irq < 0)
			return irq;

Since this patch removes 5 main charger interrupts (including
"MAIN_CH_UNPLUG_DET") from the device tree, platform_get_irq_byname() will
return an error (like -ENXIO) for those missing interrupts.

Will this cause the probe function to immediately abort, completely breaking
charging functionality on the AB8505 platform?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915-ab8500-charger-dt-v1-0-10b7b387e6a6@kernel.org?part=2

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
  2026-09-15 21:46 ` [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts Linus Walleij
@ 2026-09-15 21:54   ` sashiko-bot
  2026-09-16 12:56     ` Linus Walleij
  2026-09-18  9:00   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 9+ messages in thread
From: sashiko-bot @ 2026-09-15 21:54 UTC (permalink / raw)
  To: Linus Walleij; +Cc: conor+dt, robh, devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] power: supply: ab8500: fatal probe failure when using 9-interrupt configuration
--

commit 8052a5eb029696fb98fcaf52a7b6b4012177809a
Author: Linus Walleij <linusw@kernel.org>

dt-bindings: power: supply: ab8500: Allow AB8505 interrupts

AB8505 has no main charger or main-charger interrupts. Permit its
nine USB charger interrupts as an alternative to the full set of
fourteen AB8500 interrupts.

> diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> index 4f19744844e9c..437b58e82e9ae 100644
> --- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
[ ... ]
>    autopower_cfg:
>      type: boolean
> -    description: automatic poweron after powerloss
> +    description: AB8500 automatic poweron after powerloss
>  
>    interrupts:
> +    minItems: 9
>      maxItems: 14
>  
>    interrupt-names:

[Severity: High]
Does this binding relaxation lead to a fatal probe failure when the
9-interrupt configuration is used?

During initialization, ab8500_charger_probe() unconditionally loops over the
statically defined 14-element ab8500_charger_irq array:

drivers/power/supply/ab8500_charger.c:ab8500_charger_probe() {
    ...
	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
		if (irq < 0)
			return irq;
    ...
}

When the driver attempts to request one of the missing main charger
interrupts via platform_get_irq_byname(), it will return a negative error
code and immediately abort the probe.

This would break battery charging and power management entirely on hardware
using the 9-interrupt DT configuration.

A later patch in this series, ARM: dts: ux500: Drop AB8505 main charger
interrupts, applies this 9-interrupt configuration to the DTS without
updating the driver, which will cause the driver to fail to load on boot.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915-ab8500-charger-dt-v1-0-10b7b387e6a6@kernel.org?part=1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
  2026-09-15 21:54   ` sashiko-bot
@ 2026-09-16 12:56     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2026-09-16 12:56 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: conor+dt, robh, devicetree

On Tue, Sep 15, 2026 at 11:54 PM <sashiko-bot@kernel.org> wrote:

> >    interrupts:
> > +    minItems: 9
> >      maxItems: 14
> >
> >    interrupt-names:
>
> [Severity: High]
> Does this binding relaxation lead to a fatal probe failure when the
> 9-interrupt configuration is used?

This is typical Sashiko dumness.

The DT bindings obviously *must change* because the hardware
simply does not have these interrupts.

What certain operating system driver do or not do is *irrelevant*.

I feel we need to make a change to review-prompts to tout
Sashiko about the fact that Linux and DT bindings are
separate projects with separate objectives...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts
  2026-09-15 21:53   ` sashiko-bot
@ 2026-09-16 12:58     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2026-09-16 12:58 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: devicetree, robh, conor+dt

Hello Sashiko,

On Tue, Sep 15, 2026 at 11:53 PM <sashiko-bot@kernel.org> wrote:

> Does removing these interrupts cause a probe failure in the ab8500_charger
> driver?

It doesn't matter. The hardware description is incorrect, we cannot
change the physical reality to match what a certain operating
system expects.

There is a bug in the binding, this fixes it.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
  2026-09-15 21:46 ` [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts Linus Walleij
  2026-09-15 21:54   ` sashiko-bot
@ 2026-09-18  9:00   ` Krzysztof Kozlowski
  2026-09-18 16:30     ` Linus Walleij
  1 sibling, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-18  9:00 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree

On Tue, Sep 15, 2026 at 11:46:54PM +0200, Linus Walleij wrote:
> AB8505 has no main charger or main-charger interrupts. Permit its
> nine USB charger interrupts as an alternative to the full set of
> fourteen AB8500 interrupts.
> 
> Also clarify that autopower_cfg describes the AB8500 facility, since
> the corresponding AB8505 register bit is reserved.
> 
> Fixes: eb917497734c ("dt-bindings: power: supply: ab8500: Convert to DT schema format")
> Assisted-by: LLM
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
>  .../power/supply/stericsson,ab8500-charger.yaml    | 44 ++++++++++++++--------
>  1 file changed, 28 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> index 4f19744844e9..437b58e82e9a 100644
> --- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> @@ -28,27 +28,39 @@ properties:
>  
>    autopower_cfg:
>      type: boolean
> -    description: automatic poweron after powerloss
> +    description: AB8500 automatic poweron after powerloss
>  
>    interrupts:
> +    minItems: 9
>      maxItems: 14

You should have a different compatible for ab8505, with ab8500 as
fallback, but maybe we just don't care about such old hardware?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts
  2026-09-18  9:00   ` Krzysztof Kozlowski
@ 2026-09-18 16:30     ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2026-09-18 16:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree

On Fri, Sep 18, 2026 at 11:00 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:

> You should have a different compatible for ab8505, with ab8500 as
> fallback, but maybe we just don't care about such old hardware?

Hm!

The parent MFD device has the two different compatibles:
Documentation/devicetree/bindings/mfd/stericsson,ab8500.yaml

I guess I should add it here too.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-18 16:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 21:46 [PATCH 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
2026-09-15 21:46 ` [PATCH 1/2] dt-bindings: power: supply: ab8500: Allow AB8505 interrupts Linus Walleij
2026-09-15 21:54   ` sashiko-bot
2026-09-16 12:56     ` Linus Walleij
2026-09-18  9:00   ` Krzysztof Kozlowski
2026-09-18 16:30     ` Linus Walleij
2026-09-15 21:46 ` [PATCH 2/2] ARM: dts: ux500: Drop AB8505 main charger interrupts Linus Walleij
2026-09-15 21:53   ` sashiko-bot
2026-09-16 12:58     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox