basic approach for LED interface with GPIO pins.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

basic approach for LED interface with GPIO pins.

2,304 次查看
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

标签 (3)
标记 (1)
0 项奖励
回复
1 回复

1,258 次查看
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 项奖励
回复