Expander interrupt on imx8mn ddr4 evk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Expander interrupt on imx8mn ddr4 evk

303 Views
danab
Contributor I

Hello,

I am trying to understand the interrupt from the pca6416 to the imx8mn.  I have a spi-duart bridge, and the interrupt from that device is going into one of the gpios of the expander.

My problem is that the interrupt of the pca6416 is always low, i.e., asserted.  Reading the ports on the expander doesn't cause the interrupt to go high.  I also read from the data sheet that the interrupt requires a pull-up.  I'm having problems adding that pull-up in the configuration of the gpio pin on the imx8.

gpiochip0 - 32 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed "interrupt" input active-high [used]
line 4: unnamed unused input active-high
line 5: unnamed unused input active-high
line 6: unnamed unused output active-high
line 7: unnamed unused output active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed unused input active-high
line 12: unnamed kernel input active-high [used]
line 13: unnamed "ir-receiver" input active-low [used]
line 14: unnamed unused input active-high
line 15: unnamed "cd" input active-low [used]
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused input active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused input active-high
line 27: unnamed unused input active-high
line 28: unnamed unused input active-high
line 29: unnamed unused input active-high
line 30: unnamed unused input active-high
line 31: unnamed unused input active-high

Line 12 is the one that is configured as an interrupt.  It seems correct, but gpioinfo shows it as an active high input with no pullup.  I just want to add that pullup.

Here's the modification of the pca6416 in the .dts file:

&pca6416 {
interrupt-parent = <&gpio1>;
interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = "default";
interrupt-controller;
#interrupt-cells = <2>;
// The line names. There are 16 of them
gpio-line-names = "Duart Reset", "", "", "",
"", "", "", "",
"", "", "XR Interrupt", "", "",
"VRBus Reset", "", "Comm Reset 2";
};
How do I get that pullup added?
Thanks,
Dana
0 Kudos
3 Replies

273 Views
danab
Contributor I

Hi Jimmy,

The only problem I am having is adding the internal pull-up to the pad.  I have tried using pinctrl:

pinctrl_exp: expgrp {
fsl,pins = <
MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x148
>;
};
 
I have tried using 0x159, 0x148 and now 0x19 per the link you added.

Here's the chunk in the .dts file for the pca6416:
 
&pca6416 {
pinctrl-0 = <&pinctrl_exp>;
interrupt-parent = <&gpio1>;
interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
// The line names. There are 16 of them
gpio-line-names = "Duart Reset", "", "", "",
"", "", "", "",
"", "", "XR Interrupt", "", "",
"VRBus Reset", "", "Comm Reset 2";
}
 
No matter what I do, gpioinfo 0 always shows GPIO1_12 as "interrupt input active-high [used]" where I want it to be active low with a pull-up.
0 Kudos

253 Views
jimmychan
NXP TechSupport
NXP TechSupport

Do you mean you want to setup the gpio is something like the "ir-receiver" which is input active-low? so, you may take the source code of ir-receiver for reference.

https://github.com/nxp-imx/linux-imx/blob/imx_5.4.70_2.3.0/drivers/media/rc/gpio-ir-recv.c

 

and you may add the code that you need for the gpio interrupt setup in the driver

https://github.com/nxp-imx/linux-imx/blob/imx_5.4.70_2.3.0/drivers/gpio/gpio-pca953x.c

0 Kudos