AnsweredAssumed Answered

when access a GPIO on iMX28

Question asked by yongki min on Dec 4, 2013
Latest reply on Dec 5, 2013 by yongki min

Hi I ask access a GPIO port on my imx28 platform board.

At first I say thanks to the answer (https://community.freescale.com/message/365311#365311) to Yuri.

 

According to Yuri's guide I check the /sys/class/gpio as below.

root@freescale /sys/class/gpio$ ls -l

-rwxrwxrwx    1 root     root         4096 Jan  1 20:54 export

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip128 -> ../../devices/virtual/gpio/gpiochip128

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96

--w-------    1 root     root         4096 Jan  1 19:40 unexport

 

As you can see after configuration (CONFIG_GPIO_SYSFS) and re-build uImage I see the gpio sysfs.

TRe: how to access GPIO on imx28)

 

But I can't access the GPIO pin after update uImage.

root@freescale /sys/class/gpio$ echo 36 > /sys/class/gpio/export

root@freescale /sys/class/gpio$ ls -l

-rwxrwxrwx    1 root     root         4096 Jan  2 00:00 export

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip128 -> ../../devices/virtual/gpio/gpiochip128

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64

lrwxrwxrwx    1 root     root            0 Jan  1 19:40 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96

--w-------    1 root     root         4096 Jan  1 19:40 unexport

36 is pin of SSP0_DATA4 and is BANK2_PIN04. After export could not see the gpio.

 

I did modify mx28evk_fixed_pins the MUX pin of mx28evk_pins.c file in LINUX/arch/arm/march-mx28.

Outcomes