* [PATCH v2 1/8] ARM: dts: tps65217: Specify the interrupt controller
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
@ 2016-10-28 12:36 ` Milo Kim
2016-10-28 12:36 ` [PATCH v2 2/8] ARM: dts: tps65217: Add the charger device Milo Kim
` (7 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:36 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
TPS65217 MFD driver supports the IRQ domain to handle the charger input
interrupts and push button status event. The interrupt controller enables
corresponding IRQ handling in the charger[*] and power button driver[**].
[*] drivers/power/supply/tps65217_charger.c
[**] drivers/input/misc/tps65218-pwrbutton.c
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/tps65217.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/tps65217.dtsi b/arch/arm/boot/dts/tps65217.dtsi
index a632724..27935f8 100644
--- a/arch/arm/boot/dts/tps65217.dtsi
+++ b/arch/arm/boot/dts/tps65217.dtsi
@@ -13,6 +13,8 @@
&tps {
compatible = "ti,tps65217";
+ interrupt-controller;
+ #interrupt-cells = <1>;
regulators {
#address-cells = <1>;
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/8] ARM: dts: tps65217: Add the charger device
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
2016-10-28 12:36 ` [PATCH v2 1/8] ARM: dts: tps65217: Specify the interrupt controller Milo Kim
@ 2016-10-28 12:36 ` Milo Kim
2016-10-28 12:36 ` [PATCH v2 3/8] ARM: dts: tps65217: Add the power button device Milo Kim
` (6 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:36 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: devicetree, Lee Jones, linux-kernel, Milo Kim, linux-omap,
Robert Nelson, linux-arm-kernel
Support the charger driver and disable it by default.
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/tps65217.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/tps65217.dtsi b/arch/arm/boot/dts/tps65217.dtsi
index 27935f8..8f77d0d 100644
--- a/arch/arm/boot/dts/tps65217.dtsi
+++ b/arch/arm/boot/dts/tps65217.dtsi
@@ -16,6 +16,11 @@
interrupt-controller;
#interrupt-cells = <1>;
+ charger {
+ compatible = "ti,tps65217-charger";
+ status = "disabled";
+ };
+
regulators {
#address-cells = <1>;
#size-cells = <0>;
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/8] ARM: dts: tps65217: Add the power button device
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
2016-10-28 12:36 ` [PATCH v2 1/8] ARM: dts: tps65217: Specify the interrupt controller Milo Kim
2016-10-28 12:36 ` [PATCH v2 2/8] ARM: dts: tps65217: Add the charger device Milo Kim
@ 2016-10-28 12:36 ` Milo Kim
2016-10-28 12:36 ` [PATCH v2 4/8] ARM: dts: am335x: Support the PMIC interrupt Milo Kim
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:36 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
Support the power button driver and disable it by default.
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/tps65217.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/tps65217.dtsi b/arch/arm/boot/dts/tps65217.dtsi
index 8f77d0d..02de56b 100644
--- a/arch/arm/boot/dts/tps65217.dtsi
+++ b/arch/arm/boot/dts/tps65217.dtsi
@@ -21,6 +21,11 @@
status = "disabled";
};
+ pwrbutton {
+ compatible = "ti,tps65217-pwrbutton";
+ status = "disabled";
+ };
+
regulators {
#address-cells = <1>;
#size-cells = <0>;
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/8] ARM: dts: am335x: Support the PMIC interrupt
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
` (2 preceding siblings ...)
2016-10-28 12:36 ` [PATCH v2 3/8] ARM: dts: tps65217: Add the power button device Milo Kim
@ 2016-10-28 12:36 ` Milo Kim
2016-10-28 12:36 ` [PATCH v2 5/8] dt-bindings: mfd: Provide human readable defines for TPS65217 interrupts Milo Kim
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:36 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
AM335x bone based boards have the PMIC interrupt named NMI which is
connected to TPS65217 device. AM335x main interrupt controller provides it
and the number is 7.
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 007b5e5..25303d9 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -310,6 +310,10 @@
* by the hardware problems. (Tip: double-check by performing a current
* measurement after shutdown: it should be less than 1 mA.)
*/
+
+ interrupts = <7>; /* NMI */
+ interrupt-parent = <&intc>;
+
ti,pmic-shutdown-controller;
regulators {
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 5/8] dt-bindings: mfd: Provide human readable defines for TPS65217 interrupts
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
` (3 preceding siblings ...)
2016-10-28 12:36 ` [PATCH v2 4/8] ARM: dts: am335x: Support the PMIC interrupt Milo Kim
@ 2016-10-28 12:36 ` Milo Kim
[not found] ` <20161028123702.21849-6-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-28 12:37 ` [PATCH v2 6/8] ARM: dts: am335x: Add the charger interrupt Milo Kim
` (3 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:36 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
TPS65217 supports three interrupt sources. This patch enables assigning
each IRQ number in the charger and power button node. Then corresponding
IRQ will be requested by each driver.
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
include/dt-bindings/mfd/tps65217.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 include/dt-bindings/mfd/tps65217.h
diff --git a/include/dt-bindings/mfd/tps65217.h b/include/dt-bindings/mfd/tps65217.h
new file mode 100644
index 0000000..cafb9e6
--- /dev/null
+++ b/include/dt-bindings/mfd/tps65217.h
@@ -0,0 +1,26 @@
+/*
+ * 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
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 6/8] ARM: dts: am335x: Add the charger interrupt
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
` (4 preceding siblings ...)
2016-10-28 12:36 ` [PATCH v2 5/8] dt-bindings: mfd: Provide human readable defines for TPS65217 interrupts Milo Kim
@ 2016-10-28 12:37 ` Milo Kim
2016-10-28 12:37 ` [PATCH v2 7/8] ARM: dts: am335x: Add the power button interrupt Milo Kim
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:37 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
This enables the charger driver gets corresponding IRQ number by using
platform_get_irq_byname() helper.
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/am335x-bone-common.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 25303d9..cec9d91 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -6,6 +6,8 @@
* published by the Free Software Foundation.
*/
+#include <dt-bindings/mfd/tps65217.h>
+
/ {
cpus {
cpu@0 {
@@ -316,6 +318,12 @@
ti,pmic-shutdown-controller;
+ charger {
+ interrupts = <TPS65217_IRQ_AC>, <TPS65217_IRQ_USB>;
+ interrupts-names = "AC", "USB";
+ status = "okay";
+ };
+
regulators {
dcdc1_reg: regulator@0 {
regulator-name = "vdds_dpr";
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 7/8] ARM: dts: am335x: Add the power button interrupt
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
` (5 preceding siblings ...)
2016-10-28 12:37 ` [PATCH v2 6/8] ARM: dts: am335x: Add the charger interrupt Milo Kim
@ 2016-10-28 12:37 ` Milo Kim
2016-10-28 12:37 ` [PATCH v2 8/8] mfd: tps65217: Fix mismatched interrupt number Milo Kim
[not found] ` <20161028123702.21849-1-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:37 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
This enables the power button driver gets corresponding IRQ number by
using platform_get_irq().
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
arch/arm/boot/dts/am335x-bone-common.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index cec9d91..0c0a90c 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -324,6 +324,11 @@
status = "okay";
};
+ pwrbutton {
+ interrupts = <TPS65217_IRQ_PB>;
+ status = "okay";
+ };
+
regulators {
dcdc1_reg: regulator@0 {
regulator-name = "vdds_dpr";
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 8/8] mfd: tps65217: Fix mismatched interrupt number
2016-10-28 12:36 [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT Milo Kim
` (6 preceding siblings ...)
2016-10-28 12:37 ` [PATCH v2 7/8] ARM: dts: am335x: Add the power button interrupt Milo Kim
@ 2016-10-28 12:37 ` Milo Kim
[not found] ` <20161028123702.21849-1-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
8 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-28 12:37 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Robert Nelson, Milo Kim
Enum value of 'tps65217_irq_type' is not matched with DT parsed hwirq
number[*].
The MFD driver gets the IRQ data by referencing hwirq, but the value is
different. So, irq_to_tps65217_irq() returns mismatched IRQ data.
Eventually, the power button driver enables not PB but USB interrupt
when it is probed.
According to the TPS65217 register map[**], USB interrupt is the LSB.
This patch defines synchronized IRQ value.
[*] include/dt-bindings/mfd/tps65217.h
[**] http://www.ti.com/lit/ds/symlink/tps65217.pdf
Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
---
include/linux/mfd/tps65217.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 4ccda89..3cbec4b 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -234,12 +234,11 @@ struct tps65217_bl_pdata {
int dft_brightness;
};
-enum tps65217_irq_type {
- TPS65217_IRQ_PB,
- TPS65217_IRQ_AC,
- TPS65217_IRQ_USB,
- TPS65217_NUM_IRQ
-};
+/* Interrupt numbers */
+#define TPS65217_IRQ_USB 0
+#define TPS65217_IRQ_AC 1
+#define TPS65217_IRQ_PB 2
+#define TPS65217_NUM_IRQ 3
/**
* struct tps65217_board - packages regulator init data
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
[parent not found: <20161028123702.21849-1-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v2 0/8] Support TPS65217 PMIC interrupt in DT
[not found] ` <20161028123702.21849-1-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-11-09 21:38 ` Tony Lindgren
0 siblings, 0 replies; 13+ messages in thread
From: Tony Lindgren @ 2016-11-09 21:38 UTC (permalink / raw)
To: Milo Kim
Cc: bcousson-rdvid1DuHRBWk0Htik3J/w,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee Jones, Robert Nelson
* Milo Kim <woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [161028 05:38]:
> TPS65217 interrupt events include push button pressed/released, USB and AC
> voltage status change. AM335x bone based boards (like BB, BBB, BBG) have
> common PMIC interrupt pin (named NMI) of AM335x core.
>
> This patchset support interrupts in device tree file.
Applying into omap-for-v4.10/dt except the last patch I'll apply into
omap-for-v4.10/fixes-not-urgent.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 13+ messages in thread