IMX8MP gpio interrupt issue

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

IMX8MP gpio interrupt issue

325 Views
ajayvk1
Contributor I

Hi ,

We are using GPIO12 (pin S142) NXP i.MX 8M Plus:  MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19 0x19 for one of our usecase  and configured as a input and we have a externel pull up resistor of 4.7K ohm . When we configure that as only falling edge we are seeing interrupt for both the rising edge and falling edge Please help us in solving this problem what change we need to do for make it work.

Labels (1)
0 Kudos
Reply
3 Replies

308 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi 

I would suggest you 

1. Please make sure the gpio  is configured for falling edge only,  for example

interrupt-parent = <&gpio4>;
interrupts = <19 IRQ_TYPE_EDGE_FALLING>;

Ensure you are using IRQ_TYPE_EDGE_FALLING and not IRQ_TYPE_EDGE_BOTH

 

2. check the Pad control flag.

The pad control value 0x19 might not be enabling input correctly,  Try to use a more explicit configuration like

MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19 0x130

where 0x130 enables input /  pull-up / medium drive strength.

 

Regards

Daniel

 

 

 

0 Kudos
Reply

263 Views
ajayvk1
Contributor I

Hi Daniel,
I have tried by setting configuration like
MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19 0x130
But still im facing interrupt is coming for both the edges as we are not using the dtsi file to add like this entry interrupt-parent = <&gpio4>;
interrupts = <19 IRQ_TYPE_EDGE_FALLING>;
we have a driver which will have  below code  to request for falling edge only :-

if (request_irq(irqNumber, irq_handler, IRQF_TRIGGER_FALLING, "device", (void *)(irq_handler))) {
printk(KERN_INFO "my_device: cannot register IRQ ");
goto irq;

So please help how to resolve this issue .Is something from GIC will set to both edge type ?

 

0 Kudos
Reply

195 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

 

I would suggest you check the GPIO4_ICR2 register,  to get the real trigger type configured.

Bit 6-7 correspond to pin 19.

danielchen_0-1755589193558.png

 

If you are not using DTS,  ensure you explicitly set the IRQ type in your driver before calling request_irq( );

irq_set_irq_type(irqNumber, IRQ_TYPE_EDGE_FALLING);

 

 

Regards

Daniel

 

0 Kudos
Reply