devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "AnilKumar, Chimata" <anilkumar@ti.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"bryan.wu@canonical.com" <bryan.wu@canonical.com>,
	"rpurdie@rpsys.net" <rpurdie@rpsys.net>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	"dong.aisheng@linaro.org" <dong.aisheng@linaro.org>
Subject: Re: [PATCH v2] leds: leds-gpio: adopt pinctrl support
Date: Wed, 3 Oct 2012 08:53:27 -0700	[thread overview]
Message-ID: <20121003155327.GZ4840@atomide.com> (raw)
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA3F22E@DBDE01.ent.ti.com>

* AnilKumar, Chimata <anilkumar@ti.com> [121003 03:53]:
> On Tue, Oct 02, 2012 at 01:29:37, Linus Walleij wrote:
> > On Mon, Oct 1, 2012 at 5:44 PM, Tony Lindgren <tony@atomide.com> wrote:
> > 
> > >> OK that is typical pinctrl driver implementation work.
> > >> I hope Tony can advice on this?
> > >
> > > I think we're best off to just stick to alternative named modes
> > > passed from device tree. For example, for GPIO wake-ups you can
> > > have named modes such as "default", "enabled" and "idle" where
> > > "idle" muxes things for GPIO wake-ups for the duration of idle.
> > >
> 
> In this case we need to add three different values according
> to three modes (default, enabled, idle) and for each node.

Yes those make sense from the generic leds-gpio point of view
for the platforms that implement pinctrl.
 
> > > It seems that should also work for leds-gpio. And you can
> > > define more named modes as needed.
> 
> If we want to implement pinctrl_gpio functionality we have to
> separate "function-mask" bits to
> 
> 1. pinmux-mask
> 2. pinconf-mask, to make it generic we need following bit masks
> 	a. receiver enable/disable bit
> 	b. slew rate fast/slow bit
> 	c. pull-up/down bit
> 	....

Yes those can be implemented, but the problem will always be
that the driver will not know if the board is using external
pulls. If you implement the board specific settings in the .dts
file for default, enabled and idle, the leds-gpio does not need
to care if the pull is internal or external. So that seems like
a more generic way to do it.
 
> I have gone through nvidia pinctrl dt data (tegra20-seaboard.dts,
> node drive_sdio1) which has different pinconfig values, those
> are mapping to pinconf values.
> 
> With the above bit masks and function-mask we can identify
> pull-up/down, slow/high speed slew rate and direction in/out.
> 
> (or)
> 
> Named modes:-
> 
> Are you saying named modes like this?
> default-input-up
> default-input-down
> default-output-up
> default-output-down

Hmm no, you want to implement named modes that make sense
from the client driver point of view. It seems that default,
enabled and idle should do here? Then for the enabled mode
you can set the LED specific pins to whatever pull mode
you want for the board, and then leds-gpio does the rest
using the gpio framework.
 
> This 1, 2 and 2.a or named modes are required to implement
> pinctrl_gpio_direction_input/output and
> pinctrl_request/free_gpio.

I would just add the named modes to leds-gpio because 2a
does not work for the case where you use external pulls.

Regards,

Tony 

      parent reply	other threads:[~2012-10-03 15:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01  8:16 [PATCH v2] leds: leds-gpio: adopt pinctrl support AnilKumar Ch
2012-09-05  3:06 ` Bryan Wu
     [not found]   ` <CAK5ve-Jqc1xpXa0VM7=+MN1cvm=8ysg9W9WRiG66yq7GRfh+Gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-05  3:13     ` Marek Vasut
2012-09-05 23:34       ` Tony Lindgren
2012-09-06  2:05         ` Marek Vasut
2012-09-06 17:45           ` Tony Lindgren
2012-09-07  0:09             ` Marek Vasut
2012-09-07  7:59               ` AnilKumar, Chimata
2012-09-07  8:22                 ` Marek Vasut
2012-09-07 16:00                 ` Bryan Wu
2012-09-07 21:39             ` Linus Walleij
     [not found]               ` <CACRpkdYgcYAFy7bBn3XNcrkSoCpeA8yNaa9LZNd4w33Zp3Jjnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-07 21:46                 ` Tony Lindgren
     [not found] ` <1346487390-11399-1-git-send-email-anilkumar-l0cyMroinI0@public.gmane.org>
2012-09-07  8:48   ` Domenico Andreoli
2012-09-07  9:10     ` AnilKumar, Chimata
2012-09-07 11:02       ` Domenico Andreoli
2012-09-07 14:30         ` AnilKumar, Chimata
     [not found]           ` <331ABD5ECB02734CA317220B2BBEABC13EA29BF3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-09-07 16:00             ` Domenico Andreoli
2012-09-07 16:35               ` Tony Lindgren
2012-09-07 21:59                 ` Linus Walleij
2012-09-07 21:57               ` Linus Walleij
     [not found]                 ` <CACRpkdbz7CQtaj9e-1kcRVszpCSoqKz=19YT68sTMF9SOyWa8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-08 23:44                   ` Domenico Andreoli
2012-09-10 15:23                     ` Linus Walleij
2012-09-10 17:41                       ` Stephen Warren
2012-09-10 19:34                         ` Linus Walleij
2012-09-10 19:44                           ` Stephen Warren
2012-09-07 21:36 ` Linus Walleij
2012-09-10 19:40 ` Linus Walleij
     [not found]   ` <CACRpkdbSY-aH_Vf3Q4h-ufz35m6=vVXCEecGGS-WOsG7vmPZ0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-01  7:03     ` AnilKumar, Chimata
2012-10-01  8:24       ` Linus Walleij
2012-10-01 15:44         ` Tony Lindgren
2012-10-01 19:59           ` Linus Walleij
     [not found]             ` <CACRpkdaib2M1_UwSbyUG8qwZC2h7xaT5VU7WMj=y+h4S4LianQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-03 10:52               ` AnilKumar, Chimata
     [not found]                 ` <331ABD5ECB02734CA317220B2BBEABC13EA3F22E-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-10-03 12:36                   ` Linus Walleij
2012-10-30 14:12                     ` AnilKumar, Chimata
2012-11-04 17:37                       ` Linus Walleij
2012-11-05  6:44                         ` AnilKumar, Chimata
2012-11-05 16:27                         ` Tony Lindgren
2012-10-03 15:53                 ` Tony Lindgren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121003155327.GZ4840@atomide.com \
    --to=tony@atomide.com \
    --cc=anilkumar@ti.com \
    --cc=bryan.wu@canonical.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dong.aisheng@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=swarren@wwwdotorg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).