simple LED blinking driver using FDT on kernel v3.4

Discussion created by Rooney on May 22, 2012

I want to use kernel v3.4 on my i.MX53 QSB. Since version 3.1 the flat device tree is supported by the kernel.

Can anyone explain how to write a simple driver that is toggling a GPIO? IMX_GPIO_NR() is not working anymore and I'm really frustrated that is obviouly difficult to toggle a pin.

If the GPIO is defined in my device tree specification how can the driver access this gpio?

In kernel v3.0 I just had to do the following:


#define USER_LED_EN             IMX_GPIO_NR(4, 3)
#define USER_LED_EN_PAD         MX53_PAD_GPIO_13__GPIO4_3


gpio_request(USER_LED_EN, "user led");
gpio_direction_output(USER_LED_EN, 1);
gpio_set_value(USER_LED_EN, ledState);