2018-07-21 12:53:03

by Simon Shields

[permalink] [raw]
Subject: [PATCH 0/5] midas: fix IRQ pin configuration

This patch series disables the internal pull-up/down resistors
for IRQ lines which are pulled up externally. Without these patches the
associated IRQs never fire if the bootloader hasn't configured the pins
correctly.

Simon Shields (5):
ARM: dts: exynos: add max77693 pinctrl config for midas
ARM: dts: exynos: add pinctrl config for midas keys
ARM: dts: exynos: add pinctrl for midas fuelgauge irq pin
ARM: dts: exynos: configure max77686 IRQ pin on midas
ARM: dts: exynos: configure midas SD card CD pin

arch/arm/boot/dts/exynos4412-midas.dtsi | 35 ++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)

--
2.18.0



2018-07-21 12:53:34

by Simon Shields

[permalink] [raw]
Subject: [PATCH 1/5] ARM: dts: exynos: add max77693 pinctrl config for midas

Currently, we assume that the bootloader has correctly configured
the interrupt pin for max77693. This might not actually be the case -
so it's better to configure it explicitly.

Signed-off-by: Simon Shields <[email protected]>
---
arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
index f12372509061..ee7cda1432f7 100644
--- a/arch/arm/boot/dts/exynos4412-midas.dtsi
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -156,6 +156,8 @@
compatible = "maxim,max77693";
interrupt-parent = <&gpx1>;
interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&max77693_irq>;
reg = <0x66>;

