linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4
@ 2017-03-06  2:52 Brian Kim
  2017-03-06  7:24 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Kim @ 2017-03-06  2:52 UTC (permalink / raw)
  To: linux.amoon, l.majewski, krzk, robh+dt, kgene, mark.rutland, javier
  Cc: devicetree, linux-samsung-soc, linux-kernel, linux-arm-kernel

The power button on Odroid XU3/4 is connected with the PWRON pin of
s2mps11 PMIC. The s2mps11 sends low signal to GPIO input in exynos 5422
via ONOB pin.

This patch adds devicetree bindings for the power button of Odroid
XU3/4.

Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
---
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
index 05b9afdd..671d87f 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
@@ -13,6 +13,7 @@
 */
 
 #include <dt-bindings/clock/samsung,s2mps11.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/sound/samsung-i2s.h>
@@ -42,6 +43,22 @@
 		};
 	};
 
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_power_key>;
+
+		power_key {
+			interrupt-parent = <&gpx0>;
+			interrupts = <3 0>;
+			gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_POWER>;
+			label = "power key";
+			debounce-interval = <10>;
+			wakeup-source;
+		};
+	};
+
 	emmc_pwrseq: pwrseq {
 		pinctrl-0 = <&emmc_nrst_pin>;
 		pinctrl-names = "default";
@@ -557,6 +574,11 @@
 };
 
 &pinctrl_0 {
+	gpio_power_key: power_key {
+		samsung,pins = "gpx0-3";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+	};
+
 	hdmi_hpd_irq: hdmi-hpd-irq {
 		samsung,pins = "gpx3-7";
 		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
-- 
2.7.4

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

* Re: [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4
  2017-03-06  2:52 [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4 Brian Kim
@ 2017-03-06  7:24 ` Krzysztof Kozlowski
  2017-03-06  9:49   ` Brian Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-06  7:24 UTC (permalink / raw)
  To: Brian Kim
  Cc: mark.rutland, devicetree, Łukasz Majewski,
	linux-samsung-soc, linux.amoon, linux-kernel,
	Javier Martinez Canillas, robh+dt, kgene, linux-arm-kernel

On Mon, Mar 6, 2017 at 4:52 AM, Brian Kim <brian.kim@hardkernel.com> wrote:
> The power button on Odroid XU3/4 is connected with the PWRON pin of
> s2mps11 PMIC. The s2mps11 sends low signal to GPIO input in exynos 5422
> via ONOB pin.
>
> This patch adds devicetree bindings for the power button of Odroid
> XU3/4.
>
> Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
> ---
>  arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>

Hi,

Thanks for the patch.

You sent almost the same patch as Anand did some time ago (with few
missing things) :
https://patchwork.kernel.org/patch/8388491/

All previous comments apply, including that you added a key for gpx0-3
which is not a PWRON and it does not match description at all.

Best regards,
Krzysztof

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

* Re: [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4
  2017-03-06  7:24 ` Krzysztof Kozlowski
@ 2017-03-06  9:49   ` Brian Kim
  2017-03-07 21:19     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Kim @ 2017-03-06  9:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: mark.rutland, devicetree, Łukasz Majewski,
	linux-samsung-soc, linux.amoon, linux-kernel,
	Javier Martinez Canillas, robh+dt, kgene, linux-arm-kernel

On 2017년 03월 06일 16:24, Krzysztof Kozlowski wrote:
> On Mon, Mar 6, 2017 at 4:52 AM, Brian Kim <brian.kim@hardkernel.com> wrote:
>> The power button on Odroid XU3/4 is connected with the PWRON pin of
>> s2mps11 PMIC. The s2mps11 sends low signal to GPIO input in exynos 5422
>> via ONOB pin.
>>
>> This patch adds devicetree bindings for the power button of Odroid
>> XU3/4.
>>
>> Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
>> ---
>>  arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 22 ++++++++++++++++++++++
>>  1 file changed, 22 insertions(+)
>>
> Hi,
>
> Thanks for the patch.
>
> You sent almost the same patch as Anand did some time ago (with few
> missing things) :
> https://patchwork.kernel.org/patch/8388491/
I'm sorry, Krzysztof. I haven't seen it before.

When I checked git log history in the kernel source, this patch was missed.
So, I submitted it.

>
> All previous comments apply, including that you added a key for gpx0-3
> which is not a PWRON and it does not match description at all.
Yes, gpx0-3 is not PWRON.
PWRON is the 5V power input signal generated by the SW2 push button on Odroid-Xu3/4 boards

(active high). PWRON notifies "power up event to start" to s2mps13 PMIC.

gpx0-3 in Exynos 5422 is connected to the ONOB pin of PMIC.
According to s2mps13 datasheet, ONOB operates as 'PWRON key active low signal'.
s2mps13 PMIC generates the opposite signal from the PWRON via ONOB (active low).
So, we can get the state of power button by gpx0-3.

>
> Best regards,
> Krzysztof
>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4
  2017-03-06  9:49   ` Brian Kim
@ 2017-03-07 21:19     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-07 21:19 UTC (permalink / raw)
  To: Brian Kim
  Cc: linux.amoon, Łukasz Majewski, robh+dt, kgene, mark.rutland,
	Javier Martinez Canillas, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, devicetree

On Mon, Mar 06, 2017 at 06:49:43PM +0900, Brian Kim wrote:
> On 2017년 03월 06일 16:24, Krzysztof Kozlowski wrote:
> > On Mon, Mar 6, 2017 at 4:52 AM, Brian Kim <brian.kim@hardkernel.com> wrote:
> >> The power button on Odroid XU3/4 is connected with the PWRON pin of
> >> s2mps11 PMIC. The s2mps11 sends low signal to GPIO input in exynos 5422
> >> via ONOB pin.
> >>
> >> This patch adds devicetree bindings for the power button of Odroid
> >> XU3/4.
> >>
> >> Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
> >> ---
> >>  arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 22 ++++++++++++++++++++++
> >>  1 file changed, 22 insertions(+)
> >>
> > Hi,
> >
> > Thanks for the patch.
> >
> > You sent almost the same patch as Anand did some time ago (with few
> > missing things) :
> > https://patchwork.kernel.org/patch/8388491/
> I'm sorry, Krzysztof. I haven't seen it before.
> 
> When I checked git log history in the kernel source, this patch was missed.
> So, I submitted it.
> 
> >
> > All previous comments apply, including that you added a key for gpx0-3
> > which is not a PWRON and it does not match description at all.
> Yes, gpx0-3 is not PWRON.
> PWRON is the 5V power input signal generated by the SW2 push button on Odroid-Xu3/4 boards
> 
> (active high). PWRON notifies "power up event to start" to s2mps13 PMIC.
> 
> gpx0-3 in Exynos 5422 is connected to the ONOB pin of PMIC.
> According to s2mps13 datasheet, ONOB operates as 'PWRON key active low signal'.
> s2mps13 PMIC generates the opposite signal from the PWRON via ONOB (active low).
> So, we can get the state of power button by gpx0-3.

Yes, this matches my previous findings. All of this above should be put
in commit message and as a short comment in DTS (like the gpx0-3 is
actually interrupt for ONOB for inverted PWRON). This is unusual
usage and what is more it is not describing the real hardware. In
reality, the key toggles PWRON and you are adding a node for gpx0-3
whose input is ONOB. Not PWRON.

All of comments from previous mail apply, so:
1. Why do you need both interrupts and gpios?
2. proper macros (irq type, gpio active etc).
3. Unneeded gpio prefix for pinctrl label, usage of - for node names.
4. Missing pinctrl function

I think label "power key" might stay.

Best regards,
Krzysztof

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

end of thread, other threads:[~2017-03-07 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06  2:52 [PATCH] ARM: dts: exynos: Add power button for Odroid XU3/4 Brian Kim
2017-03-06  7:24 ` Krzysztof Kozlowski
2017-03-06  9:49   ` Brian Kim
2017-03-07 21:19     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).