Skip to contentSkip to conversation

midas: fix IRQ pin configuration

PATCH Applied Simon Shields 2 participants 11 messages Jul 21, 2018 – Jul 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.18.0
#1 lore raw

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.

---
 arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/exynos4412-midas.dtsi +7 -0
index f12372509061..ee7cda1432f7 100644
@@ -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>;
Signature · 1 line
2.18.0
#3 lore raw

PATCH 2/5 ARM: dts: exynos: add pinctrl config for midas keys

In reply to Simon Shields

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.

---
 arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/exynos4412-midas.dtsi +7 -0
index ee7cda1432f7..6f7b564905ab 100644
@@ -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>;
Signature · 1 line
2.18.0
#5 lore raw

PATCH 3/5 ARM: dts: exynos: add pinctrl for midas fuelgauge irq pin

In reply to Simon Shields

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

---
 arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/exynos4412-midas.dtsi +7 -0
index 6f7b564905ab..6a6364a9debd 100644
@@ -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>;
Signature · 1 line
2.18.0
#7 lore raw

PATCH 4/5 ARM: dts: exynos: configure max77686 IRQ pin on midas

In reply to Simon Shields

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

---
 arch/arm/boot/dts/exynos4412-midas.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/exynos4412-midas.dtsi +7 -0
index 6a6364a9debd..d69bc3c2d0ff 100644
@@ -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>;
Signature · 1 line
2.18.0
#9 lore raw

PATCH 5/5 ARM: dts: exynos: configure midas SD card CD pin

In reply to Simon Shields

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

---
 arch/arm/boot/dts/exynos4412-midas.dtsi | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/boot/dts/exynos4412-midas.dtsi +6 -1
index d69bc3c2d0ff..3d3e6b74c12e 100644
@@ -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";
Signature · 1 line
2.18.0
maintainer Applied
#2 lore raw

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

In reply to Simon Shields
Quoted 8 lines · Simon Shields

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.

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

Thanks, applied.

Best regards,
Krzysztof

maintainer Applied
#4 lore raw

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

In reply to Simon Shields
Quoted 9 lines · Simon Shields

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.

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

Thanks, applied.

Best regards,
Krzysztof

maintainer Applied
#6 lore raw

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

In reply to Simon Shields
Quoted 7 lines · Simon Shields

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

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

Thanks, applied.

Best regards,
Krzysztof

maintainer Applied
#8 lore raw

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

In reply to Simon Shields
Quoted 7 lines · Simon Shields

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

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

Thanks, applied.

Best regards,
Krzysztof

maintainer Applied
#10 lore raw

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

In reply to Simon Shields
Quoted 7 lines · Simon Shields

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

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

Thanks, applied.

Best regards,
Krzysztof