On Thu, Oct 24, 2013 at 03:19:03PM +0200, Linus Walleij wrote:
This makes a lot of sense, the only problem I have traditionally had with this is that there exist cases where you want to put pinctrl handles to sleep or idle aside from runtime PM.
Yeah, that was my concern.
- I2C or SPI hosts with no devices connected to them should be nailed to sleep. (It's not possible to detect an unused I2C or SPI host today, but a feature we should add.)
The SPI case should be mostly handled already if this is integrated via runtime PM - we have core support for idling controllers whenever there is no transfer active. That should go off for devices that aren't connected to anything.
I should probably go and implement an I2C version of that.
Maybe the right way to do these is also to use runtime_pm*, but the thing is that today these things are done also when CONFIG_PM_RUNTIME is not set. Which is something you might sometimes want.
Or not? Should we say that unless you have CONFIG_PM_RUNTIME you don't deserve saving these microamps anyway?
Personally I tend to think that people who care probably ought to be using runtime PM but that's not a sufficiently general view to insist on.
As we discussed in person earlier how about we merge this on a subsystem basis and then once we've established what the pattern really is we think about putting it into the core. Nicolin, do you want to write a patch for this?