summaryrefslogtreecommitdiff
path: root/drivers/power/avs
diff options
context:
space:
mode:
authorAndrii Tseglytskyi <andrii.tseglytskyi@ti.com>2013-05-27 14:09:24 +0300
committerKevin Hilman <khilman@linaro.org>2013-06-10 10:46:18 -0700
commit299066bb376ef7720cc3d8de95d5b967c5446863 (patch)
tree2c8fccdbe53d050a71ede615271a566d75e7fc67 /drivers/power/avs
parent6c80573415fe47450579d5d8bfab53b304d803ed (diff)
PM / AVS: SmartReflex: use omap_sr * for enable/disable interface
SmartReflex driver interface is natively divided to two parts: - external SmartReflex interface - interface between SmartReflex driver and SmartReflex Class Functions which belong to AVS class interface can use struct omap_sr* instead of struct voltatedomain*, to provide a direct connection between SR driver and SR class. This allows us to optimize and not do additional lookups where none is required. sr_enable() and sr_disable() are interface functions between SR driver and SR class. They are typically used by Class driver to enable/disable SmartReflex hardware module. Now they take struct omap_sr* as input parameter. Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'drivers/power/avs')
-rw-r--r--drivers/power/avs/smartreflex.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
index 08a8a299f1fd..14cce7addbb9 100644
--- a/drivers/power/avs/smartreflex.c
+++ b/drivers/power/avs/smartreflex.c
@@ -552,7 +552,7 @@ int sr_configure_minmax(struct omap_sr *sr)
/**
* sr_enable() - Enables the smartreflex module.
- * @voltdm: VDD pointer to which the SR module to be configured belongs to.
+ * @sr: pointer to which the SR module to be configured belongs to.
* @volt: The voltage at which the Voltage domain associated with
* the smartreflex module is operating at.
* This is required only to program the correct Ntarget value.
@@ -561,16 +561,16 @@ int sr_configure_minmax(struct omap_sr *sr)
* enable a smartreflex module. Returns 0 on success. Returns error
* value if the voltage passed is wrong or if ntarget value is wrong.
*/
-int sr_enable(struct voltagedomain *voltdm, unsigned long volt)
+int sr_enable(struct omap_sr *sr, unsigned long volt)
{
struct omap_volt_data *volt_data;
- struct omap_sr *sr = _sr_lookup(voltdm);
struct omap_sr_nvalue_table *nvalue_row;
int ret;
- if (IS_ERR(sr)) {
- pr_warning("%s: omap_sr struct for voltdm not found\n", __func__);
- return PTR_ERR(sr);
+ if (!sr) {
+ pr_warn("%s: NULL omap_sr from %pF\n", __func__,
+ (void *)_RET_IP_);
+ return -EINVAL;
}
volt_data = omap_voltage_get_voltdata(sr->voltdm, volt);
@@ -612,17 +612,16 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt)
/**
* sr_disable() - Disables the smartreflex module.
- * @voltdm: VDD pointer to which the SR module to be configured belongs to.
+ * @sr: pointer to which the SR module to be configured belongs to.
*
* This API is to be called from the smartreflex class driver to
* disable a smartreflex module.
*/
-void sr_disable(struct voltagedomain *voltdm)
+void sr_disable(struct omap_sr *sr)
{
- struct omap_sr *sr = _sr_lookup(voltdm);
-
- if (IS_ERR(sr)) {
- pr_warning("%s: omap_sr struct for voltdm not found\n", __func__);
+ if (!sr) {
+ pr_warn("%s: NULL omap_sr from %pF\n", __func__,
+ (void *)_RET_IP_);
return;
}