devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Felipe Balbi <balbi@ti.com>, Benoit Cousson <b-cousson@ti.com>,
	Sourav Poddar <sourav.poddar@ti.com>,
	tony@atomide.com, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	linux-input@vger.kernel.org
Subject: Re: Fwd: [PATCHv2] Input: omap4-keypad: Add pinctrl support
Date: Thu, 01 Nov 2012 12:42:21 +0100	[thread overview]
Message-ID: <874nl9tuqq.fsf@deeprootsystems.com> (raw)
In-Reply-To: <CACRpkdaBmg7wtX0WsaxMw=n1sKDN5YphK=y8tzAx_CF=JnUqvw@mail.gmail.com> (Linus Walleij's message of "Thu, 1 Nov 2012 09:56:48 +0100")

Linus Walleij <linus.walleij@linaro.org> writes:

> On Wed, Oct 31, 2012 at 9:10 PM, Kevin Hilman
> <khilman@deeprootsystems.com> wrote:
>
>> Linus Walleij <linus.walleij@linaro.org> writes:
>
>
>>
>> > piece of hardware, this would be the right thing to do,
>> > and I think the in-kernel examples are all "simple",
>> > e.g. arch/arm/mach-omap2/powerdomain* is all about
>> > power domains and nothing else,
>>
>> FYI... that code isn't the same as PM domain.
>
>
> This sort of points to a core problem here. Our terminologies are
> ambiguous that we cannot understand each others code. As long
> as <linux/pm_domain.h> begins:
>
> /*
>  * pm_domain.h - Definitions and headers related to device power domains.
>  *
>
> But arguably that should just be patched (I think there are a few
> remnants in the code still implying that these things are only about
> power).

Agreed.  The terminology is confusing, and any situations like this in
the code/comments/docs should be patched.

When PM domains were introduced, I was the first to complain that we
shouldn't use the term power domain so as not to be confused with HW
concepts, so we settled on the term 'PM domain.'  Ultimately, it's just
a configurable grouping of devices whose callbacks happen during PM
transitions.

>>
>>  That code is for the
>> *hardware* powerdomains, not the software concept of "PM domain."  In
>> OMAP, PM domain is implmented at the omap_device level.  And omap_device
>> is the abstraction of an IP block that knows about all the PM related
>> register settings, clocks, HW powerdomain, voltage domain, PM related
>> pin-muxing etc. etc.    All of these things are abstracted in an
>> omap_device, so that the PM domain implementation for OMAP looks rather
>> simple (c.f. omap_device_pm_domain in arch/arm/plat-omap/omap_device.c.)
>
>
> OK following now...
>
>>
>> > I think the lesser of two evils is the distributed approach,
>>
>> The pinctrl examples I've seen mentioned so far are all PM related
>>
>> (sleep, idle, wakeup, etc.) so to me I think they still belong in
>> PM domains (and that's how we handle the PM related pins in OMAP.)
>
>
> Well, the pinctrl grabbers in these drivers are using these states also
> for platforms that do not even select CONFIG_PM.  For example
> mach-nomadik is quite happy that the PL011 driver is thusly
> muxing in its pins. And would require refactoring to use PM
> domains.

If CONFIG_PM is disabled, then is it safe to assume that the pins in
question are probably only done once at init time.  I assume during
->probe(). ?

>
> So basically this requirement comes down to:
>
> - When dealing with a SoC IP block driver
>
> - That need to multiplex pins
>
> - Then your SoC must select CONFIG_PM and
>   CONFIG_PM_RUNTIME andb
>   CONFIG_PM_GENERIC_DOMAINS and implement
>   proper domain handling hooks.
>
> Is this correct? 

I would say yes.  Currently, PM domains are the way to hook SoC-specific
integration details into PM transitions.

However, if what we want/need are only ways to introduce SoC-specific
integration details into non-PM transitions (e.g. probe/remove), maybe
bus notifiers would suffice here.  e.g. you'd get a bus notifier when
the device is added/attached and any init-time pinctrl setup could be
done then.  This still keeps drivers clean of SoC-specific integration
data/code, and also allows that to happen whether or not PM features are
enabled.

Kevin

  reply	other threads:[~2012-11-01 11:42 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 13:13 [PATCHv2] Input: omap4-keypad: Add pinctrl support Sourav Poddar
2012-10-22 15:50 ` Dmitry Torokhov
2012-10-23  9:13   ` Linus Walleij
2012-10-23  9:35     ` Benoit Cousson
2012-10-23 10:04       ` Linus Walleij
2012-10-23 10:03         ` Felipe Balbi
2012-10-23 10:23           ` Thomas Petazzoni
2012-10-23 10:29             ` Linus Walleij
2012-10-23 10:29               ` Felipe Balbi
2012-10-23 10:45                 ` Linus Walleij
2012-10-23 10:42                   ` Felipe Balbi
2012-10-23 11:11                   ` Thomas Petazzoni
2012-10-23 17:02           ` Mitch Bradley
2012-10-23 17:20             ` Felipe Balbi
2012-10-23 17:51               ` Mitch Bradley
     [not found]                 ` <5086D91A.5080109-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2012-10-23 17:51                   ` Felipe Balbi
     [not found]   ` <20121022155028.GA13791-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-23  9:18     ` Benoit Cousson
2012-10-23 20:02       ` Dmitry Torokhov
     [not found]         ` <20121023200249.GA2712-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-24  8:37           ` Felipe Balbi
2012-10-24 16:14             ` Dmitry Torokhov
2012-10-24 16:51               ` Linus Walleij
2012-10-24 17:28                 ` Dmitry Torokhov
2012-10-24 18:58                   ` Felipe Balbi
     [not found]                     ` <20121024185818.GB772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-25 20:59                       ` Mark Brown
2012-10-26  6:20                         ` Felipe Balbi
2012-10-26 16:03                           ` Mark Brown
2012-10-29 19:49                             ` Felipe Balbi
2012-10-30 11:24                               ` Mark Brown
2012-10-30 11:49                                 ` Felipe Balbi
2012-10-30 14:07                                   ` Mark Brown
2012-10-30 14:16                                     ` Linus Walleij
2012-10-30 14:54                                       ` Mark Brown
2012-10-30 15:16                                     ` Felipe Balbi
2012-10-30 15:58                                       ` Mark Brown
2012-10-30 17:25                                         ` Felipe Balbi
2012-10-30 18:20                                           ` Dmitry Torokhov
2012-10-30 18:48                                             ` Felipe Balbi
2012-10-30 18:37                                           ` Mark Brown
2012-10-30 21:51                                             ` Linus Walleij
2012-10-30 22:57                                               ` Rafael J. Wysocki
2012-11-02 18:26                                               ` Mark Brown
2012-10-30 14:11                                   ` Linus Walleij
2012-10-28 20:12                   ` Linus Walleij
     [not found]                     ` <CACRpkdaiLXVeUg1quuw3XPTenbKOjn+aWbGQezpcyvzQCtCWow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-30 11:34                       ` Mark Brown
2012-10-30 14:02                         ` Linus Walleij
2012-10-30 14:37                           ` Mark Brown
2012-10-31 20:10                           ` Kevin Hilman
     [not found]                             ` <87obji8kta.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2012-11-01  8:54                               ` Linus Walleij
2012-11-01  8:56                                 ` Fwd: " Linus Walleij
2012-11-01 11:42                                   ` Kevin Hilman [this message]
2012-11-01 13:22                                     ` Linus Walleij
2012-11-01 12:07                                 ` Mark Brown
2012-11-01 14:01                                   ` Linus Walleij
2012-11-01 14:19                                     ` Mark Brown
2012-11-11 12:32                                     ` Linus Walleij
2012-10-31 13:19                     ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]               ` <20121024161429.GA16350-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-10-24 16:52                 ` Felipe Balbi
2012-10-24 17:13                   ` Linus Walleij
2012-10-24 17:34                   ` Dmitry Torokhov
2012-10-24 17:46               ` Benoit Cousson
2012-10-24 12:54         ` Linus Walleij
2012-10-24 16:18           ` Dmitry Torokhov
2012-10-24 16:57             ` Felipe Balbi
2012-10-24 17:18               ` Linus Walleij
2012-10-24 17:58               ` Dmitry Torokhov
2012-10-24 19:10                 ` Felipe Balbi
     [not found]                   ` <20121024191042.GC772-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-10-24 19:38                     ` Dmitry Torokhov
2012-10-24 19:51                       ` Felipe Balbi
2012-10-24 17:01             ` Linus Walleij

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=874nl9tuqq.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=arnd@arndb.de \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=sourav.poddar@ti.com \
    --cc=tony@atomide.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).