Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] power: supply: Correct AB8505 charger device tree
@ 2026-09-18 16:56 Linus Walleij
  2026-09-18 16:56 ` [PATCH v2 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
  2026-09-18 16:56 ` [PATCH v2 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Walleij @ 2026-09-18 16:56 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>
---
Changes in v2:
- Add an AB8505-specific compatible with the AB8500 fallback.
- Tie interrupt counts and names to the charger compatible.
- Use the new compatible in the AB8505 DTSI.
- Link to v1: https://lore.kernel.org/r/20260915-ab8500-charger-dt-v1-0-10b7b387e6a6@kernel.org

---
Linus Walleij (2):
      dt-bindings: power: supply: ab8500: Add AB8505 charger
      ARM: dts: ux500: Use AB8505 charger compatible

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

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


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

* [PATCH v2 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger
  2026-09-18 16:56 [PATCH v2 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
@ 2026-09-18 16:56 ` Linus Walleij
  2026-09-20 18:14   ` Krzysztof Kozlowski
  2026-09-18 16:56 ` [PATCH v2 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2026-09-18 16:56 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

AB8500 and AB8505 expose different charger interrupt sets. Add a unique
AB8505 charger compatible with the AB8500 compatible as its fallback.
Use the variant-specific string to require the fourteen main and USB
charger interrupts on AB8500 and the nine USB charger interrupts on
AB8505.

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    | 70 ++++++++++++++++------
 1 file changed, 53 insertions(+), 17 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..73f5df2d7a36 100644
--- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
@@ -12,10 +12,58 @@ maintainers:
 
 allOf:
   - $ref: power-supply.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: stericsson,ab8505-charger
+    then:
+      properties:
+        interrupts:
+          minItems: 9
+          maxItems: 9
+
+        interrupt-names:
+          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
+    else:
+      properties:
+        interrupts:
+          minItems: 14
+          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
 
 properties:
   compatible:
-    const: stericsson,ab8500-charger
+    oneOf:
+      - const: stericsson,ab8500-charger
+      - items:
+          - const: stericsson,ab8505-charger
+          - const: stericsson,ab8500-charger
 
   monitored-battery: true
 
@@ -28,27 +76,15 @@ 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
+    minItems: 9
+    maxItems: 14
 
   io-channels:
     minItems: 2

-- 
2.55.0


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

* [PATCH v2 2/2] ARM: dts: ux500: Use AB8505 charger compatible
  2026-09-18 16:56 [PATCH v2 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
  2026-09-18 16:56 ` [PATCH v2 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
@ 2026-09-18 16:56 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2026-09-18 16:56 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

Identify the AB8505 charger using its variant-specific compatible and
retain the AB8500 compatible as a fallback for the existing driver. This
selects the AB8505 interrupt constraints from the binding.

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 | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
index 131c82508e82..4c9a8418f225 100644
--- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
@@ -137,13 +137,9 @@ 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>,
+					compatible = "stericsson,ab8505-charger",
+						     "stericsson,ab8500-charger";
+					interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
 						     <15 IRQ_TYPE_LEVEL_HIGH>,
 						     <79 IRQ_TYPE_LEVEL_HIGH>,
 						     <105 IRQ_TYPE_LEVEL_HIGH>,
@@ -152,12 +148,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] 4+ messages in thread

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

On Fri, Sep 18, 2026 at 06:56:51PM +0200, Linus Walleij wrote:
> AB8500 and AB8505 expose different charger interrupt sets. Add a unique
> AB8505 charger compatible with the AB8500 compatible as its fallback.
> Use the variant-specific string to require the fourteen main and USB
> charger interrupts on AB8500 and the nine USB charger interrupts on
> AB8505.
> 
> 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    | 70 ++++++++++++++++------
>  1 file changed, 53 insertions(+), 17 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..73f5df2d7a36 100644
> --- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> @@ -12,10 +12,58 @@ maintainers:
>  
>  allOf:
>    - $ref: power-supply.yaml#

Please move the allOf after the "required:" block. The constraints
shouldn't not be before the actual top-level properties for readability.


With this:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-18 16:56 [PATCH v2 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
2026-09-18 16:56 ` [PATCH v2 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
2026-09-20 18:14   ` Krzysztof Kozlowski
2026-09-18 16:56 ` [PATCH v2 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij

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