Skip to contentSkip to conversation

dt-bindings: mfd: Update TPS65217 interrupts

PATCH In review Milo Kim 5 participants 13 messages Dec 9, 2016 – Jan 12, 2017

Subsystems (4)
lore
Share & tools
lore

Milo Kim

author
#0 lore raw

cover dt-bindings: mfd: Update TPS65217 interrupts

This patch-set fixes wrong property name and uses TPS65217 HW interrupt number from the datasheet instead of the DT ABI. DT bindings are also updated.

Milo Kim (4):
ARM: dts: am335x: Fix the interrupt name of TPS65217
dt-bindings: mfd: Remove TPS65217 interrupts
dt-bindings: power/supply: Update TPS65217 properties
dt-bindings: input: Add interrupt number for TPS65217

 .../bindings/input/tps65218-pwrbutton.txt          |  4 +++-
 .../bindings/power/supply/tps65217_charger.txt     |  7 +++++-
 arch/arm/boot/dts/am335x-bone-common.dtsi          |  8 +++----
 include/dt-bindings/mfd/tps65217.h                 | 26 ----------------------
 4 files changed, 12 insertions(+), 33 deletions(-)
 delete mode 100644 include/dt-bindings/mfd/tps65217.h
Signature · 1 line
2.9.3
author
#1 lore raw

PATCH 1/4 ARM: dts: am335x: Fix the interrupt name of TPS65217

Use 'interrupt-names' for getting the charger interrupt number.

Fixes 1934e89a769b ("ARM: dts: am335x: Add the charger interrupt")
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/am335x-bone-common.dtsi +1 -1
index dc561d5..14b6269 100644
@@ -320,7 +320,7 @@
 
 	charger {
 		interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
-		interrupts-names = "AC", "USB";
+		interrupt-names = "AC", "USB";
 		status = "okay";
 	};
 
Signature · 1 line
2.9.3
author
#2 lore raw

PATCH 2/4 dt-bindings: mfd: Remove TPS65217 interrupts

In reply to Milo Kim

Interrupt numbers are from the datasheet, so no need to keep them in the ABI. Use the number in the DT file.

---
 arch/arm/boot/dts/am335x-bone-common.dtsi |  8 +++-----
 include/dt-bindings/mfd/tps65217.h        | 26 --------------------------
 2 files changed, 3 insertions(+), 31 deletions(-)
 delete mode 100644 include/dt-bindings/mfd/tps65217.h
