Commit cd8abed1 authored by Rajendra Nayak's avatar Rajendra Nayak Committed by Kevin Hilman

ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm

The powerdomain framework currently expects all powerdomains to be associated with
a corresponding voltagedomain. For some SoCs' (like the already existing AM33xx
family, or for the upcoming AM437x and DRA7 SoCs') which
do not have a Voltage controller/Voltage Processor (neither the SR I2C
bus to communicate with the PMIC) there is no need for a Powerdomain to have
a voltage domain association since there is no auto-scaling of voltages possible
using the voltage FSM.

Extend the arch operations to add an api which the powerdomain core can
then use to identify if a voltdm lookup and association for a powerdomain
is really needed.
Acked-by: default avatarNishanth Menon <nm@ti.com>
Acked-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Afzal Mohammed <afzal@ti.com> # am335x evm
Signed-off-by: default avatarKevin Hilman <khilman@linaro.org>
parent 7d132055
...@@ -102,6 +102,10 @@ static int _pwrdm_register(struct powerdomain *pwrdm) ...@@ -102,6 +102,10 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
if (_pwrdm_lookup(pwrdm->name)) if (_pwrdm_lookup(pwrdm->name))
return -EEXIST; return -EEXIST;
if (arch_pwrdm && arch_pwrdm->pwrdm_has_voltdm)
if (!arch_pwrdm->pwrdm_has_voltdm())
goto skip_voltdm;
voltdm = voltdm_lookup(pwrdm->voltdm.name); voltdm = voltdm_lookup(pwrdm->voltdm.name);
if (!voltdm) { if (!voltdm) {
pr_err("powerdomain: %s: voltagedomain %s does not exist\n", pr_err("powerdomain: %s: voltagedomain %s does not exist\n",
...@@ -111,6 +115,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm) ...@@ -111,6 +115,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
pwrdm->voltdm.ptr = voltdm; pwrdm->voltdm.ptr = voltdm;
INIT_LIST_HEAD(&pwrdm->voltdm_node); INIT_LIST_HEAD(&pwrdm->voltdm_node);
voltdm_add_pwrdm(voltdm, pwrdm); voltdm_add_pwrdm(voltdm, pwrdm);
skip_voltdm:
spin_lock_init(&pwrdm->_lock); spin_lock_init(&pwrdm->_lock);
list_add(&pwrdm->node, &pwrdm_list); list_add(&pwrdm->node, &pwrdm_list);
......
...@@ -166,6 +166,7 @@ struct powerdomain { ...@@ -166,6 +166,7 @@ struct powerdomain {
* @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd
* @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep
* @pwrdm_wait_transition: Wait for a pd state transition to complete * @pwrdm_wait_transition: Wait for a pd state transition to complete
* @pwrdm_has_voltdm: Check if a voltdm association is needed
* *
* Regarding @pwrdm_set_lowpwrstchange: On the OMAP2 and 3-family * Regarding @pwrdm_set_lowpwrstchange: On the OMAP2 and 3-family
* chips, a powerdomain's power state is not allowed to directly * chips, a powerdomain's power state is not allowed to directly
...@@ -196,6 +197,7 @@ struct pwrdm_ops { ...@@ -196,6 +197,7 @@ struct pwrdm_ops {
int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm); int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm);
int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm); int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm);
int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
int (*pwrdm_has_voltdm)(void);
}; };
int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs); int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment