linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Felipe Balbi <balbi@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	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: [PATCHv2] Input: omap4-keypad: Add pinctrl support
Date: Tue, 30 Oct 2012 11:24:10 +0000	[thread overview]
Message-ID: <20121030112410.GM4511@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20121029194901.GA30152@arwen.pp.htv.fi>

[-- Attachment #1: Type: text/plain, Size: 2842 bytes --]

On Mon, Oct 29, 2012 at 09:49:01PM +0200, Felipe Balbi wrote:
> On Fri, Oct 26, 2012 at 05:03:16PM +0100, Mark Brown wrote:

> > You could have the driver explicitly set the flag, it would just be one
> > extra line, but it seems marginally nicer to just do it.

> You didn't get the whole picture I'm afraid. Consider the situation
> where the same e.g. keypad driver is being used on OMAP4 and OMAP5 and
> those have different requirements towards pinctrl.

No, I'm pretty certain that I do.

> Now, we need to add OMAP5 support *to the same keypad driver*.
> Unfortunately, OMAP5 needs to handle pinctrl explicitly for whatever
> reason (SW-controlled sleep mode, errata fix, whatever).

> This will mean that we will have to remove the flag from the keypad
> driver because that's not valid anymore for OMAP5.

This isn't a problem; either the pinctrl code for OMAP5 will do
something sensible for OMAP4 in which case there's no difference to the
resulting code or you're going to have to have conditional code for the
two devices anyway and you're no worse off.

> This is why I think hiding things from drivers makes no sense. Also
> consider the situations Linus W exposed on another subthread. If you
> change ordering of certain calls, you will really break the
> functionality of the IP. Because we can't make sure this won't work
> automagically in all cases (just like we can't make sure $size memory
> allocation is enough for all drivers) we don't hide that from the
> driver. We require driver to manage its resources properly.

We need some place to put the SoC integration; power domains seem like
the obvious place to me but YMMV.  Nothing about having this out of the
drivers requires that this be done by individual subsystems in isolation
from each other.  Half the point here is that for the reusable IPs this
stuff often isn't driver specific at all, it's often more about the SoC
integration than it is about the driver and so you'll get a consistent
pattern for most IPs on the SoC.

> How can you make sure that this will work for at least 50% of the
> drivers ? You just can't. We don't know the implementation details of
> every arch/soc/platform supported by Linux today to make that decision.

Well, we've managed to get along for rather a long time with essentially
all architectures implementing this stuff by doing static setup for the
pins on boot.  That does suggest we can get a reasonably long way with
something simple, and it does seem to match up with how things usually
look at an electrical level too.

It seems fairly obvious that if we need to add identical bolier plate
code to lots of drivers we're doing something wrong, it's just churn for
little practical gain and a problem if we ever decide to change how this
stuff works in the future.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-10-30 11:24 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 [this message]
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
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=20121030112410.GM4511@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.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=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).