mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] starqltechn: fix max77705 device irqs
@ 2025-09-09 19:22 Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 1/3] dt-bindings: max77705: add interrupt-controller node Dzmitry Sankouski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dzmitry Sankouski @ 2025-09-09 19:22 UTC (permalink / raw)
  To: Chanwoo Choi, Krzysztof Kozlowski, Lee Jones, Rob Herring,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm, Konrad Dybcio,
	Dzmitry Sankouski

For max77705 charger and fuelgauge subdevice, use max77705 interrupt
controller.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
Changes in v2:
- run dt_binding_check, dtbs_check
- make interrupt-cells 1
- add patch to delete unused address-cells and size-cells
- add binding patch for interrupt-cells
- Link to v1: https://lore.kernel.org/r/20250831-starqltechn-correct_max77705_nodes-v1-0-5f2af9d13dad@gmail.com

---
Dzmitry Sankouski (3):
      dt-bindings: max77705: add interrupt-controller node
      arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells
      arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts

 Documentation/devicetree/bindings/mfd/maxim,max77705.yaml | 14 ++++++++++++++
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts   | 14 +++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)
---
base-commit: be5d4872e528796df9d7425f2bd9b3893eb3a42c
change-id: 20250830-starqltechn-correct_max77705_nodes-1162dc2d9fe7
prerequisite-change-id: 20250830-max77705_77976_charger_improvement-e3f417bfaa56:v2
prerequisite-patch-id: 534eff3c30a7b998f90f7be9537ff54c7f68543b
prerequisite-patch-id: 60362587901a812e50ab0e9a2cf25eeea769ef9c
prerequisite-patch-id: 9692af6383d95fca0c8030b9110d4b06aa0631e2
prerequisite-patch-id: e1b7fc49030ad771c3fae33dc59595cbfecfd17b
prerequisite-patch-id: efdf7936ffca1f97fc550118ae9a2a0795828f88
prerequisite-patch-id: bc2ce3683ecab7a91fe2ca00d35798d0f4ea5f80
prerequisite-patch-id: 2547b245dce99798d36835b1d729b21b6d1906e5
prerequisite-patch-id: 30d3ca50e1b09abd360ddf33982223cce24c6859
prerequisite-patch-id: deac1d76b95764903b7b6c937d7d4b43ed9f74ed
prerequisite-change-id: 20250831-max77705-fix_interrupt_handling-0889cee6936d:v3
prerequisite-patch-id: 4c30e8bca26067f7b96f7571086398cc86c6f71d

Best regards,
-- 
Dzmitry Sankouski <dsankouski@gmail.com>


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

* [PATCH v2 1/3] dt-bindings: max77705: add interrupt-controller node
  2025-09-09 19:22 [PATCH v2 0/3] starqltechn: fix max77705 device irqs Dzmitry Sankouski
