]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivercore: Bind/unbind power domain on probe/remove
authorTomasz Figa <t.figa@samsung.com>
Thu, 8 May 2014 12:49:14 +0000 (14:49 +0200)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:29 +0000 (21:16 -0600)
commitef2c90dea437f8955b7dc089ff1579c2aa06a6b7
tree58872c1d32074b6d1b8df946377a849ec838fc90
parent4aa055cb0634bc8d0389070104fe6aa7cfa99b8c
drivercore: Bind/unbind power domain on probe/remove

On a number of platforms, devices are part of controllable power
domains, which need to be enabled before such devices can be accessed
and may be powered down when the device is idle to save some power.
This means that on systems that support power domain control using
generic power domains subsystem, it is necessary to add device to its
power domain before binding a driver to it and remove it from its power
domain after its driver is unbound to make sure that an unused device
does not affect power domain state.

Since this is not limited to particular busses and specific
archs/platforms, it is more convenient to do the above directly in
driver core, just as done with pinctrl default configuration. This patch
adds necessary code to really_probe() and __device_release_driver() to
achieve this and maintain consistent stack-like ordering of operations
happening when binding and unbinding a driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
[on i.MX6 GK802]
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
[shawn.guo: http://thread.gmane.org/gmane.linux.kernel.samsung-soc/31029]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/base/dd.c