Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecd1154f authored by Tirupathi Reddy's avatar Tirupathi Reddy
Browse files

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: default avatarTirupathi Reddy <tirupath@codeaurora.org>
parent dc9078ea
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -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;