It is needed that one disable proxy regulators when handover interrupt is received from mss subsystem while on certain chip there are few regulator which are never disabled. So separating out disable interface in two separate routine. Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@xxxxxxxxxxxxxx> --- drivers/remoteproc/qcom_q6v5_pil.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 8843605..57c67e1 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -255,8 +255,42 @@ static int q6v5_regulator_enable(struct q6v5 *qproc, return rc; } +static void q6v5_proxy_regulator_disable(struct q6v5 *qproc) +{ + int i; + struct reg_info *regs = qproc->proxy_regs; + + for (i = 0; i < qproc->proxy_reg_count; i++) { + if (regs[i].uV > 0) + regulator_set_voltage(regs[i].reg, 0, INT_MAX); + + if (regs[i].uA > 0) + regulator_set_load(regs[i].reg, 0); + + regulator_disable(regs[i].reg); + } +} + +static void q6v5_active_regulator_disable(struct q6v5 *qproc) +{ + int i; + struct reg_info *regs = qproc->active_regs; + + for (i = 0; i < qproc->active_reg_count; i++) { + if (regs[i].uV > 0) + regulator_set_voltage(regs[i].reg, 0, INT_MAX); + + if (regs[i].uA > 0) + regulator_set_load(regs[i].reg, 0); + + regulator_disable(regs[i].reg); + } +} + static void q6v5_regulator_disable(struct q6v5 *qproc) { + q6v5_proxy_regulator_disable(qproc); + q6v5_active_regulator_disable(qproc); } static int q6v5_load(struct rproc *rproc, const struct firmware *fw) @@ -629,7 +663,7 @@ static int q6v5_start(struct rproc *rproc) assert_reset: reset_control_assert(qproc->mss_restart); disable_vdd: - q6v5_regulator_disable(qproc); + q6v5_active_regulator_disable(qproc); disable_proxy_clk: return ret; } -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html