GPIO numbers in kernel code [WP76]

Hello everyone,

I’m tring to get the mangoh red card working with a wiegand keyboard and due to the high frequency of the signals coming from the keyboard i’m writing a kernel driver. The problem is i’m trying to request interrupt on falling edge on my gpios 22 and 23 (located on the expander part) and it doesn’t seems to call any interrupt.

I think that writing ‘22’ and ‘23’ as my gpios kernel numbers is the problem but i can’t find the right number (with the offset ?), I saw a similar post talking about drivers/gpio/gpiolib-sysfs.c but i can’t find this file… on my leaf profile i have mangoh-red-wp76xx_0.6.0 and SWI-WP76_5.0.4, Linux version 3.18.140

If anyone would have an idea of where to look / or which cmd to use that would help me a lot.

Thanks !

Clément

you can see the array ext_gpio_map ext_gpio_wp here in yocto/kernel/driver/gpio/gpiolib-sysfs.c in line 124 where second parameter is the mdm chipset real gpio number:

Here is another method to check.
For example, typing “echo 23 > /sys/class/gpio/export” in console and then see the MDM_GPIO in dmesg kernel log which is GPIO 10.

[  172.509405] gpio_sync_ri: RI owner is Modem
[  172.509432] gpio_map_name_to_num: find GPIO 10
[  172.509442] export_store: Export GPIO: 10