From patchwork Wed Nov 16 17:01:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dwivedi, Avaneesh Kumar (avani)" X-Patchwork-Id: 9432213 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D04F960756 for ; Wed, 16 Nov 2016 17:02:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B937728FC9 for ; Wed, 16 Nov 2016 17:02:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADA3628FB3; Wed, 16 Nov 2016 17:02:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2749728FC9 for ; Wed, 16 Nov 2016 17:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932643AbcKPRCE (ORCPT ); Wed, 16 Nov 2016 12:02:04 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57388 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932811AbcKPRCC (ORCPT ); Wed, 16 Nov 2016 12:02:02 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 96B9A61516; Wed, 16 Nov 2016 17:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479315721; bh=pnNeKyk96dJlcFGmuj1rtypM9NpyJZZfFdnP5oujkLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yl4LE0UEg4DWIPZXSBUpI1wrmUtE5kX9Q31LoPg6X4dFdcGa+lkIMBdxqme1AH1T6 +/7hqu84YzPb05yVKw8dxF5eD+mzFopQg1P1W9LlRJjaKIpfnrphvGLAjePcXbYPnG mNJqaFoEf1dx6UEX/MlDQOd/i29SUxUPOzd02Vjk= Received: from akdwived-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akdwived@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 16AA161515; Wed, 16 Nov 2016 17:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479315721; bh=pnNeKyk96dJlcFGmuj1rtypM9NpyJZZfFdnP5oujkLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yl4LE0UEg4DWIPZXSBUpI1wrmUtE5kX9Q31LoPg6X4dFdcGa+lkIMBdxqme1AH1T6 +/7hqu84YzPb05yVKw8dxF5eD+mzFopQg1P1W9LlRJjaKIpfnrphvGLAjePcXbYPnG mNJqaFoEf1dx6UEX/MlDQOd/i29SUxUPOzd02Vjk= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 16AA161515 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=akdwived@codeaurora.org From: Avaneesh Kumar Dwivedi To: bjorn.andersson@linaro.org Cc: sboyd@codeaurora.org, agross@codeaurora.org, linux-arm-msm@vger.kernel.org, Avaneesh Kumar Dwivedi Subject: [PATCH v4 05/10] remoteproc: qcom: Separate out regulator disable routine in two Date: Wed, 16 Nov 2016 22:31:31 +0530 Message-Id: <1479315696-15490-6-git-send-email-akdwived@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479315696-15490-1-git-send-email-akdwived@codeaurora.org> References: <1479315696-15490-1-git-send-email-akdwived@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }