Skip to content

Commit 599c376

Browse files
committed
ARM: dts: Fix gpio interrupts for dm816x
Commit 7800064 ("ARM: dts: Add basic dm816x device tree configuration") added basic devices for dm816x, but I was not able to test the GPIO interrupts earlier until I found some suitable pins to test with. We can mux the MMC card detect and write protect pins from SD_SDCD and SD_SDWP mode to use a normal GPIO interrupts that are also suitable for the MMC subsystem. This turned out several issues that need to be fixed: - I set the GPIO type wrong to be compatible with omap3 instead of omap4. The GPIO controller on dm816x has EOI interrupt register like omap4 and am335x. - I got the GPIO interrupt numbers wrong as each bank has two and we only use one. They need to be set up the same way as on am335x. - The gpio banks are missing interrupt controller related properties. With these changes the GPIO interrupts can be used with the MMC card detect pin, so let's wire that up. Let's also mux all the MMC lines for completeness while at it. For the first GPIO bank I tested using GPMC lines temporarily muxed to GPIOs on the dip switch 10. Cc: Brian Hutchinson <b.hutchman@gmail.com> Cc: Matthijs van Duin <matthijsvanduin@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 0771553 commit 599c376

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

arch/arm/boot/dts/dm8168-evm.dts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
>;
3737
};
3838

39+
mmc_pins: pinmux_mmc_pins {
40+
pinctrl-single,pins = <
41+
DM816X_IOPAD(0x0a70, MUX_MODE0) /* SD_POW */
42+
DM816X_IOPAD(0x0a74, MUX_MODE0) /* SD_CLK */
43+
DM816X_IOPAD(0x0a78, MUX_MODE0) /* SD_CMD */
44+
DM816X_IOPAD(0x0a7C, MUX_MODE0) /* SD_DAT0 */
45+
DM816X_IOPAD(0x0a80, MUX_MODE0) /* SD_DAT1 */
46+
DM816X_IOPAD(0x0a84, MUX_MODE0) /* SD_DAT2 */
47+
DM816X_IOPAD(0x0a88, MUX_MODE0) /* SD_DAT2 */
48+
DM816X_IOPAD(0x0a8c, MUX_MODE2) /* GP1[7] */
49+
DM816X_IOPAD(0x0a90, MUX_MODE2) /* GP1[8] */
50+
>;
51+
};
52+
3953
usb0_pins: pinmux_usb0_pins {
4054
pinctrl-single,pins = <
4155
DM816X_IOPAD(0x0d00, MUX_MODE0) /* USB0_DRVVBUS */
@@ -137,7 +151,12 @@
137151
};
138152

139153
&mmc1 {
154+
pinctrl-names = "default";
155+
pinctrl-0 = <&mmc_pins>;
140156
vmmc-supply = <&vmmcsd_fixed>;
157+
bus-width = <4>;
158+
cd-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
159+
wp-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
141160
};
142161

143162
/* At least dm8168-evm rev c won't support multipoint, later may */

arch/arm/boot/dts/dm816x.dtsi

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,27 @@
150150
};
151151

152152
gpio1: gpio@48032000 {
153-
compatible = "ti,omap3-gpio";
153+
compatible = "ti,omap4-gpio";
154154
ti,hwmods = "gpio1";
155+
ti,gpio-always-on;
155156
reg = <0x48032000 0x1000>;
156-
interrupts = <97>;
157+
interrupts = <96>;
158+
gpio-controller;
159+
#gpio-cells = <2>;
160+
interrupt-controller;
161+
#interrupt-cells = <2>;
157162
};
158163

159164
gpio2: gpio@4804c000 {
160-
compatible = "ti,omap3-gpio";
165+
compatible = "ti,omap4-gpio";
161166
ti,hwmods = "gpio2";
167+
ti,gpio-always-on;
162168
reg = <0x4804c000 0x1000>;
163-
interrupts = <99>;
169+
interrupts = <98>;
170+
gpio-controller;
171+
#gpio-cells = <2>;
172+
interrupt-controller;
173+
#interrupt-cells = <2>;
164174
};
165175

166176
gpmc: gpmc@50000000 {

0 commit comments

Comments
 (0)