arch/arm/boot/dts/am335x-bone-common.dtsi +3 -5
index 14b6269..3e32dd1 100644
@@ -6,8 +6,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <dt-bindings/mfd/tps65217.h>
-
 / {
 	cpus {
 		cpu at 0 {
@@ -319,13 +317,13 @@
 	ti,pmic-shutdown-controller;
 
 	charger {
-		interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
-		interrupt-names = "AC", "USB";
+		interrupts = <0>, <1>;
+		interrupt-names = "USB", "AC";
 		status = "okay";
 	};
 
 	pwrbutton {
-		interrupts = <TPS65217_IRQ_PB>;
+		interrupts = <2>;
 		status = "okay";
 	};
 
include/dt-bindings/mfd/tps65217.h deleted +0 -26
deleted file mode 100644
index cafb9e6..0000000
@@ -1,26 +0,0 @@
-/*
- * This header provides macros for TI TPS65217 DT bindings.
- *
- * Copyright (C) 2016 Texas Instruments
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __DT_BINDINGS_TPS65217_H__
-#define __DT_BINDINGS_TPS65217_H__
-
-#define TPS65217_IRQ_USB	0
-#define TPS65217_IRQ_AC		1
-#define TPS65217_IRQ_PB		2
-
-#endif
Signature · 1 line
2.9.3
author
#7 lore raw

PATCH 3/4 dt-bindings: power/supply: Update TPS65217 properties

In reply to Milo Kim

Add interrupt specifiers for USB and AC charger input. Interrupt numbers are from the datasheet.
Fix wrong property for compatible string.

---
 .../devicetree/bindings/power/supply/tps65217_charger.txt          | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/power/supply/tps65217_charger.txt +6 -1
index 98d131a..a11072c 100644
@@ -2,11 +2,16 @@ TPS65217 Charger
 
 Required Properties:
 -compatible: "ti,tps65217-charger"
+-interrupts: TPS65217 interrupt numbers for the AC and USB charger input change.
+             Should be <0> for the USB charger and <1> for the AC adapter.
+-interrupt-names: Should be "USB" and "AC"
 
 This node is a subnode of the tps65217 PMIC.
 
 Example:
 
 	tps65217-charger {
-		compatible = "ti,tps65090-charger";
+		compatible = "ti,tps65217-charger";
+		interrupts = <0>, <1>;
+		interrupt-names = "USB", "AC";
 	};
Signature · 1 line
2.9.3
author
#10 lore raw

PATCH 4/4 dt-bindings: input: Specify the interrupt number of TPS65217 power button

In reply to Milo Kim

Specify the power button interrupt number which is from the datasheet.

---
 Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt +3 -1
index 3e5b979..8682ab6 100644
@@ -8,8 +8,9 @@ This driver provides a simple power button event via an Interrupt.
 Required properties:
 - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton"
 
-Required properties for TPS65218:
+Required properties:
 - interrupts: should be one of the following
+   - <2>: For controllers compatible with tps65217
    - <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218
 
 Examples:
@@ -17,6 +18,7 @@ Examples:
 &tps {
 	tps65217-pwrbutton {
 		compatible = "ti,tps65217-pwrbutton";
+		interrupts = <2>;
 	};
 };
 
Signature · 1 line
2.9.3
maintainer
#3 lore raw

Re: [PATCH 2/4] dt-bindings: mfd: Remove TPS65217 interrupts

In reply to Milo Kim
Quoted 2 lines · Milo Kim

Interrupt numbers are from the datasheet, so no need to keep them in the ABI. Use the number in the DT file.

I don't see the purpose of ripping this out. The headers have always been for convienence, not whether the values come from the datasheet or not.

Quoted 6 lines
---
 arch/arm/boot/dts/am335x-bone-common.dtsi |  8 +++-----
 include/dt-bindings/mfd/tps65217.h        | 26 --------------------------
 2 files changed, 3 insertions(+), 31 deletions(-)
 delete mode 100644 include/dt-bindings/mfd/tps65217.h
maintainer Acked-by on v1 3/4
#8 lore raw

Re: [PATCH 3/4] dt-bindings: power/supply: Update TPS65217 properties

In reply to Milo Kim
Quoted 8 lines · Milo Kim

Add interrupt specifiers for USB and AC charger input. Interrupt numbers are from the datasheet.
Fix wrong property for compatible string.

---
 .../devicetree/bindings/power/supply/tps65217_charger.txt          | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
author
#4 lore raw

Re: [PATCH 2/4] dt-bindings: mfd: Remove TPS65217 interrupts

In reply to Rob Herring
Quoted 6 lines · Rob Herring
Quoted 2 lines · Milo Kim

Interrupt numbers are from the datasheet, so no need to keep them in the ABI. Use the number in the DT file.

I don't see the purpose of ripping this out. The headers have always been for convienence, not whether the values come from the datasheet or not.

My understanding is it's a same rule as other interrupt controllers. I'd like to have Arnd's opinion for this.

Best regards,
Milo

maintainer Acked-by
#5 lore raw

Re: [PATCH 2/4] dt-bindings: mfd: Remove TPS65217 interrupts

Quoted 7 lines · Milo Kim
Quoted 6 lines · Rob Herring
Quoted 3 lines · Milo Kim

Interrupt numbers are from the datasheet, so no need to keep them in the ABI. Use the number in the DT file.

Quoted 6 lines
Quoted 3 lines

I don't see the purpose of ripping this out. The headers have always been for convienence, not whether the values come from the datasheet or not.

My understanding is it's a same rule as other interrupt controllers.

Oh yes, that's true. We never use defines for interrupts. In that case:

Rob

#12 lore raw
In reply to Milo Kim
Quoted 3 lines · Milo Kim

This patch-set fixes wrong property name and uses TPS65217 HW interrupt number from the datasheet instead of the DT ABI. DT bindings are also updated.

Applying into omap-for-v4.10/fixes before this usage pops up on other am335x boards.

Regards,

Tony

Acked-by on v1 2/4
#6 lore raw

Re: [PATCH 2/4] dt-bindings: mfd: Remove TPS65217 interrupts

In reply to Milo Kim
Quoted 9 lines · Milo Kim

Interrupt numbers are from the datasheet, so no need to keep them in the ABI. Use the number in the DT file.

---
 arch/arm/boot/dts/am335x-bone-common.dtsi |  8 +++-----
 include/dt-bindings/mfd/tps65217.h        | 26 --------------------------
 2 files changed, 3 insertions(+), 31 deletions(-)
 delete mode 100644 include/dt-bindings/mfd/tps65217.h

I'm happy for this to go in via your respective ARM tree.

Quoted 62 lines
arch/arm/boot/dts/am335x-bone-common.dtsi +3 -5
index 14b6269..3e32dd1 100644
@@ -6,8 +6,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <dt-bindings/mfd/tps65217.h>
-
 / {
 	cpus {
 		cpu@0 {
@@ -319,13 +317,13 @@
 	ti,pmic-shutdown-controller;
 
 	charger {
-		interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
-		interrupt-names = "AC", "USB";
+		interrupts = <0>, <1>;
+		interrupt-names = "USB", "AC";
 		status = "okay";
 	};
 
 	pwrbutton {
-		interrupts = <TPS65217_IRQ_PB>;
+		interrupts = <2>;
 		status = "okay";
 	};
 
include/dt-bindings/mfd/tps65217.h deleted +0 -26
deleted file mode 100644
index cafb9e6..0000000
@@ -1,26 +0,0 @@
-/*
- * This header provides macros for TI TPS65217 DT bindings.
- *
- * Copyright (C) 2016 Texas Instruments
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __DT_BINDINGS_TPS65217_H__
-#define __DT_BINDINGS_TPS65217_H__
-
-#define TPS65217_IRQ_USB	0
-#define TPS65217_IRQ_AC		1
-#define TPS65217_IRQ_PB		2
-
-#endif
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw

Re: [PATCH 3/4] dt-bindings: power/supply: Update TPS65217 properties

In reply to Milo Kim

Hi Milo,

Quoted 21 lines · Milo Kim

Add interrupt specifiers for USB and AC charger input. Interrupt numbers are from the datasheet.
Fix wrong property for compatible string.

---
 .../devicetree/bindings/power/supply/tps65217_charger.txt          | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/power/supply/tps65217_charger.txt +3 -0
index 98d131a..a11072c 100644
@@ -2,11 +2,16 @@ TPS65217 Charger
 
 Required Properties:
 -compatible: "ti,tps65217-charger"
+-interrupts: TPS65217 interrupt numbers for the AC and USB charger input change.
+             Should be <0> for the USB charger and <1> for the AC adapter.
+-interrupt-names: Should be "USB" and "AC"
 

Documentation/devicetree/bindings/power/supply/tps65217_charger.txt TPS65217 Charger · line 17

Quoted 10 lines
Documentation/devicetree/bindings/power/supply/tps65217_charger.txt +3 -1
 This node is a subnode of the tps65217 PMIC.
 
 Example:
 
 	tps65217-charger {
-		compatible = "ti,tps65090-charger";
+		compatible = "ti,tps65217-charger";
+		interrupts = <0>, <1>;
+		interrupt-names = "USB", "AC";
 	};

Thanks, I queued this into power-supply's for-next branch.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170112/bcf82b7e/attachment.sig>