[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130121234158.GA9322@kroah.com>
Date: Mon, 21 Jan 2013 15:41:58 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Linus Walleij <linus.walleij@...ricsson.com>
Cc: Stephen Warren <swarren@...dia.com>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Linus Walleij <linus.walleij@...aro.org>,
Felipe Balbi <balbi@...com>, Benoit Cousson <b-cousson@...com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Mitch Bradley <wmb@...mworks.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
Rickard Andersson <rickard.andersson@...ricsson.com>,
Russell King <linux@....linux.org.uk>
Subject: Re: [PATCH v4] drivers/pinctrl: grab default handles from device core
On Mon, Jan 21, 2013 at 08:17:35PM +0100, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@...aro.org>
>
> This makes the device core auto-grab the pinctrl handle and set
> the "default" (PINCTRL_STATE_DEFAULT) state for every device
> that is present in the device model right before probe. This will
> account for the lion's share of embedded silicon devcies.
>
> A modification of the semantics for pinctrl_get() is also done:
> previously if the pinctrl handle for a certain device was already
> taken, the pinctrl core would return an error. Now, since the
> core may have already default-grabbed the handle and set its
> state to "default", if the handle was already taken, this will
> be disregarded and the located, previously instanitated handle
> will be returned to the caller.
>
> This way all code in drivers explicitly requesting their pinctrl
> handlers will still be functional, and drivers that want to
> explicitly retrieve and switch their handles can still do that.
> But if the desired functionality is just boilerplate of this
> type in the probe() function:
>
> struct pinctrl *p;
>
> p = devm_pinctrl_get_select_default(&dev);
> if (IS_ERR(p)) {
> if (PTR_ERR(p) == -EPROBE_DEFER)
> return -EPROBE_DEFER;
> dev_warn(&dev, "no pinctrl handle\n");
> }
>
> The discussion began with the addition of such boilerplate
> to the omap4 keypad driver:
> http://marc.info/?l=linux-input&m=135091157719300&w=2
>
> A previous approach using notifiers was discussed:
> http://marc.info/?l=linux-kernel&m=135263661110528&w=2
> This failed because it could not handle deferred probes.
>
> This patch alone does not solve the entire dilemma faced:
> whether code should be distributed into the drivers or
> if it should be centralized to e.g. a PM domain. But it
> solves the immediate issue of the addition of boilerplate
> to a lot of drivers that just want to grab the default
> state. As mentioned, they can later explicitly retrieve
> the handle and set different states, and this could as
> well be done by e.g. PM domains as it is only related
> to a certain struct device * pointer.
>
> Cc: Felipe Balbi <balbi@...com>
> Cc: Benoit Cousson <b-cousson@...com>
> Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
> Cc: Mitch Bradley <wmb@...mworks.com>
> Cc: Ulf Hansson <ulf.hansson@...aro.org>
> Cc: Rafael J. Wysocki <rjw@...k.pl>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
> Cc: Rickard Andersson <rickard.andersson@...ricsson.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Russell King <linux@....linux.org.uk>
> Reviewed-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Feel free to take this through your tree.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists