Hi,
There are several posts regarding this issue, but there are no clear answers to what I believe should be a simple problem: Controlling some GPIOs from User Space.
I am using an OMAP L138 on a custom board with Linux PSP v3.22 and have recompiled the kernel to show /sys/class/gpio. I have further executed commands in Kernel Space such as:
echo 13 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio13/direction
etc.
The pin (GP0[13]) responds as expected which tells me that the Pin Multiplexing and GPIO Driver is correct/functional.
From the kernel documentation (gpio.txt) I deduce that by including the header "/linux/gpio.h" the function "gpio_is_valid" is a good place to start coding the User Space interface. However, this particular function looks as follows (in gpio.h):
static inline bool gpio_is_valid(int number) {return false}
...which does not look particularly useful.
Further, this header leads to compilation errors as well.
My question is: Is it worth while sorting out the compilation errors in this header? All the functions in this header that gpio.txt refers to seem useless. Is there a better way to reach the GPIOs from User Space?
PS: I have set up I2C and SPI drivers in the kernel and access them from User Space using ioctls, which works well. Is there anything similar for GPIOs?