simple LED blinking driver using FDT on kernel v3.4

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

simple LED blinking driver using FDT on kernel v3.4

529 Views
Rooney
Contributor III

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

...

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

Tags (1)
0 Kudos
0 Replies