diff options
author | Nishanth Menon <nm@ti.com> | 2011-11-28 16:07:15 -0600 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2011-11-30 15:29:18 -0800 |
commit | ce2832b7cfcb694978bc5b194a7a140ee589358c (patch) | |
tree | 160a2d4d4c34b8f694d352c1f8e7ed294a195f33 | |
parent | c70d0702503f68d34b613f63f1a3d6d6821a95c5 (diff) | |
download | kernel_samsung_tuna-ce2832b7cfcb694978bc5b194a7a140ee589358c.zip kernel_samsung_tuna-ce2832b7cfcb694978bc5b194a7a140ee589358c.tar.gz kernel_samsung_tuna-ce2832b7cfcb694978bc5b194a7a140ee589358c.tar.bz2 |
OMAP4: PM: handle SR disable and reset error
If the smartreflex class disable and reset returns error,
abort the idle/suspend condition accordingly.
Change-Id: I1f912848d54706e63c020eba9b7867b12680760f
Signed-off-by: Nishanth Menon <nm@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/pm44xx.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.h | 6 |
3 files changed, 16 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 6685f9f..aec1116 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -142,7 +142,8 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend) goto abort_gpio; if (mpu_next_state < PWRDM_POWER_INACTIVE) { - omap_sr_disable_reset_volt(mpu_voltdm); + if (omap_sr_disable_reset_volt(mpu_voltdm)) + goto abort_device_off; omap_vc_set_auto_trans(mpu_voltdm, OMAP_VC_CHANNEL_AUTO_TRANSITION_RETENTION); } @@ -154,8 +155,10 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend) * enabling AUTO RET requires SR to disabled, its done here for * now. Needs a relook to see if this can be optimized. */ - omap_sr_disable_reset_volt(iva_voltdm); - omap_sr_disable_reset_volt(core_voltdm); + if (omap_sr_disable_reset_volt(iva_voltdm)) + goto abort_device_off; + if (omap_sr_disable_reset_volt(core_voltdm)) + goto abort_device_off; omap_vc_set_auto_trans(core_voltdm, OMAP_VC_CHANNEL_AUTO_TRANSITION_RETENTION); if (!is_pm44xx_erratum(IVA_AUTO_RET_iXXX)) { diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 1a11b95..05b1e85 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -994,27 +994,29 @@ void omap_sr_disable(struct voltagedomain *voltdm) * into the registered smartreflex class disable API. This API will tell * the smartreflex class disable to reset the VP voltage after * disabling smartreflex. + * + * Returns result of transition request. */ -void omap_sr_disable_reset_volt(struct voltagedomain *voltdm) +int omap_sr_disable_reset_volt(struct voltagedomain *voltdm) { struct omap_sr *sr = _sr_lookup(voltdm); if (IS_ERR(sr)) { pr_warning("%s: omap_sr struct for sr_%s not found\n", __func__, voltdm->name); - return; + return -ENODEV; } if (!sr->autocomp_active) - return; + return 0; if (!sr_class || !(sr_class->disable)) { dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not" "registered\n", __func__); - return; + return -ENODEV; } - sr_class->disable(voltdm, sr->voltdm_cdata, + return sr_class->disable(voltdm, sr->voltdm_cdata, omap_voltage_get_curr_vdata(voltdm), 1); } diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index fffc626..1fecc1b 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -250,7 +250,7 @@ struct omap_sr_data { void omap_sr_enable(struct voltagedomain *voltdm, struct omap_volt_data *volt_data); void omap_sr_disable(struct voltagedomain *voltdm); -void omap_sr_disable_reset_volt(struct voltagedomain *voltdm); +int omap_sr_disable_reset_volt(struct voltagedomain *voltdm); /* API to register the pmic specific data with the smartreflex driver. */ void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); @@ -276,8 +276,8 @@ static inline int sr_notifier_control(struct voltagedomain *voltdm, return -EINVAL; } -static inline void omap_sr_disable_reset_volt( - struct voltagedomain *voltdm) {} +static inline int omap_sr_disable_reset_volt( + struct voltagedomain *voltdm) { return 0; } static inline void omap_sr_register_pmic( struct omap_sr_pmic_data *pmic_data) {} static inline bool is_sr_enabled(struct voltagedomain *voltdm) |