basic approach for LED interface with GPIO pins.

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

basic approach for LED interface with GPIO pins.

1,886 Views
anamikalal
Contributor I

Hi all,

I am a newbie in device driver stuffs. I want to connect LEDs to the gpio pins of imx6qdl and use it for debugging purpose.

For that purpose I have modified the device tree as follows:

leds {

            pinctrl-names ="default";

             pinctrl-0 =<&pinctrl_leds>;

compatible = "gpio-leds";

debug-led-1 {

                                label ="Debug-led1";

                                gpios = <&gpio1 1>;         

                                linux,default-trigger ="heartbeat";

                                linux,default-state ="on";

                };

                debug-led-2 {

                                label ="Debug-led2";

                                gpios= <&gpio1 2>;         

                                linux,default-trigger ="heartbeat";

                                linux,default-state ="on";

                };

     };

the pinctrl settings are:-

pinctrl_leds: ledsgrp {

                                fsl,pins = <

                                                MX6QDL_PAD_GPIO_1__GPIO1_IO01      0x0b0b0                                /*Debug-led-1*/

                                                MX6QDL_PAD_GPIO_2__GPIO1_IO02       0x0b0b0                                /*Debug-led-2 */

                                                >

                                             }

Now I want to know what else I need to do for configuring the gpio pins?

Do I need to modify the board setup code?

Do I need to add/modify something in device driver (leds-gpio.c)code? (eg: platform_device or platform_data structure or the device tree will take care of it?)

Please help !!!

Thanks,

Anamika

Labels (3)
Tags (1)
0 Kudos
Reply
1 Reply

840 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Anamika,

The following threads may be useful for you:

imx6sl evk debug led

Re: Re: GPIO interrupt on i.MX6

Re: Proper GPIO interrupt handling in iMX6

Hope this will be useful for you.

Best regards!

/Carlos

0 Kudos
Reply