Other Parts Discussed in Thread: TCA8418, AM4372
Tool/software: Linux
Hello,
I am trying to connect a GPIO as an interrupt line. The relevant device tree parts are as below:
gpio0_pins_default: gpio0_pins_default {
pinctrl-single,pins = <
0x1a8 ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (M25) mcasp0_axr1.gpio0[2] */
0x1ac ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (L24) mcasp0_ahclkx.gpio0[3] */
0x158 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (T21) spi0_d1.gpio0[4] */
0x15c ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (T20) spi0_cs0.gpio0[5] */
0x1a0 ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (L23) mcasp0_aclkr.gpio0[18] */
0x1a4 ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (K23) mcasp0_fsr.gpio0[19] */
0x264 ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (P22) spi2_d0.gpio0[20] */
0x268 ( PIN_INPUT_PULLUP | MUX_MODE9 ) /* (P20) spi2_d1.gpio0[21] */
>;
};
tca8418:tca8418@34{
compatible = "ti,tca8418";
reg = <0x34>;
interrupt-parent = <&gpio0>;
interrupts = <21 0x01>; //gpio0_21 configured as interrupt
keypad,num-rows = <5>;
keypad,num-columns = <4>;
linux,keymap = <
0x0306003b
0x06000111>;
status = "okay";
};
&gpio0 {
pinctrl-names = "default";
pinctrl-0 = <&gpio0_pins_default>;
status = "okay";
};
The driver is configured without any error (checked using printk). And the interrupt gets added in /proc/interrupt
95: 0 48322000.gpio 24 Edge tca8418
But, the interrupt never gets called.
In /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins, we see that
pin 154 (PIN154): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 154 corresponds to GPIO0_21, but it says MUX UNCLAIMED.
In order to rectify this, I added the following in gpio0
p21 {
gpio-hog;
gpios = <21 GPIO_ACTIVE_HIGH>;
input;
line-name = "GPIO0_21";
};
After adding the above lines, the probe function of the driver never got called.
What am I doing wrong?
Thanks,
Rajat Rao