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

AnilKumar, Chimata anilkumar at ti.com
Tue Oct 30 10:12:52 EDT 2012


On Wed, Oct 03, 2012 at 18:06:10, Linus Walleij wrote:
> On Wed, Oct 3, 2012 at 12:52 PM, AnilKumar, Chimata <anilkumar at ti.com> wrote:
> > On Tue, Oct 02, 2012 at 01:29:37, Linus Walleij wrote:
> 
> >> This is what we're doing for ux500 and should be a good model.
> >
> > I have looked into this, but not seen any named modes.
> 
> OK maybe it's not easy to find. If you look into:
> arch/arm/mach-ux500/board-mop500-pins.c
> you find our work in progress. Note that this is not (yet)
> using device tree. (We want to migrate all our pinctrl
> stuff first, then do DT.)
> 
> So for example this macro:
> 
> #define DB8500_PIN(pin,conf,dev) \
>         PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf)
> 
> Will define a config for the "default" mode for a certain
> pin.
> 
> This:
> 
> #define DB8500_PIN_SLEEP(pin, conf, dev) \
>         PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \
>                             pin, conf)
> 
> Will mutatis mutandis define a "sleep" mode for a pin.
> 
> Sorry for the macros. We'll get rid of them in the DT.
> (Now that Stephen has patched in preprocessing it will
> even look good.)
> 

Hi Linus Walleij/Tony,

I completely understood this named modes, I have added named
modes like this in am335x-xxx.dts files

am33xx_pinmux: pinmux at 44e10800 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&user_leds_s0>;
	pinctrl-1 = <&user_leds_s1>;

	user_leds_s0: user_leds_s0 {
		pinctrl-single,pins = <
			0x54 0x7        /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
			0x58 0x17       /* gpmc_a6.gpio1_22, OUT PULLUP | MODE7 */
			0x5c 0x7        /* gpmc_a7.gpio1_23, OUTPUT | MODE7 */
			0x60 0x17       /* gpmc_a8.gpio1_24, OUT PULLUP | MODE7 */
		>;
	};

	user_leds_s1: user_leds_s1 {
		pinctrl-single,pins = <
			0x54 0x2e       /* gpmc_a5.gpio1_21, INPUT | MODE7 */
			0x58 0x2e       /* gpmc_a6.gpio1_22, INPUT | MODE7 */
			0x5c 0x2e       /* gpmc_a7.gpio1_23, INPUT | MODE7 */
			0x60 0x2e       /* gpmc_a8.gpio1_24, INPUT | MODE7 */
		>;
	};
};

I think "pinctrl-1" state will be used in driver
suspend/resume calls.

I have the pinmux/conf settings for default state but fully
optimized pinmux/conf values in idle & suspend states are not
available yet. Even though if I add here, I am unable to test
these pins in suspend state because suspend/resume of AM35xx
is not added yet

I have two options now
- add only default states for now, I can add reset of
the state details once suspend/resume is supported. 
- add same values in all the states, modify those once
suspend/resume is added for AM335x.

Thanks
AnilKumar



More information about the linux-arm-kernel mailing list