linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org, Stephen Warren <swarren@nvidia.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Barry Song <21cnbao@gmail.com>,
	Shawn Guo <shawn.guo@freescale.com>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Rajendra Nayak <rajendra.nayak@linaro.org>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: Re: [PATCH v6] pinctrl: add a pin config interface
Date: Fri, 20 Jan 2012 21:29:18 +0530	[thread overview]
Message-ID: <CAJuYYwRar17+nmqOywd=Yyf=shFQnL4R_jz6Lhk8=RrcdCovLA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdYwx3O42aC8F+DMV1GL0ce62ZhChOQYdbd7-syunsgBOg@mail.gmail.com>

Hi Linus,

On 19 January 2012 23:58, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Jan 19, 2012 at 6:55 PM, Thomas Abraham
> <thomas.abraham@linaro.org> wrote:
>> Hi Linus,
>> On 19 January 2012 22:28, Linus Walleij <linus.walleij@linaro.org> wrote:
>>> On Wed, Jan 18, 2012 at 8:16 AM, Thomas Abraham
>>> <thomas.abraham@linaro.org> wrote:
>>>
>>>> In case of runtime pinmuxing, the pin configuration would also be
>>>> required to be setup in some cases. pin_config_set() is suitable to be
>>>> called from the platform code. In case of runtime pinmuxing in driver
>>>> code, is there any way to set the pin config also at runtime in driver
>>>> code?
>>>
>>> Yes that is already possible today with the pin_config_set() and
>>> pin_config_group_set() calls already merged for 3.3.
>>>
>>> However there is no relation between the struct device and these
>>> config settings so I feel that this is a bit hack-ish, but it was
>>> atleast something we could agree upon.
>>
>> Using pin_config_set() from drivers did not seem correct. The concern
>> here is that all there parameters of pin_config_set() are specific to
>> a particular platform. Hence, using it in driver means that the driver
>> will no more be usable across multiple different platforms.
>
> Yes. But drivers can define a callback function into their
> platform data, which in turn has the knowledge of what to do
> for different scenarios, and calls pin_config_set() on the
> pin controller for that system.
>
> But no, it's not elegant :-)

Ok. platform_data is a possibility. So for non-dt driver probe, the
driver would call the platform callback and for dt based driver probe,
we still need to find a suitable way.

>
>> But that was not the case with pinmux_get() and pinmux_put().
>
> True. pinmuxes are completely platform agnostic...
>
> What would be elegant?
>
> pinconf_get() + pinconf_put() doesn't seem right since
> configs are not simple "on or off" states.
>
> So we need something like the named config states, but
> mapped down per device.
>
> How about a driver does this:
>
> ret = pinconf_activate(&dev, "foo");
>
> Where "foo" is a state string like "active", "idle", "sleep",
> "off" and could correspons to preset strings in pinconf.h
> like those found in the other patch

Yes, the ability to set the pinconfig from the driver would be very
helpful for Samsung platforms.


> "[PATCH] pinctrl: pin configuration states" I sent out
> two days ago?
>
> Then we can have both system-wide and per-device
> mapped pin configuration states named by strings.

Ok. Support for both would be nice to have.

>
> Note that pinconf_get()/pinconf_put() is completely
> superfluous in this scheme. Since the configurations are
> stateless settings (not e.g. allocating pins) this is all fine.
>
> Passing the string with a named config indicates that
> the driver knows exactly what it is doing anyway.
>
> Shall I recook pin configuration states like this for
> a try?

Yes, that will be very helpful. Thanks.

It would be easier if pinconf_register_pin_states() need not be called
for each pin state instance. There should be something similar to the
existing pinmux configuration where is no need to explicitly register
a pinmux.

Regards,
Thomas.

>
>> Will
>> there be support added in pinctrl subsystem to allow drivers to
>> configure pin-config settings from drivers and be compatible for
>> multiple platforms?
>
> Please provide feedback on my patch entitled:
> "[PATCH 2/2 v5] pinctrl: introduce generic pin config"
>
> If I get a few ACKs for something like that we have the
> infrastructure for letting drivers config their pins.
>
> Yours,
> Linus Walleij

      parent reply	other threads:[~2012-01-20 15:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 11:57 [PATCH v6] pinctrl: add a pin config interface Linus Walleij
2011-12-12  6:19 ` Haojian Zhuang
2011-12-13  0:22   ` Linus Walleij
2011-12-13  7:21     ` Haojian Zhuang
2011-12-13 12:23       ` Linus Walleij
2011-12-13 21:49       ` Stephen Warren
2011-12-13 22:56         ` Linus Walleij
2011-12-12 10:56 ` Domenico Andreoli
2011-12-13 12:19   ` Linus Walleij
2011-12-14  7:04 ` Chanho Park
2011-12-14  9:05   ` Linus Walleij
2011-12-14 15:44     ` Stephen Warren
2011-12-14 19:37       ` Linus Walleij
2012-01-18  7:16 ` Thomas Abraham
2012-01-19 16:58   ` Linus Walleij
2012-01-19 18:14     ` Thomas Abraham
     [not found]     ` <CAJuYYwTP8a4KYDrJ2o9Wmt4jo_DvLviy75T90JnV7Hw10Y+ZXw@mail.gmail.com>
     [not found]       ` <CACRpkdYwx3O42aC8F+DMV1GL0ce62ZhChOQYdbd7-syunsgBOg@mail.gmail.com>
2012-01-20 15:59         ` Thomas Abraham [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='CAJuYYwRar17+nmqOywd=Yyf=shFQnL4R_jz6Lhk8=RrcdCovLA@mail.gmail.com' \
    --to=thomas.abraham@linaro.org \
    --cc=21cnbao@gmail.com \
    --cc=dong.aisheng@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@marvell.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajendra.nayak@linaro.org \
    --cc=shawn.guo@freescale.com \
    --cc=swarren@nvidia.com \
    /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).