cancel
Showing results for 
Search instead for 
Did you mean: 

probe of gpio-keys failed (PA12)

Makandra
Associate II

Hello

I currently run on hardware STM32MP135f-DK and am preparing for running a custom HW.

When assigning PA12 as a gpio-key in the devicetree,I get this error on boot:


[ 3.544391] genirq: Flags mismatch irq 45. 00000083 (my-input) vs. 00002088 (0-0021)
[ 3.551110] gpio-keys gpio-keys: Unable to claim irq 45; error -16
[ 3.557446] gpio-keys: probe of gpio-keys failed with error -16

The result is that nothing from that gpio-keys-node is initialized (if I run gpioinfo)

 

PA12 is also referenced by ETH2 by default, and all references to eth2 are removed from my devicetree

 

This is how I add the new gpio to the devicetree, basically the same as the default user-pa13, but with 12 instead of 13.

gpio-keys {
compatible = "gpio-keys";

my-input {
label = "my-input";
linux,code = <BTN_2>;
gpios = <&gpioa 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};

};

I cannot find anything else pointing at PA12 in the devicetree.

Other pins that I define as gpio-keys work.

 

Does anyone know what is interfering or where to start looking?

 

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

Hi,

I think the PA12 is maybe already defined elsewhere.

Various command who could help.

gpioinfo

cat /sys/kernel/debug/gpio

cat /sys/kernel/debug/pinctrl/soc*:pinctrl*/pinconf-pins

 

Maybe there is link with the HW limitation which does not allow more than one same 'N' for GPIO interrupt on PxN (x ={A...Z}, and N = {0 to 15} )

PatrickF_0-1728058693454.png

 

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
PatrickF
ST Employee

Hi,

I think the PA12 is maybe already defined elsewhere.

Various command who could help.

gpioinfo

cat /sys/kernel/debug/gpio

cat /sys/kernel/debug/pinctrl/soc*:pinctrl*/pinconf-pins

 

Maybe there is link with the HW limitation which does not allow more than one same 'N' for GPIO interrupt on PxN (x ={A...Z}, and N = {0 to 15} )

PatrickF_0-1728058693454.png

 

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Makandra
Associate II

gpioinfo: "line 12: "PA12" input"

line 11: "PA11" input active-low bias=pull-up consumer="pa11"
line 12: "PA12" input
line 13: "PA13" input active-low bias=pull-up consumer="User-PA13"

 

cat /sys/kernel/debug/gpio

gpio-11 (PA11 |pa11 ) in hi IRQ ACTIVE LOW
gpio-12 (PA12 )
gpio-13 (PA13 |User-PA13 ) in hi IRQ ACTIVE LOW

 

cat /sys/kernel/debug/pinctrl/soc*:pinctrl*/pinconf-pins

pin 11 (PA11): input - high - pull up
pin 12 (PA12): input - high - pull up
pin 13 (PA13): input - high - pull up

 

I have decompiled the devicetree and tried to look for it, but I cannot find anything about either PA12 or "00002088 (0-0021)"

 

It seems that it is the hardware limitation that causes it.
Various other pins, A11, A13, B6 and B3 in a gpio-keys-node properly initializes.

I added A12, B12, E12 and H12, (none of which are used according to gpioinfo) into separate gpio-keys-nodes and none of which succeeded to initialize

[ 3.310474] genirq: Flags mismatch irq 45. 00000083 (h12) vs. 00002088 (0-0021)
[ 3.316560] gpio-keys gpio-keys-h12: Unable to claim irq 45; error -16
[ 3.323233] gpio-keys: probe of gpio-keys-h12 failed with error -16
[ 3.329587] genirq: Flags mismatch irq 45. 00000083 (a12) vs. 00002088 (0-0021)
[ 3.336765] gpio-keys gpio-keys-a12: Unable to claim irq 45; error -16
[ 3.343154] gpio-keys: probe of gpio-keys-a12 failed with error -16
[ 3.349581] genirq: Flags mismatch irq 45. 00000083 (b12) vs. 00002088 (0-0021)
[ 3.356786] gpio-keys gpio-keys-b12: Unable to claim irq 45; error -16
[ 3.363296] gpio-keys: probe of gpio-keys-b12 failed with error -16
[ 3.369618] genirq: Flags mismatch irq 45. 00000083 (e12) vs. 00002088 (0-0021)
[ 3.376825] gpio-keys gpio-keys-e12: Unable to claim irq 45; error -16
[ 3.383333] gpio-keys: probe of gpio-keys-e12 failed with error -16

 

I have not yet managed to find out which pin is interfering.