]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
cpufreq: cpufreq-cpu0: defer probe when regulator is not ready
authorNishanth Menon <nm@ti.com>
Wed, 1 May 2013 13:38:12 +0000 (13:38 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 12 May 2013 12:04:16 +0000 (14:04 +0200)
commitfc31d6f55908759530462998d0464a9f124b1c32
treee46590fd7da690fc5f3229975a470e1db4b268e4
parentd96038e0fa00f42a5d6711884bef0a725cdc70bb
cpufreq: cpufreq-cpu0: defer probe when regulator is not ready

With commit 1e4b545, regulator_get will now return -EPROBE_DEFER
when the cpu0-supply node is present, but the regulator is not yet
registered.

It is possible for this to occur when the regulator registration
by itself might be defered due to some dependent interface not yet
instantiated. For example: an regulator which uses I2C and GPIO might
need both systems available before proceeding, in this case, the
regulator might defer it's registration.

However, the cpufreq-cpu0 driver assumes that any un-successful
return result is equivalent of failure.

When the regulator_get returns failure other than -EPROBE_DEFER, it
makes sense to assume that supply node is not present and proceed
with the assumption that only clock control is necessary in the
platform.

With this change, we can now handle the following conditions:
 a) cpu0-supply binding is not present, regulator_get will return
    appropriate error result, resulting in cpufreq-cpu0 driver
    controlling just the clock.
 b) cpu0-supply binding is present, regulator_get returns
    -EPROBE_DEFER, we retry resulting in cpufreq-cpu0 driver
    registering later once the regulator is available.
 c) cpu0-supply binding is present, regulator_get returns
    -EPROBE_DEFER, however, regulator never registers, we retry until
    cpufreq-cpu0 driver fails to register pointing at device tree
    information bug. However, in this case, the fact that
    cpufreq-cpu0 operates with clock only when the DT binding clearly
    indicates need of a supply is a bug of it's own.
 d) cpu0-supply gets an regulator at probe - cpufreq-cpu0 driver
    controls both the clock and regulator

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq-cpu0.c