# GPIO numbers in kernel code \[WP76\]

**URL:** <https://mangoh.discourse.group/t/gpio-numbers-in-kernel-code-wp76/9983>\
**Category:** mangOH Red\
**Created:** [May 16, 2022, 2:22pm UTC](https://mangoh.discourse.group/t/gpio-numbers-in-kernel-code-wp76/9983 "2022-05-16T14:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clementd](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@clementd](https://mangoh.discourse.group/u/clementd)\
**Post date:** [May 16, 2022, 2:22pm UTC](https://mangoh.discourse.group/t/gpio-numbers-in-kernel-code-wp76/9983/1 "2022-05-16T14:22:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 16, 2022, 2:48pm UTC](https://mangoh.discourse.group/t/gpio-numbers-in-kernel-code-wp76/9983/2 "2022-05-16T14:48:52Z")

</div>

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:

> **[UART flow control with WP7608](https://forum.legato.io/t/uart-flow-control-with-wp7608/4597/12)**
>
> Please see my modification on yocto/kernel/driver/gpio/gpiolib.c. gpiolib-sysfs.c (36.7 KB)

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.

```auto
[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

```

> **[\[WP7605\]\[SW\] How to indicate the periodic signal, in order to use external...](https://forum.legato.io/t/wp7605-sw-how-to-indicate-the-periodic-signal-in-order-to-use-external-window-wdt/5087/2)**
>
> please see the attached doc on generating PWM signal.Example\_on\_simulating\_pulse\_width\_modulation(PWM).docx (77.5 KB)
