* [PATCH 1/7] ARM: dts: tps65217: Specify the interrupt controller
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 14:01 ` [PATCH 2/7] ARM: dts: tps65217: Add the charger device Milo Kim
` (5 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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 2/7] ARM: dts: tps65217: Add the charger device
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
2016-10-21 14:01 ` [PATCH 1/7] ARM: dts: tps65217: Specify the interrupt controller Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 14:01 ` [PATCH 3/7] ARM: dts: tps65217: Add the power button device Milo Kim
` (4 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
Milo Kim
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 3/7] ARM: dts: tps65217: Add the power button device
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
2016-10-21 14:01 ` [PATCH 1/7] ARM: dts: tps65217: Specify the interrupt controller Milo Kim
2016-10-21 14:01 ` [PATCH 2/7] ARM: dts: tps65217: Add the charger device Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 14:01 ` [PATCH 4/7] ARM: dts: am335x: Support the PMIC interrupt Milo Kim
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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 4/7] ARM: dts: am335x: Support the PMIC interrupt
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
` (2 preceding siblings ...)
2016-10-21 14:01 ` [PATCH 3/7] ARM: dts: tps65217: Add the power button device Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 14:01 ` [PATCH 5/7] ARM: dts: am335x: Add the charger interrupt Milo Kim
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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 5/7] ARM: dts: am335x: Add the charger interrupt
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
` (3 preceding siblings ...)
2016-10-21 14:01 ` [PATCH 4/7] ARM: dts: am335x: Support the PMIC interrupt Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 20:47 ` Robert Nelson
2016-10-21 14:01 ` [PATCH 6/7] ARM: dts: am335x: Add the power button interrupt Milo Kim
2016-10-21 14:01 ` [PATCH 7/7] mfd: tps65217: Fix mismatched interrupt number Milo Kim
6 siblings, 1 reply; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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
* Re: [PATCH 5/7] ARM: dts: am335x: Add the charger interrupt
2016-10-21 14:01 ` [PATCH 5/7] ARM: dts: am335x: Add the charger interrupt Milo Kim
@ 2016-10-21 20:47 ` Robert Nelson
2016-10-21 21:01 ` Robert Nelson
[not found] ` <CAOCHtYgBTq0a1FAMQJb5VoLPWBHYkF3rH_Km6U9u6ep=8ApZuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 2 replies; 13+ messages in thread
From: Robert Nelson @ 2016-10-21 20:47 UTC (permalink / raw)
To: Milo Kim
Cc: Benoît Cousson, Tony Lindgren, linux-omap@vger.kernel.org,
devicetree, linux-arm-kernel@lists.infradead.org, linux kernel,
Lee Jones
On Fri, Oct 21, 2016 at 9:01 AM, Milo Kim <woogyom.kim@gmail.com> wrote:
> 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>
^ this hasn't been posted nor pushed to mainline yet.. ;)
> +
> / {
> 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
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Robert Nelson
https://rcn-ee.com/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 5/7] ARM: dts: am335x: Add the charger interrupt
2016-10-21 20:47 ` Robert Nelson
@ 2016-10-21 21:01 ` Robert Nelson
[not found] ` <CAOCHtYgBTq0a1FAMQJb5VoLPWBHYkF3rH_Km6U9u6ep=8ApZuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 0 replies; 13+ messages in thread
From: Robert Nelson @ 2016-10-21 21:01 UTC (permalink / raw)
To: Milo Kim
Cc: Benoît Cousson, Tony Lindgren, linux-omap@vger.kernel.org,
devicetree, linux-arm-kernel@lists.infradead.org, linux kernel,
Lee Jones, Keerthy
On Fri, Oct 21, 2016 at 3:47 PM, Robert Nelson <robertcnelson@gmail.com> wrote:
> On Fri, Oct 21, 2016 at 9:01 AM, Milo Kim <woogyom.kim@gmail.com> wrote:
>> 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>
>
> ^ this hasn't been posted nor pushed to mainline yet.. ;)
So, with this patchset + Keerthy's [RESEND PATCH v8 0/5] mfd:
tps65218: Clean ups:
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1250918.html
and this patch, as systemd is looking for "tps65217_pwr_but"..
https://github.com/systemd/systemd/blob/master/src/login/70-power-switch.rules#L13
Shutdown is working on my BBB/BBG/BBGW/BBBW's...
diff --git a/drivers/input/misc/tps65218-pwrbutton.c
b/drivers/input/misc/tps65218-pwrbutton.c
index cc74a41..f7e5492 100644
--- a/drivers/input/misc/tps65218-pwrbutton.c
+++ b/drivers/input/misc/tps65218-pwrbutton.c
@@ -36,7 +36,7 @@ struct tps6521x_data {
static const struct tps6521x_data tps65217_data = {
.reg_status = TPS65217_REG_STATUS,
.pb_mask = TPS65217_STATUS_PB,
- .name = "tps65217_pwrbutton",
+ .name = "tps65217_pwr_but",
};
static const struct tps6521x_data tps65218_data = {
diff --git a/include/dt-bindings/mfd/tps65217.h
b/include/dt-bindings/mfd/tps65217.h
new file mode 100644
index 0000000..26b2ba8
--- /dev/null
+++ b/include/dt-bindings/mfd/tps65217.h
@@ -0,0 +1,9 @@
+#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
+#define TPS65217_NUM_IRQ 3
+
+#endif /* __DT_BINDINGS_TPS65217_H */
Regards,
--
Robert Nelson
https://rcn-ee.com/
^ permalink raw reply related [flat|nested] 13+ messages in thread
[parent not found: <CAOCHtYgBTq0a1FAMQJb5VoLPWBHYkF3rH_Km6U9u6ep=8ApZuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* [PATCH 6/7] ARM: dts: am335x: Add the power button interrupt
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
` (4 preceding siblings ...)
2016-10-21 14:01 ` [PATCH 5/7] ARM: dts: am335x: Add the charger interrupt Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
2016-10-21 14:01 ` [PATCH 7/7] mfd: tps65217: Fix mismatched interrupt number Milo Kim
6 siblings, 0 replies; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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 7/7] mfd: tps65217: Fix mismatched interrupt number
2016-10-21 14:00 [PATCH 0/7] Support TPS65217 PMIC interrupt in DT Milo Kim
` (5 preceding siblings ...)
2016-10-21 14:01 ` [PATCH 6/7] ARM: dts: am335x: Add the power button interrupt Milo Kim
@ 2016-10-21 14:01 ` Milo Kim
[not found] ` <20161021140106.21531-8-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
6 siblings, 1 reply; 13+ messages in thread
From: Milo Kim @ 2016-10-21 14:01 UTC (permalink / raw)
To: bcousson, Tony Lindgren
Cc: linux-omap, devicetree, linux-arm-kernel, linux-kernel, Lee Jones,
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 synchronizes TPS65217 IRQ index.
[*] 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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 4ccda89..75a3a5f 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -235,9 +235,9 @@ struct tps65217_bl_pdata {
};
enum tps65217_irq_type {
- TPS65217_IRQ_PB,
- TPS65217_IRQ_AC,
TPS65217_IRQ_USB,
+ TPS65217_IRQ_AC,
+ TPS65217_IRQ_PB,
TPS65217_NUM_IRQ
};
--
2.9.3
^ permalink raw reply related [flat|nested] 13+ messages in thread