Using USERDEF1 and USERDEF2 GPIO's on IMX53 Ubuntu

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

Using USERDEF1 and USERDEF2 GPIO's on IMX53 Ubuntu

1,309 Views
praveendosapati
Contributor I

Hi all,

     I would like to use USER1 and USER2 GPIO's provided on i.MX53 Quick start-R Board. In testing these GPIO's when I press the button it should be high on logic analyser but it is not becoming high, these Pins are always Low. But in boot-up initially they are becoming High. Should I need to do configure in Kernel while compilation. Could Some one help in Enabling this PINS.

     I couldn't find /sys/class/gpio file location.

     Thanks in Advance.

Regards,

Praveen

Labels (2)
0 Kudos
Reply
3 Replies

947 Views
igorpadykov
NXP Employee
NXP Employee

Hi praveen

in the file mx53_loco.c file the  GPIO2_14 and GPIO2_15 are

configured and registered under gpio-keys. If you want to control

this GPIO using SYS interface you need to comment out the next lines

static struct gpio_keys_button loco_buttons[] = {

        GPIO_BUTTON(MX53_nONKEY, KEY_POWER, 1, "power", 0),

/*      GPIO_BUTTON(USER_UI1, KEY_VOLUMEUP, 1, "volume-up", 0),

        GPIO_BUTTON(USER_UI2, KEY_VOLUMEDOWN, 1, "volume-down", 0), */

};

Moreover, be sure that you have selected

--Device Drivers

   ---GPIO Support

     -- /sys/class/gpio (sysfs interface)

Recompile your kernel and replace it by the current one and you would

control these GPIO as the LED on the QSB.

FAQ All Boards GPIO Test

For example: using KEY_ROW4  GPIO4[15] :  32*3 +15=111

echo 111 > /sys/class/gpio/export

echo "out" > /sys/class/gpio/gpio111/direction

value=/sys/class/gpio/gpio111/value

echo 1 > $value;

echo 0 > $value ;

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

947 Views
TKs
Contributor II

Hello

if I type :

root@arm:/home/debian# cat /sys/kernel/debug/gpio

GPIOs 0-31, platform/53f84000.gpio, 53f84000.gpio:

gpio-8   (Power Button        ) in  lo   

GPIOs 32-63, platform/53f88000.gpio, 53f88000.gpio:

gpio-46  (Volume Up           ) in  hi   

gpio-47  (Volume Down         ) in  hi   

GPIOs 64-95, platform/53f8c000.gpio, 53f8c000.gpio:

gpio-75  (cd                  ) in  hi   

gpio-76  (wp                  ) in  hi   

GPIOs 96-127, platform/53f90000.gpio, 53f90000.gpio:

GPIOs 128-159, platform/53fdc000.gpio, 53fdc000.gpio:

GPIOs 160-191, platform/53fe0000.gpio, 53fe0000.gpio:

GPIOs 192-223, platform/53fe4000.gpio, 53fe4000.gpio:

gpio-198 (phy-reset           ) out lo   

gpio-199 (?                   ) out lo   

gpio-200 (usb_vbus            ) out lo

but

root@arm:/home/debian# echo 46 > /sys/class/gpio/export

bash: echo: write error: Device or resource busy

any idea how to overcome this error?

Thanks

0 Kudos
Reply

947 Views
TKs
Contributor II

I find it

cd /sys/bus/platform/drivers/gpio-keys

echo gpio-keys > unbind

echo 46 > /sys/class/gpio/export

:smileywink:

0 Kudos
Reply