summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTirupathi Reddy <tirupath@codeaurora.org>2016-04-15 18:29:52 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-05 01:44:40 -0700
commit6287056179c7beb4e9d24e301f70ffe040e4e0f6 (patch)
tree24ef9bd8ffa1e4ad1606b15876a42c221f78ad70
parent4380bdb60482f651edfa6d54e7641b7aad65a252 (diff)
power: qcom: Modify APM timeout value for msm8953
As per msm8953 design, APM state machine could take more than 200us for mode switching. Increase SW timeout constraint value to 500us. Also, update the mask used to check APM switch status. CRs-Fixed: 992695 Change-Id: Ie0f8733fb5b39172fb14547292cbd05689a50230 Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
-rw-r--r--drivers/power/qcom/apm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/power/qcom/apm.c b/drivers/power/qcom/apm.c
index 6181b08a41a5..30f14ee4f899 100644
--- a/drivers/power/qcom/apm.c
+++ b/drivers/power/qcom/apm.c
@@ -629,9 +629,15 @@ done:
#define MSM8953_APCC_APM_MODE 0x000002a8
#define MSM8953_APCC_APM_CTL_STS 0x000002b0
+/* 8953 constants */
+#define MSM8953_APM_SWITCH_TIMEOUT_US 500
+
+/* Register bit mask definitions */
+#define MSM8953_APM_CTL_STS_MASK 0x1f
+
static int msm8953_apm_switch_to_mx(struct msm_apm_ctrl_dev *ctrl_dev)
{
- int timeout = MSM_APM_SWITCH_TIMEOUT_US;
+ int timeout = MSM8953_APM_SWITCH_TIMEOUT_US;
u32 regval;
int ret = 0;
unsigned long flags;
@@ -648,7 +654,7 @@ static int msm8953_apm_switch_to_mx(struct msm_apm_ctrl_dev *ctrl_dev)
while (timeout > 0) {
regval = readl_relaxed(ctrl_dev->reg_base +
MSM8953_APCC_APM_CTL_STS);
- if ((regval & MSM_APM_CTL_STS_MASK) ==
+ if ((regval & MSM8953_APM_CTL_STS_MASK) ==
MSM8953_APM_MX_DONE_VAL)
break;
@@ -672,7 +678,7 @@ static int msm8953_apm_switch_to_mx(struct msm_apm_ctrl_dev *ctrl_dev)
static int msm8953_apm_switch_to_apcc(struct msm_apm_ctrl_dev *ctrl_dev)
{
- int timeout = MSM_APM_SWITCH_TIMEOUT_US;
+ int timeout = MSM8953_APM_SWITCH_TIMEOUT_US;
u32 regval;
int ret = 0;
unsigned long flags;
@@ -689,7 +695,7 @@ static int msm8953_apm_switch_to_apcc(struct msm_apm_ctrl_dev *ctrl_dev)
while (timeout > 0) {
regval = readl_relaxed(ctrl_dev->reg_base +
MSM8953_APCC_APM_CTL_STS);
- if ((regval & MSM_APM_CTL_STS_MASK) ==
+ if ((regval & MSM8953_APM_CTL_STS_MASK) ==
MSM8953_APM_APCC_DONE_VAL)
break;