How to access gpio from user space, i have sabre-sdb EVB. kindly point some documents/datasheets, it will be helpful for me.
Sada
Solved! Go to Solution.
Hi,
for DL, it is in arch/arm/mach-mx6/board-mx6dl_sabresd.h, for i.MX6Q, it is arch/arm/mach-mx6/board-mx6q_sabresd.h. You need to set the intial status of all pins.
Hi, Sada
From linux Document, Documentation/gpio.txt, it will tell how to control a GPIO from userspace.
The below GPIO has been configured as used as LED in the EVB.
#define SABRESD_USR_DEF_RED_LED IMX_GPIO_NR(1, 2)
when i tried to export the same as per GPIO.txt
getting below error
echo 2 > export
sh: write error: Device or resource busy
I also tried with another GPIO3[15].
which is already set as Input. I am able to change direction of that particular pin. but not able to make changes in value. Value always remains 0.
what am i missing to do????
You may need to check this pin's IOMUX, normally it is not set as GPIO mode. And GPIO driver will not handle the MUX setting.
I tried to find how to change the MUX mode in target board, but didnt find any details. Kindly advice how to check/modify the IO mux. Can it be changed after login??
Hi,
for DL, it is in arch/arm/mach-mx6/board-mx6dl_sabresd.h, for i.MX6Q, it is arch/arm/mach-mx6/board-mx6q_sabresd.h. You need to set the intial status of all pins.