Accessing GPIO in imx6

Showing results for 
Search instead for 
Did you mean: 

Accessing GPIO in imx6

Contributor III

I want to change value of GPIO1_25  (phy_reset)

but following error comes

root@var-som-mx6:~# echo 25 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy

What should i do to change the value of phy reset pin

Following is current status

root@var-som-mx6:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/209c000.gpio, 209c000.gpio:
gpio-6 (cd ) in lo
gpio-25 (phy-reset ) out lo
gpio-28 (usb_h1_vbus ) out lo

GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio:

GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio:

GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio:
gpio-101 (tlv320aic3x reset ) out lo
gpio-111 (usb_otg_vbus ) out lo
gpio-121 (Menu ) in hi
gpio-122 (Back ) in hi

GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
gpio-139 (Home ) in hi

GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio:
gpio-178 (sysfs ) out lo

GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio:
gpio-200 (wlan-en-regulator ) out lo

Thanks and Regards

Tags (2)
0 Kudos
1 Reply

NXP Employee
NXP Employee

Hi sameerarvikar,

most likely the gpio is being used by another driver, in this case no other driver can access to the gpio. You can look into the devi tree file (.dts) and look which module is using this pin. Then you can comment or delete the line where the pin is being initialized within such module and after rebuilding the dtb file you may be able to use it as a gpio.

Best regards,

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos