Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-11 Thread Linus Walleij
On Thu, Nov 1, 2012 at 3:01 PM, Linus Walleij wrote: > On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown > wrote: >> On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: > >> For the pin hogging I'd actually been thinking separately that we should >> just have the device core do a

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-11 Thread Linus Walleij
On Thu, Nov 1, 2012 at 3:01 PM, Linus Walleij linus.wall...@linaro.org wrote: On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: For the pin hogging I'd actually been thinking separately that we

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-02 Thread Mark Brown
On Tue, Oct 30, 2012 at 10:51:11PM +0100, Linus Walleij wrote: > On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown > > More seriously the amount of time we seem to have been spending recently > > on changes which end up requiring us to go through essentially every > > driver and add code to them (often

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-02 Thread Mark Brown
On Tue, Oct 30, 2012 at 10:51:11PM +0100, Linus Walleij wrote: On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown More seriously the amount of time we seem to have been spending recently on changes which end up requiring us to go through essentially every driver and add code to them (often

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Mark Brown
On Thu, Nov 01, 2012 at 03:01:28PM +0100, Linus Walleij wrote: > On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown > > > For the pin hogging I'd actually been thinking separately that we should > > just have the device core do a devm_pinctrl_get_set_default() prior to > > probing the device and store

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Linus Walleij
On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown wrote: > On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: > For the pin hogging I'd actually been thinking separately that we should > just have the device core do a devm_pinctrl_get_set_default() prior to > probing the device and store

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Mark Brown
On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: > 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

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Mark Brown
On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: 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

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Linus Walleij
On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Thu, Nov 01, 2012 at 09:54:00AM +0100, Linus Walleij wrote: For the pin hogging I'd actually been thinking separately that we should just have the device core do a devm_pinctrl_get_set_default() prior to

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-11-01 Thread Mark Brown
On Thu, Nov 01, 2012 at 03:01:28PM +0100, Linus Walleij wrote: On Thu, Nov 1, 2012 at 1:07 PM, Mark Brown For the pin hogging I'd actually been thinking separately that we should just have the device core do a devm_pinctrl_get_set_default() prior to probing the device and store the result

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-31 Thread Kevin Hilman
Linus Walleij writes: > On Tue, Oct 30, 2012 at 12:34 PM, Mark Brown > wrote: >> On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: > >>> Moving this handling to bus code or anywhere else >>> invariably implies that resource acquisition/release order >>> does not matter, and my

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-31 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:12 Sun 28 Oct , Linus Walleij wrote: > On Wed, Oct 24, 2012 at 7:28 PM, Dmitry Torokhov > wrote: > > >> drivers/spi/spi-pl022.c > > > > Default/sleep transitions could be moved into bus code. > > No that's not a good idea as long as we have both the platform bus > and the AMBA bus

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-31 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:12 Sun 28 Oct , Linus Walleij wrote: On Wed, Oct 24, 2012 at 7:28 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: drivers/spi/spi-pl022.c Default/sleep transitions could be moved into bus code. No that's not a good idea as long as we have both the platform bus and the

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-31 Thread Kevin Hilman
Linus Walleij linus.wall...@linaro.org writes: On Tue, Oct 30, 2012 at 12:34 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: Moving this handling to bus code or anywhere else invariably implies that resource

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Rafael J. Wysocki
On Tuesday, October 30, 2012 10:51:11 PM Linus Walleij wrote: > On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown > wrote: > > > More seriously the amount of time we seem to have been spending recently > > on changes which end up requiring us to go through essentially every > > driver and add code to

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown wrote: > More seriously the amount of time we seem to have been spending recently > on changes which end up requiring us to go through essentially every > driver and add code to them (often several times) doesn't seem like > we're doing a good job

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 11:20:07AM -0700, Dmitry Torokhov wrote: > On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: > > On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: > > > > > > But then this comes round to the mindless code that ought to be factored > > > out :)

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: > On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: > > But then this comes round to the mindless code that ought to be factored > > out :) Only the more interesting cases that do something unusual really > > register here.

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Dmitry Torokhov
On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: > On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: > > > > But then this comes round to the mindless code that ought to be factored > > out :) Only the more interesting cases that do something unusual really > > register

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: > > > > and this is one of the issues we're all trying to solve today so we have > > > > single zImage approach for the ARM port. > > > > I don't see the relevance of single zImage here; device tree is supposed > > > to solve that

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 05:16:42PM +0200, Felipe Balbi wrote: > On Tue, Oct 30, 2012 at 02:07:15PM +, Mark Brown wrote: > > > and all of that SoC-specific detail is already hidden behind power > > > domains, runtime PM, pinctrl, clk API, regulator framework, etc. > > That's all getting

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 02:07:15PM +, Mark Brown wrote: > On Tue, Oct 30, 2012 at 01:49:49PM +0200, Felipe Balbi wrote: > > On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: > > > > We need some place to put the SoC integration; power domains seem like > > > the obvious place

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 03:16:02PM +0100, Linus Walleij wrote: > On Tue, Oct 30, 2012 at 3:07 PM, Mark Brown > > Essentially all the patches I'm seeing adding pinctrl are totally > > mindless, most of them are just doing the initial setup on boot and not > > doing any active management at runtime

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 03:02:23PM +0100, Linus Walleij wrote: > I worry that we will end up with power/resource domain > code that start to look like this: > suspend() > switch (device.id) { > case DEV_FOO: > clk_disable(); > pinctrl_set_state(); > power_domain_off(); > case DEV_BAR:

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 3:07 PM, Mark Brown wrote: > Essentially all the patches I'm seeing adding pinctrl are totally > mindless, most of them are just doing the initial setup on boot and not > doing any active management at runtime at all. None of the Ux500 pinctrl patches are like that. I

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 12:49 PM, Felipe Balbi wrote: > On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: >> 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 > > except that pin muxing has

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 01:49:49PM +0200, Felipe Balbi wrote: > On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: > > 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 > except that pin

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 12:34 PM, Mark Brown wrote: > On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: >> Moving this handling to bus code or anywhere else >> invariably implies that resource acquisition/release order >> does not matter, and my point is that it does. > > Doing this

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: > > 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

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: > The answer is that it does not know. Because drivers have > different needs. Depending on how the hardware and > system is done. ... > I'm not making this up, it is a very real phenomenon on the > Ux500 and I don't think we are

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
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

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
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

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: The answer is that it does not know. Because drivers have different needs. Depending on how the hardware and system is done. ... I'm not making this up, it is a very real phenomenon on the Ux500 and I don't think we are unique.

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: 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.

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 12:34 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Sun, Oct 28, 2012 at 09:12:52PM +0100, Linus Walleij wrote: Moving this handling to bus code or anywhere else invariably implies that resource acquisition/release order does not matter, and my point is

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 01:49:49PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: 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 except that pin muxing

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 12:49 PM, Felipe Balbi ba...@ti.com wrote: On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: 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 except that pin muxing

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 3:07 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: Essentially all the patches I'm seeing adding pinctrl are totally mindless, most of them are just doing the initial setup on boot and not doing any active management at runtime at all. None of the Ux500

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 03:02:23PM +0100, Linus Walleij wrote: I worry that we will end up with power/resource domain code that start to look like this: suspend() switch (device.id) { case DEV_FOO: clk_disable(); pinctrl_set_state(); power_domain_off(); case DEV_BAR: Well, if

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 03:16:02PM +0100, Linus Walleij wrote: On Tue, Oct 30, 2012 at 3:07 PM, Mark Brown Essentially all the patches I'm seeing adding pinctrl are totally mindless, most of them are just doing the initial setup on boot and not doing any active management at runtime at

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 02:07:15PM +, Mark Brown wrote: On Tue, Oct 30, 2012 at 01:49:49PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 11:24:10AM +, Mark Brown wrote: We need some place to put the SoC integration; power domains seem like the obvious place to me but

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 05:16:42PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 02:07:15PM +, Mark Brown wrote: and all of that SoC-specific detail is already hidden behind power domains, runtime PM, pinctrl, clk API, regulator framework, etc. That's all getting rather open

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: and this is one of the issues we're all trying to solve today so we have single zImage approach for the ARM port. I don't see the relevance of single zImage here; device tree is supposed to solve that one. DT is

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Dmitry Torokhov
On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: But then this comes round to the mindless code that ought to be factored out :) Only the more interesting cases that do something unusual really register here.

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Mark Brown
On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: But then this comes round to the mindless code that ought to be factored out :) Only the more interesting cases that do something unusual really register here. fair

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Felipe Balbi
Hi, On Tue, Oct 30, 2012 at 11:20:07AM -0700, Dmitry Torokhov wrote: On Tue, Oct 30, 2012 at 07:25:13PM +0200, Felipe Balbi wrote: On Tue, Oct 30, 2012 at 03:58:21PM +, Mark Brown wrote: But then this comes round to the mindless code that ought to be factored out :) Only the

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Linus Walleij
On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: More seriously the amount of time we seem to have been spending recently on changes which end up requiring us to go through essentially every driver and add code to them (often several times) doesn't seem

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-30 Thread Rafael J. Wysocki
On Tuesday, October 30, 2012 10:51:11 PM Linus Walleij wrote: On Tue, Oct 30, 2012 at 7:37 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: More seriously the amount of time we seem to have been spending recently on changes which end up requiring us to go through essentially every

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-29 Thread Felipe Balbi
Hi, On Fri, Oct 26, 2012 at 05:03:16PM +0100, Mark Brown wrote: > On Fri, Oct 26, 2012 at 09:20:36AM +0300, Felipe Balbi wrote: > > On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: > > > > I suspect that's not actually a big deal and that if we went down this > > > route we'd have the

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-29 Thread Felipe Balbi
Hi, On Fri, Oct 26, 2012 at 05:03:16PM +0100, Mark Brown wrote: On Fri, Oct 26, 2012 at 09:20:36AM +0300, Felipe Balbi wrote: On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: I suspect that's not actually a big deal and that if we went down this route we'd have the driver

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-28 Thread Linus Walleij
On Wed, Oct 24, 2012 at 7:28 PM, Dmitry Torokhov wrote: >> drivers/spi/spi-pl022.c > > Default/sleep transitions could be moved into bus code. No that's not a good idea as long as we have both the platform bus and the AMBA bus doing essentially the same thing. We will then be having two copies

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-28 Thread Linus Walleij
On Wed, Oct 24, 2012 at 7:28 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: drivers/spi/spi-pl022.c Default/sleep transitions could be moved into bus code. No that's not a good idea as long as we have both the platform bus and the AMBA bus doing essentially the same thing. We will then

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-26 Thread Mark Brown
On Fri, Oct 26, 2012 at 09:20:36AM +0300, Felipe Balbi wrote: > On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: > > I suspect that's not actually a big deal and that if we went down this > > route we'd have the driver take over control from the core code during > > probe() with the

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-26 Thread Felipe Balbi
Hi, On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: > On Wed, Oct 24, 2012 at 09:58:19PM +0300, Felipe Balbi wrote: > > > need a way to tell drivers/base "hey, don't touch pinctrl at all because > > I know what I'm doing" and that has to happen before probe() too, > > otherwise it's

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-26 Thread Felipe Balbi
Hi, On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: On Wed, Oct 24, 2012 at 09:58:19PM +0300, Felipe Balbi wrote: need a way to tell drivers/base hey, don't touch pinctrl at all because I know what I'm doing and that has to happen before probe() too, otherwise it's already

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-26 Thread Mark Brown
On Fri, Oct 26, 2012 at 09:20:36AM +0300, Felipe Balbi wrote: On Thu, Oct 25, 2012 at 09:59:01PM +0100, Mark Brown wrote: I suspect that's not actually a big deal and that if we went down this route we'd have the driver take over control from the core code during probe() with the core

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-25 Thread Mark Brown
On Wed, Oct 24, 2012 at 09:58:19PM +0300, Felipe Balbi wrote: > need a way to tell drivers/base "hey, don't touch pinctrl at all because > I know what I'm doing" and that has to happen before probe() too, > otherwise it's already too late and, according to what you suggest, > drivers/base will

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-25 Thread Mark Brown
On Wed, Oct 24, 2012 at 09:58:19PM +0300, Felipe Balbi wrote: need a way to tell drivers/base hey, don't touch pinctrl at all because I know what I'm doing and that has to happen before probe() too, otherwise it's already too late and, according to what you suggest, drivers/base will already

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 12:38:44PM -0700, Dmitry Torokhov wrote: > On Wednesday, October 24, 2012 10:10:42 PM Felipe Balbi wrote: > > > > > > > > > That is a valid concern and we'll need to find a compromise here. As I > > > said, > > WHAT ?? Silicon erratas are not a valid concern ? Power

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 10:10:42 PM Felipe Balbi wrote: > > > > > > That is a valid concern and we'll need to find a compromise here. As I > > said, > WHAT ?? Silicon erratas are not a valid concern ? Power waste isn't a > valid concern ? Tell that to the millions of devices shipped with

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 10:58:53AM -0700, Dmitry Torokhov wrote: > On Wednesday, October 24, 2012 07:57:49 PM Felipe Balbi wrote: > > Hi, > > > > On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: > > > On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: > > > > On

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 10:28:46AM -0700, Dmitry Torokhov wrote: > > for more complex pinctrl use cases. These are my dogfood drivers ... > > Most of these will request more than one state and switch the driver > > between these different states at runtime, in these examples for power > >

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 07:57:49 PM Felipe Balbi wrote: > Hi, > > On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: > > On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: > > > On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov > > > > > > wrote: > > > > I have

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Benoit Cousson
Hi Dmitry, On 10/24/2012 06:14 PM, Dmitry Torokhov wrote: > On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: >> Hi, >> >> On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: >>> On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: Hi Dimitry, On

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 07:52:16 PM Felipe Balbi wrote: > Hi, > > On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: > > > > > > > No, I guess we ihave different understanding of what "directly use" > > > > means. > > > > This particular driver does directly use

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 06:51:47 PM Linus Walleij wrote: > On Wed, Oct 24, 2012 at 6:14 PM, Dmitry Torokhov > > wrote: > > On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: > >> - we ask another layer to allocate memory for us > >> - we ask another layer to call our ISR once

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:57 PM, Felipe Balbi wrote: > On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: >> OK, so with drivers/base/, have you considered doing default pinctrl >> selection in bus's probe() methods? Yo would select the default >> configuration before starting

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:52 PM, Felipe Balbi wrote: > On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: >> All of _their_ resources, exactly. They do not own nor control pins so >> they should not be bothered with them either. Look, when you see that > > except that they *own*

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: > On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: > > On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov > > wrote: > > > > > I have seen just in a few days 3 or 4 drivers having exactly the same > > > change -

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:18 PM, Dmitry Torokhov wrote: > On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: >> >> A third alternative as outlined is to use notifiers and some >> resource core in drivers/base/* > > OK, so with drivers/base/, have you considered doing default pinctrl >

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: > > > No, I guess we ihave different understanding of what "directly use" means. > > > This particular driver does directly use interrupts: it requests it and > > > performs some actions when interrupt arrives. Same goes for

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:14 PM, Dmitry Torokhov wrote: > On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: >> - we ask another layer to allocate memory for us >> - we ask another layer to call our ISR once the IRQ line is asserted >> - we ask another layer to handle the input events

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: > On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov > wrote: > > > I have seen just in a few days 3 or 4 drivers having exactly the same > > change - call to devm_pinctrl_get_select_default(), and I guess I will > > receive the same

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: > Hi, > > On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: > > On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: > > > Hi Dimitry, > > > > > > On 10/22/2012 05:50 PM, Dmitry Torokhov wrote: > > > > Hi

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov wrote: > I have seen just in a few days 3 or 4 drivers having exactly the same > change - call to devm_pinctrl_get_select_default(), and I guess I will > receive the same patches for the rest of input drivers shortly. > This suggests that the

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: > On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: > > Hi Dimitry, > > > > On 10/22/2012 05:50 PM, Dmitry Torokhov wrote: > > > Hi Sourav, > > > > > > On Mon, Oct 22, 2012 at 06:43:00PM +0530, Sourav Poddar

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: Hi Dimitry, On 10/22/2012 05:50 PM, Dmitry Torokhov wrote: Hi Sourav, On Mon, Oct 22, 2012 at 06:43:00PM +0530, Sourav Poddar wrote: Adapt

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: I have seen just in a few days 3 or 4 drivers having exactly the same change - call to devm_pinctrl_get_select_default(), and I guess I will receive the same patches for the rest of input drivers shortly. This

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: Hi, On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: Hi Dimitry, On 10/22/2012 05:50 PM, Dmitry Torokhov wrote: Hi Sourav, On

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: I have seen just in a few days 3 or 4 drivers having exactly the same change - call to devm_pinctrl_get_select_default(), and I guess I will

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:14 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: - we ask another layer to allocate memory for us - we ask another layer to call our ISR once the IRQ line is asserted - we ask another layer to

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: snip No, I guess we ihave different understanding of what directly use means. This particular driver does directly use interrupts: it requests it and performs some actions when interrupt arrives. Same goes for IO

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:18 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: A third alternative as outlined is to use notifiers and some resource core in drivers/base/* OK, so with drivers/base/, have you considered doing

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: I have seen just in a few days 3 or 4 drivers having exactly the same

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:52 PM, Felipe Balbi ba...@ti.com wrote: On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: All of _their_ resources, exactly. They do not own nor control pins so they should not be bothered with them either. Look, when you see that except that they

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Linus Walleij
On Wed, Oct 24, 2012 at 6:57 PM, Felipe Balbi ba...@ti.com wrote: On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: OK, so with drivers/base/, have you considered doing default pinctrl selection in bus's probe() methods? Yo would select the default configuration before starting

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 06:51:47 PM Linus Walleij wrote: On Wed, Oct 24, 2012 at 6:14 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: - we ask another layer to allocate memory for us - we ask another layer to call

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 07:52:16 PM Felipe Balbi wrote: Hi, On Wed, Oct 24, 2012 at 09:14:29AM -0700, Dmitry Torokhov wrote: snip No, I guess we ihave different understanding of what directly use means. This particular driver does directly use interrupts: it requests it

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Benoit Cousson
Hi Dmitry, On 10/24/2012 06:14 PM, Dmitry Torokhov wrote: On Wed, Oct 24, 2012 at 11:37:04AM +0300, Felipe Balbi wrote: Hi, On Tue, Oct 23, 2012 at 01:02:49PM -0700, Dmitry Torokhov wrote: On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: Hi Dimitry, On 10/22/2012 05:50 PM,

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 07:57:49 PM Felipe Balbi wrote: Hi, On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: On Tue, Oct 23, 2012 at 10:02 PM, Dmitry Torokhov dmitry.torok...@gmail.com wrote:

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 10:28:46AM -0700, Dmitry Torokhov wrote: for more complex pinctrl use cases. These are my dogfood drivers ... Most of these will request more than one state and switch the driver between these different states at runtime, in these examples for power saving

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 10:58:53AM -0700, Dmitry Torokhov wrote: On Wednesday, October 24, 2012 07:57:49 PM Felipe Balbi wrote: Hi, On Wed, Oct 24, 2012 at 09:18:01AM -0700, Dmitry Torokhov wrote: On Wed, Oct 24, 2012 at 02:54:23PM +0200, Linus Walleij wrote: On Tue, Oct 23,

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Dmitry Torokhov
On Wednesday, October 24, 2012 10:10:42 PM Felipe Balbi wrote: That is a valid concern and we'll need to find a compromise here. As I said, WHAT ?? Silicon erratas are not a valid concern ? Power waste isn't a valid concern ? Tell that to the millions of devices shipped with Linux

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-24 Thread Felipe Balbi
Hi, On Wed, Oct 24, 2012 at 12:38:44PM -0700, Dmitry Torokhov wrote: On Wednesday, October 24, 2012 10:10:42 PM Felipe Balbi wrote: That is a valid concern and we'll need to find a compromise here. As I said, WHAT ?? Silicon erratas are not a valid concern ? Power waste isn't a

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Dmitry Torokhov
On Tue, Oct 23, 2012 at 11:18:12AM +0200, Benoit Cousson wrote: > Hi Dimitry, > > On 10/22/2012 05:50 PM, Dmitry Torokhov wrote: > > Hi Sourav, > > > > On Mon, Oct 22, 2012 at 06:43:00PM +0530, Sourav Poddar wrote: > >> Adapt keypad to use pinctrl framework. > >> > >> Tested on omap4430 sdp with

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Felipe Balbi
Hi, (please don't top-post) On Tue, Oct 23, 2012 at 07:51:22AM -1000, Mitch Bradley wrote: > Perhaps I misunderstood what you were suggesting. I thought that, when > you said "explicitly manage all their resources", you meant that the > driver should know the platform-specific details about

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Mitch Bradley
Perhaps I misunderstood what you were suggesting. I thought that, when you said "explicitly manage all their resources", you meant that the driver should know the platform-specific details about clocks and power domains. That is one possible interpretation of the word "explicit". Now I see that

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Felipe Balbi
HI, On Tue, Oct 23, 2012 at 07:02:09AM -1000, Mitch Bradley wrote: > On 10/23/2012 12:03 AM, Felipe Balbi wrote: > > Hi, > > > > I much prefer having drivers explicitly manage all their resources, > > which would mean that pinctrl calls need to be done on probe() and, if > > necessary, during

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Mitch Bradley
On 10/23/2012 12:03 AM, Felipe Balbi wrote: > Hi, > > I much prefer having drivers explicitly manage all their resources, > which would mean that pinctrl calls need to be done on probe() and, if > necessary, during suspend()/resume(). Per-driver resource management is certainly convenient when

Re: [PATCHv2] Input: omap4-keypad: Add pinctrl support

2012-10-23 Thread Thomas Petazzoni
On Tue, 23 Oct 2012 12:45:33 +0200, Linus Walleij wrote: > Hm so I have had this idea of runtime PM core helping out > with pins, so I could add something like > > pm_pins_fetch() > pm_pins_default() > pm_pins_idle() > pm_pins_sleep() > > So if one is using the pin states defined in > then

  1   2   >