[PATCH v2] leds: leds-gpio: adopt pinctrl support

AnilKumar, Chimata anilkumar at ti.com
Fri Sep 7 19:10:50 EST 2012


Hi Domenico,

On Fri, Sep 07, 2012 at 14:18:39, Domenico Andreoli wrote:
> On Sat, Sep 1, 2012 at 10:16 AM, AnilKumar Ch <anilkumar at ti.com> wrote:
> > Adopt pinctrl support to leds-gpio driver based on leds-gpio
> > device pointer, pinctrl driver configure SoC pins to GPIO
> > mode according to definitions provided in .dts file.
> 
> Shouldn't be the interaction with the pinctrl layer left to gpiolib?
> 

No, these gpio's are configured specifically for user leds.

So, leds-gpio driver should have this call, because these gpio
pins are used by leds-gpio driver.

+       am33xx_pinmux: pinmux at 44e10800 {
+               userled_pins: pinmux_userled_pins {
+                       pinctrl-single,pins = <
+                               0x54 0x7       
+                               0x58 0x17       
+                               0x5c 0x7        
+                               0x60 0x17       
+                       >;
+               };
+       };
+

[...]

+               leds {
+                       compatible = "gpio-leds";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&userled_pins>;
                                      ^^^^^^^^^^^^

This devm_pinctrl_get_select_default() call in leds-gpio driver
will internally take userled_pins node and configure those pins
according to the above definitions.

Lets take gpio-keypad driver, in that case we have to configure
pins as INPUT mode (generic gpio driver might not know what
the end usecase is) and this leds case we configure as OUTPUT
mode.

Thanks
AnilKumar


More information about the devicetree-discuss mailing list