xM Rev C - Can't access to the user button on Ubuntu


I have a BeegleBoard-xM Rev C and I can't get the user button (GPIO 4) working on Ubuntu 11.10. I'm using the latest version of the OMAP demo image with 3.1.4 kernel. Please help me to solve this - for example, how I can know who is blocking the access to the device?

I have the same problem.

I’m have a similar problem running Angstrom on an xM. I’m upgrading from

$ uname -a
Linux beagleboard 2.6.32 #3 PREEMPT Tue May 10 10:06:15 CEST 2011 armv7l GNU/Linux


$ uname -a
Linux dhcp-137-112-41-101 3.0.14+ #1 Thu Dec 22 09:53:00 CET 2011 armv7l GNU/Linux

On the 2.6.32 kernel this works fine to read the USER pushbutton:
$ cd /sys/class/gpio
$ echo 4 > export

But on the 3.0.14+ kernel I get

$ cd /sys/class/gpio/
$ echo 4 > export
bash: echo: write error: Device or resource busy

$ cat /sys/kernel/debug/gpio
GPIOs 0-31, gpio:
gpio-4 (user ) in lo

GPIOs 32-63, gpio:

GPIOs 64-95, gpio:

GPIOs 96-127, gpio:

GPIOs 128-159, gpio:
gpio-147 (USB2 PHY reset ) out hi
gpio-149 (beagleboard::usr1 ) out lo
gpio-150 (beagleboard::usr0 ) out hi
gpio-156 (LCD power ) out lo

GPIOs 160-191, gpio:
gpio-170 (DVI_nPD ) out hi

GPIOs 192-211, platform/twl4030_gpio, twl4030, can sleep:
gpio-192 (mmc_cd ) in lo
gpio-193 (nDVI_PWR_EN ) out lo
gpio-194 (DVI_LDO_EN ) out lo
gpio-210 (nEN_USB_PWR ) out hi
gpio-211 (beagleboard::pmu_sta) out lo

So, on the new kernel someone is already using gpio 4.

  1. How do I find out who’s using it? Is there a new interface for the pushbutton?
  2. How do I get access to gpio 4? At is, is there a way to stop the other thing from using it?


Hello guys, it seems that a driver is using that pin. You should look for it in the Beagle user manual and disable the driver on the ‘menuconfig’.


Fernando Akira Endo

Phi Innovations

Av. José Rocha Bomfim, 214 - Cj. 16
Cond. Praça Capital - Ed. Londres
Center Santa Genebra
13080-650 - Campinas - SP - Brasil
+55 19 3709-1358

2012/7/5 Mark A. Yoder <mark.a.yoder@gmail.com>

An actual button driver is using it, you should read the /dev/eventX interface instead of using the gpio hack

I see, gpio-keys is controlling that pin. So, two questions.

  1. How do I read the value of the button from the command line? I see how to do it from a c file, but not the command line.
  2. How do I turn off the button driver so I can access it via gpio4?