[Letux-kernel] [PATCH RFC] dt: gta04: add pinctrl to mmc2 for remuxing dat1 to gpio

Andreas Kemnade andreas at kemnade.info
Thu Aug 11 07:22:58 CEST 2016


The previous solution to have sdio irq on gta04 was to forcre fclk
to be enabled all the time. According to the TRM of the DM3730 there
should be a possibility to have some wakeup mechanism to wake up
mmc2 to aute-enable the fclk and have the system react on sdio irqs
even if fclk is off. But the omap-hsmmc code seems not to touch a
register needed for it.
As a first workaround this patch tries to remux the dat1 line to gpio
in lower power states and use a gpio irq on that line which
is intended as a solution for am33xx chips.
The patch is based on https://lkml.org/lkml/2013/10/18/520
It should be a better solution than
f1a738b2c1dea1666bc221642632bd65031ef701
but unfortunately does not work yet. Maybe somehow wrong
pinctrl?

Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
---
 arch/arm/boot/dts/omap3-gta04.dtsi | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
index a5b4c63..46ec085 100644
--- a/arch/arm/boot/dts/omap3-gta04.dtsi
+++ b/arch/arm/boot/dts/omap3-gta04.dtsi
@@ -252,6 +252,37 @@
 		>;
 	};
 
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			/* sdmmc2_clk */
+			OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_cmd */
+			OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_dat0 */
+			OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_dat1 */
+			OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_dat2 */
+			OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_dat3 */
+			OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0)
+			/* sdmmc2_dir_dat0 */
+			OMAP3_CORE1_IOPAD(0x2164, PIN_OUTPUT_PULLUP | MUX_MODE1)
+			/* sdmmc2_dir_dat1 */
+			OMAP3_CORE1_IOPAD(0x2166, PIN_OUTPUT_PULLUP | MUX_MODE1)
+			/* sdmmc2_dir_cmd */
+			OMAP3_CORE1_IOPAD(0x2168, PIN_OUTPUT_PULLUP | MUX_MODE1)
+			/* sdmmc2_dir_clkin */
+			OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT_PULLUP | MUX_MODE1)
+		>;
+	};
+
+	mmc2_cirq_pin: pinmux_cirq_pin {
+		pinctrl-single,pins = <
+			/* MMC2_DAT1 as GPIO5_5 */
+			OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE4)
+		>;
+	};
 	backlight_pins: backlight_pins_pimnux {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x20ba, MUX_MODE3)		/* gpt11/gpio57 */
@@ -528,9 +559,15 @@
 };
 
 &mmc2 {
+	pinctrl-names = "default", "active", "idle";
+	pinctrl-0 = <&mmc2_pins>;
+	pinctrl-1 = <&mmc2_pins>;
+	pinctrl-2 = <&mmc2_cirq_pin>;
+	interrupts-extended = <&intc 86 &gpio5 5 0>;
 	vmmc-supply = <&vaux4>;
 	bus-width = <4>;
 	ti,non-removable;
+	ti,quirk-swakeup-missing;
 	mmc-pwrseq = <&wifi_pwrseq>;
 	cap-power-off-card;	/* remove! */
 };
-- 
2.1.4



More information about the Letux-kernel mailing list