Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an embedded Linux board I'm working on, with a button and a couple LEDs.

By default, I can control the LEDs via


However, I have no way to monitor the button. If I enable CONFIG_GPIO_SYSFS, I can't see the LEDs anymore - /sys/class/leds/ is empty. Additionally, the GPIOs that in theory should go to the LEDs don't do anything, so I can't even hack it.

Any thoughts on how I could get both of these working?

share|improve this question

Solution turned out to be simple enough. It turned out I was poking the wrong GPIO. The beginning offset was defined in:




NR_AIC_IRQS is defined in irqs.h in the same directory as:

#define NR_AIC_IRQS 32

The pins I was looking for were PB12 and PB13, which I found in gpio.h defined as:

#define AT91_PIN_PB12   (PIN_BASE + 0X20 + 12)
#define AT91_PIN_PB13   (PIN_BASE + 0X20 + 13)

So the pins I was looking for were 32 + 32 + 12 = 76 and 77.

share|improve this answer
Is it normal behaviour for the led class to be disabled if GPIO_SYSFS is enabled? – Alpaca Jul 30 '14 at 2:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.