regulators {
@@ -1124,6 +1126,11 @@
pinctrl-names = "default";
pinctrl-0 = <&sleep1>;

+ max77693_irq: max77693-irq {
+ samsung,pins = "gpx1-5";
+ samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+ };
+
hdmi_hpd: hdmi-hpd {
samsung,pins = "gpx3-7";
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
--
2.18.0


2018-07-21 12:53:49

by Simon Shields

[permalink] [raw]
Subject: [PATCH 2/5] ARM: dts: exynos: add pinctrl config for midas keys

This pins are externally pulled up, and so we should explicitly
configure them to disable the SoC-internal pull-downs. Previously
we relied on the bootloader doing this in order to allow the buttons
to function properly.

Signed-off-by: Simon Shields <[email protected]>
---
arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
index ee7cda1432f7..6f7b564905ab 100644
--- a/arch/arm/boot/dts/exynos4412-midas.dtsi
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -112,6 +112,8 @@

gpio-keys {
compatible = "gpio-keys";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_keys>;

key-down {
gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
@@ -1126,6 +1128,11 @@
pinctrl-names = "default";
pinctrl-0 = <&sleep1>;

+ gpio_keys: gpio-keys {
+ samsung,pins = "gpx0-1", "gpx2-2", "gpx2-7", "gpx3-3";
+ samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+ };
+
max77693_irq: max77693-irq {
samsung,pins = "gpx1-5";
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
--
2.18.0


2018-07-21 12:54:00

by Simon Shields

[permalink] [raw]
Subject: [PATCH 3/5] ARM: dts: exynos: add pinctrl for midas fuelgauge irq pin

This pin is externally pulled up, so we should disable the SoC's
pull down resistor in order for the interrupt to function properly.

Signed-off-by: Simon Shields <[email protected]>
---
arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
index 6f7b564905ab..6a6364a9debd 100644
--- a/arch/arm/boot/dts/exynos4412-midas.dtsi
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -206,6 +206,8 @@
compatible = "maxim,max17047";
interrupt-parent = <&gpx2>;
interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&max77693_fuel_irq>;
reg = <0x36>;

maxim,over-heat-temp = <700>;
@@ -1138,6 +1140,11 @@
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

+ max77693_fuel_irq: max77693-fuel-irq {
+ samsung,pins = "gpx2-3";
+ samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+ };
+
hdmi_hpd: hdmi-hpd {
samsung,pins = "gpx3-7";
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
--
2.18.0


2018-07-21 12:54:42

by Simon Shields

[permalink] [raw]
Subject: [PATCH 5/5] ARM: dts: exynos: configure midas SD card CD pin

This pin is externally pulled up, so we need to disable the SoC's
internal pull down resistor to allow it to function properly.

Signed-off-by: Simon Shields <[email protected]>
---
arch/arm/boot/dts/exynos4412-midas.dtsi | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
index d69bc3c2d0ff..3d3e6b74c12e 100644
--- a/arch/arm/boot/dts/exynos4412-midas.dtsi
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -1152,6 +1152,11 @@
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

+ sdhci2_cd: sdhci2-cd-irq {
+ samsung,pins = "gpx3-4";
+ samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+ };
+
hdmi_hpd: hdmi-hpd {
samsung,pins = "gpx3-7";
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
@@ -1383,7 +1388,7 @@
bus-width = <4>;
cd-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
cd-inverted;
- pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
+ pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sdhci2_cd>;
pinctrl-names = "default";
vmmc-supply = <&ldo21_reg>;
status = "okay";
--
2.18.0


2018-07-21 12:54:50

by Simon Shields

[permalink] [raw]
Subject: [PATCH 4/5] ARM: dts: exynos: configure max77686 IRQ pin on midas

This pin is externally pulled up, so we need to disable the
SoC's internal pull-down.

Signed-off-by: Simon Shields <[email protected]>
---
arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-midas.dtsi b/arch/arm/boot/dts/exynos4412-midas.dtsi
index 6a6364a9debd..d69bc3c2d0ff 100644
--- a/arch/arm/boot/dts/exynos4412-midas.dtsi
+++ b/arch/arm/boot/dts/exynos4412-midas.dtsi
@@ -685,6 +685,8 @@
compatible = "maxim,max77686";
interrupt-parent = <&gpx0>;
interrupts = <7 IRQ_TYPE_NONE>;
+ pinctrl-0 = <&max77686_irq>;
+ pinctrl-names = "default";
reg = <0x09>;
#clock-cells = <1>;

@@ -1135,6 +1137,11 @@
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
};

+ max77686_irq: max77686-irq {
+ samsung,pins = "gpx0-7";
+ samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+ };
+
max77693_irq: max77693-irq {
samsung,pins = "gpx1-5";
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
--
2.18.0


2018-07-23 17:13:58

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/5] ARM: dts: exynos: add max77693 pinctrl config for midas

On Sat, Jul 21, 2018 at 10:50:49PM +1000, Simon Shields wrote:
> Currently, we assume that the bootloader has correctly configured
> the interrupt pin for max77693. This might not actually be the case -
> so it's better to configure it explicitly.
>
> Signed-off-by: Simon Shields <[email protected]>
> ---
> arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)

Thanks, applied.

Best regards,
Krzysztof


2018-07-23 17:14:09

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/5] ARM: dts: exynos: add pinctrl config for midas keys

On Sat, Jul 21, 2018 at 10:50:50PM +1000, Simon Shields wrote:
> This pins are externally pulled up, and so we should explicitly
> configure them to disable the SoC-internal pull-downs. Previously
> we relied on the bootloader doing this in order to allow the buttons
> to function properly.
>
> Signed-off-by: Simon Shields <[email protected]>
> ---
> arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)

Thanks, applied.

Best regards,
Krzysztof


2018-07-23 17:14:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/5] ARM: dts: exynos: add pinctrl for midas fuelgauge irq pin

On Sat, Jul 21, 2018 at 10:50:51PM +1000, Simon Shields wrote:
> This pin is externally pulled up, so we should disable the SoC's
> pull down resistor in order for the interrupt to function properly.
>
> Signed-off-by: Simon Shields <[email protected]>
> ---
> arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)

Thanks, applied.

Best regards,
Krzysztof


2018-07-23 17:14:46

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 4/5] ARM: dts: exynos: configure max77686 IRQ pin on midas

On Sat, Jul 21, 2018 at 10:50:52PM +1000, Simon Shields wrote:
> This pin is externally pulled up, so we need to disable the
> SoC's internal pull-down.
>
> Signed-off-by: Simon Shields <[email protected]>
> ---
> arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
> 1 file changed, 7 insertions(+)

Thanks, applied.

Best regards,
Krzysztof


2018-07-23 17:14:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 5/5] ARM: dts: exynos: configure midas SD card CD pin

On Sat, Jul 21, 2018 at 10:50:53PM +1000, Simon Shields wrote:
> This pin is externally pulled up, so we need to disable the SoC's
> internal pull down resistor to allow it to function properly.
>
> Signed-off-by: Simon Shields <[email protected]>
> ---
> arch/arm/boot/dts/exynos4412-midas.dtsi | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)

Thanks, applied.

Best regards,
Krzysztof