how to configure mux and gpios

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to configure mux and gpios

跳至解决方案
3,387 次查看
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

标签 (2)
0 项奖励
回复
1 解答
2,805 次查看
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 项奖励
回复
5 回复数
2,805 次查看
AnsonHuang
NXP Employee
NXP Employee

Hi, Sada

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

0 项奖励
回复
2,805 次查看
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 项奖励
回复
2,805 次查看
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 项奖励
回复
2,805 次查看
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 项奖励
回复
2,806 次查看
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 项奖励
回复