Detecting edges on SysFS pins?

Hey All,

We are using the WP8548 module and have digital inputs connected to sysfs pins highlighted in the attached image. They are wakeable pins, but we have recently learned that that may only wake at the kernel level and not allow us to detect edges when our module is already awake. Is this true or is there a way to still detect edges on these GPIO? We are hoping to not have to do a board spin on all of our hardware to move all of our GPIO around.

Thanks!

image

Hello all,

I have a few more technical details to share (@coastalbrandon and I are working on the same product).

First off, we have run the required AT commands to enable these pins (more info here).

We’ve been using the le_gpio API (with a binding to gpioService) to interact with the pins highlighted above. For the most part, they behave as expected. The trouble comes when trying to bind a change handler using le_gpio_AddChangeEventHandler. We are seeing the error returned on line 579 of ${LEGATO_ROOT}/components/sysfsGpio/gpioSysfsUtils.c. If you run an ls on any of the sysfs pins (except GPIO38), you can see the edge property is missing as reported by gpioService.

I did some reading today in the Linux docs and they indicate that a sysfs GPIO pin without an edge property are not capable of generating interrupts in user space. I also looked into manually implementing this with poll but (to my understanding) it seems you need an edge property to do this. In theory a while(true) loop calling le_gpio_Read could achieve this, but I would be surprised if this was efficient (in terms of power and CPU), or accurate (in terms of timing).

I’m confused as to why GPIO38 is capable of generating user space interrupts and the rest of the sysfs GPIO pins seem to be unable of achieving this. Is there something special about this sysfs GPIO pin?

If any additional details or log messages would be helpful to debug this, please let me know and I’ll be happy to provide them.

Cheers!

Link for the Linux docs I was reading: https://www.kernel.org/doc/Documentation/gpio/sysfs.txt.

(Would have put this in the original but this forum limits the number of links in a post for a new user)

For anyone reading this topic, there is a parallel discussion happening on the mangOH forum