@ 2025-09-09 19:22 ` Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts Dzmitry Sankouski
  2 siblings, 0 replies; 6+ messages in thread
From: Dzmitry Sankouski @ 2025-09-09 19:22 UTC (permalink / raw)
  To: Chanwoo Choi, Krzysztof Kozlowski, Lee Jones, Rob Herring,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm, Konrad Dybcio,
	Dzmitry Sankouski

Add interrupt-controller node, because it has dedicated interrupt source
register, to determine which sub device triggered an interrupt.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
 Documentation/devicetree/bindings/mfd/maxim,max77705.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml b/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml
index 0ec89f0adc64..d265c8213a08 100644
--- a/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml
+++ b/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml
@@ -26,6 +26,18 @@ properties:
   interrupts:
     maxItems: 1
 
+  interrupt-controller:
+    description:
+      The driver implements an interrupt controller for the sub devices.
+      The interrupt number mapping is as follows
+      0 - charger
+      1 - topsys
+      2 - fuelgauge
+      3 - usb type-c management block.
+
+  '#interrupt-cells':
+    const: 1
+
   haptic:
     type: object
     additionalProperties: false
@@ -120,8 +132,10 @@ examples:
             reg = <0x66>;
             interrupt-parent = <&pm8998_gpios>;
             interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+            interrupt-controller;
             pinctrl-0 = <&chg_int_default>;
             pinctrl-names = "default";
+            #interrupt-cells = <1>;
 
             leds {
                 compatible = "maxim,max77705-rgb";

-- 
2.39.5


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

* [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells
  2025-09-09 19:22 [PATCH v2 0/3] starqltechn: fix max77705 device irqs Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 1/3] dt-bindings: max77705: add interrupt-controller node Dzmitry Sankouski
@ 2025-09-09 19:22 ` Dzmitry Sankouski
  2025-09-12 10:35   ` Konrad Dybcio
  2025-09-09 19:22 ` [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts Dzmitry Sankouski
  2 siblings, 1 reply; 6+ messages in thread
From: Dzmitry Sankouski @ 2025-09-09 19:22 UTC (permalink / raw)
  To: Chanwoo Choi, Krzysztof Kozlowski, Lee Jones, Rob Herring,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm, Konrad Dybcio,
	Dzmitry Sankouski

Remove address-cells and size-cells because unused.

Fixes: 7a88a931d095 ("arm64: dts: qcom: sdm845-starqltechn: add max77705 PMIC")
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
index 9eeb4b807465..8a1e4c76914c 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
@@ -591,8 +591,6 @@ pmic@66 {
 		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-0 = <&pmic_int_default>;
 		pinctrl-names = "default";
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		leds {
 			compatible = "maxim,max77705-rgb";

-- 
2.39.5


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

* [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts
  2025-09-09 19:22 [PATCH v2 0/3] starqltechn: fix max77705 device irqs Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 1/3] dt-bindings: max77705: add interrupt-controller node Dzmitry Sankouski
  2025-09-09 19:22 ` [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells Dzmitry Sankouski
@ 2025-09-09 19:22 ` Dzmitry Sankouski
  2025-09-12 10:36   ` Konrad Dybcio
  2 siblings, 1 reply; 6+ messages in thread
From: Dzmitry Sankouski @ 2025-09-09 19:22 UTC (permalink / raw)
  To: Chanwoo Choi, Krzysztof Kozlowski, Lee Jones, Rob Herring,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm, Konrad Dybcio,
	Dzmitry Sankouski

Since max77705 has a register, which indicates interrupt source, it acts
as an interrupt controller.

Use max77705 as an interrupt controller for charger and fuelgauge
subdevices.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
Changes for v2:
- fix commit msg header prefix to 'arm64: dts: qcom: sdm845-starqltechn:'
- remove binding header for interrupt numbers
- make interrupt-cells 1, because irq trigger type is not used
---
 arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
index 8a1e4c76914c..597e25d27d76 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
@@ -584,13 +584,15 @@ &uart9 {
 &i2c14 {
 	status = "okay";
 
-	pmic@66 {
+	max77705: pmic@66 {
 		compatible = "maxim,max77705";
 		reg = <0x66>;
 		interrupt-parent = <&pm8998_gpios>;
 		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
 		pinctrl-0 = <&pmic_int_default>;
 		pinctrl-names = "default";
+		#interrupt-cells = <1>;
 
 		leds {
 			compatible = "maxim,max77705-rgb";
@@ -629,8 +631,8 @@ max77705_charger: charger@69 {
 		reg = <0x69>;
 		compatible = "maxim,max77705-charger";
 		monitored-battery = <&battery>;
-		interrupt-parent = <&pm8998_gpios>;
-		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&max77705>;
+		interrupts = <0>;
 	};
 
 	fuel-gauge@36 {
@@ -638,8 +640,8 @@ fuel-gauge@36 {
 		compatible = "maxim,max77705-battery";
 		power-supplies = <&max77705_charger>;
 		maxim,rsns-microohm = <5000>;
-		interrupt-parent = <&pm8998_gpios>;
-		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&max77705>;
+		interrupts = <2>;
 	};
 };
 

-- 
2.39.5


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

* Re: [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells
  2025-09-09 19:22 ` [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells Dzmitry Sankouski
@ 2025-09-12 10:35   ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2025-09-12 10:35 UTC (permalink / raw)
  To: Dzmitry Sankouski, Chanwoo Choi, Krzysztof Kozlowski, Lee Jones,
	Rob Herring, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm

On 9/9/25 9:22 PM, Dzmitry Sankouski wrote:
> Remove address-cells and size-cells because unused.

"""
Drop the unused address/size-cells properties to silence the DT
checker warning:

pmic@66 (maxim,max77705): '#address-cells', '#size-cells' do not
match any of the regexes: '^pinctrl-[0-9]+$'
"""

Konrad

> 
> Fixes: 7a88a931d095 ("arm64: dts: qcom: sdm845-starqltechn: add max77705 PMIC")
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---
>  arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> index 9eeb4b807465..8a1e4c76914c 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> @@ -591,8 +591,6 @@ pmic@66 {
>  		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
>  		pinctrl-0 = <&pmic_int_default>;
>  		pinctrl-names = "default";
> -		#address-cells = <1>;
> -		#size-cells = <0>;
>  
>  		leds {
>  			compatible = "maxim,max77705-rgb";
> 

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

* Re: [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts
  2025-09-09 19:22 ` [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts Dzmitry Sankouski
@ 2025-09-12 10:36   ` Konrad Dybcio
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2025-09-12 10:36 UTC (permalink / raw)
  To: Dzmitry Sankouski, Chanwoo Choi, Krzysztof Kozlowski, Lee Jones,
	Rob Herring, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-kernel, devicetree, linux-arm-msm

On 9/9/25 9:22 PM, Dzmitry Sankouski wrote:
> Since max77705 has a register, which indicates interrupt source, it acts
> as an interrupt controller.
> 
> Use max77705 as an interrupt controller for charger and fuelgauge
> subdevices.

"""
Direct MAX77705's subdevices to use the IC's internal interrupt
controller, instead of listening to every interrupt fired by the
chip towards the host device.
"""

Fixes: 7a88a931d095 ("arm64: dts: qcom: sdm845-starqltechn: add max77705 PMIC")

Konrad> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---
> Changes for v2:
> - fix commit msg header prefix to 'arm64: dts: qcom: sdm845-starqltechn:'
> - remove binding header for interrupt numbers
> - make interrupt-cells 1, because irq trigger type is not used
> ---
>  arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> index 8a1e4c76914c..597e25d27d76 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts
> @@ -584,13 +584,15 @@ &uart9 {
>  &i2c14 {
>  	status = "okay";
>  
> -	pmic@66 {
> +	max77705: pmic@66 {
>  		compatible = "maxim,max77705";
>  		reg = <0x66>;
>  		interrupt-parent = <&pm8998_gpios>;
>  		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-controller;
>  		pinctrl-0 = <&pmic_int_default>;
>  		pinctrl-names = "default";
> +		#interrupt-cells = <1>;
>  
>  		leds {
>  			compatible = "maxim,max77705-rgb";
> @@ -629,8 +631,8 @@ max77705_charger: charger@69 {
>  		reg = <0x69>;
>  		compatible = "maxim,max77705-charger";
>  		monitored-battery = <&battery>;
> -		interrupt-parent = <&pm8998_gpios>;
> -		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-parent = <&max77705>;
> +		interrupts = <0>;
>  	};
>  
>  	fuel-gauge@36 {
> @@ -638,8 +640,8 @@ fuel-gauge@36 {
>  		compatible = "maxim,max77705-battery";
>  		power-supplies = <&max77705_charger>;
>  		maxim,rsns-microohm = <5000>;
> -		interrupt-parent = <&pm8998_gpios>;
> -		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-parent = <&max77705>;
> +		interrupts = <2>;
>  	};
>  };
>  
> 

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

end of thread, other threads:[~2025-09-12 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-09 19:22 [PATCH v2 0/3] starqltechn: fix max77705 device irqs Dzmitry Sankouski
2025-09-09 19:22 ` [PATCH v2 1/3] dt-bindings: max77705: add interrupt-controller node Dzmitry Sankouski
2025-09-09 19:22 ` [PATCH v2 2/3] arm64: dts: qcom: sdm845-starqltechn: remove (address|size)-cells Dzmitry Sankouski
2025-09-12 10:35   ` Konrad Dybcio
2025-09-09 19:22 ` [PATCH v2 3/3] arch: arm64: dts: qcom: sdm845-starqltechn: fix max77705 interrupts Dzmitry Sankouski
2025-09-12 10:36   ` Konrad Dybcio

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

all inboxes | Powered by JetHome®