how to configure mux and gpios

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to configure mux and gpios

Jump to solution
1,819 Views
sadasivam
Contributor I

How to access gpio from user space, i have sabre-sdb EVB. kindly point some documents/datasheets, it will be helpful for me.

Sada

Labels (2)
0 Kudos
1 Solution
1,237 Views
AnsonHuang
NXP Employee
NXP Employee

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.

View solution in original post

0 Kudos
5 Replies
1,237 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Sada

     From linux Document, Documentation/gpio.txt, it will tell how to control a GPIO from userspace.

0 Kudos
1,237 Views
sadasivam
Contributor I

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????

0 Kudos
1,237 Views
AnsonHuang
NXP Employee
NXP Employee

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.

0 Kudos
1,237 Views
sadasivam
Contributor I

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??

0 Kudos
1,238 Views
AnsonHuang
NXP Employee
NXP Employee

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.

0 Kudos