AnsweredAssumed Answered

basic approach for LED interface with GPIO pins.

Question asked by Anamika Lal on Aug 12, 2015
Latest reply on Aug 14, 2015 by CarlosCasillas

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

Outcomes