From patchwork Mon May 21 17:27:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10416017 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 A38786032C for ; Mon, 21 May 2018 17:29:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9316F28911 for ; Mon, 21 May 2018 17:29:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879C728986; Mon, 21 May 2018 17:29:10 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 3AC5A28911 for ; Mon, 21 May 2018 17:29:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753459AbeEUR2P (ORCPT ); Mon, 21 May 2018 13:28:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56880 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753341AbeEUR2K (ORCPT ); Mon, 21 May 2018 13:28:10 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B650560AD4; Mon, 21 May 2018 17:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526923689; bh=RvNgRWPPDNAkczZzqPWxUsjNoFzY8lUW5HSUTLB/f28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzxrMqarnGgGilQxk6a4GNXc8veV51p21OC0UijuPzxjetE8VmUgQ06BKM6OoGFoC idSqXYjsthgdv3cq84YjHuOuo6WdfBeFiij/VeD6ED6GR3IEvBuiOtxof2KUFih7vT eYGWba55NUSBzUR7Tzg8ZE06+n9Pd0ekp+azNtHs= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DE70D6021A; Mon, 21 May 2018 17:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526923689; bh=RvNgRWPPDNAkczZzqPWxUsjNoFzY8lUW5HSUTLB/f28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzxrMqarnGgGilQxk6a4GNXc8veV51p21OC0UijuPzxjetE8VmUgQ06BKM6OoGFoC idSqXYjsthgdv3cq84YjHuOuo6WdfBeFiij/VeD6ED6GR3IEvBuiOtxof2KUFih7vT eYGWba55NUSBzUR7Tzg8ZE06+n9Pd0ekp+azNtHs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DE70D6021A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sibis@codeaurora.org, georgi.djakov@linaro.org, jassisinghbrar@gmail.com, ohad@wizery.com, mark.rutland@arm.com, kyan@codeaurora.org, sricharan@codeaurora.org, akdwived@codeaurora.org, linux-arm-msm@vger.kernel.org, tsoni@codeaurora.org Subject: [PATCH v5 6/8] remoteproc: qcom: Introduce reset assert/deassert helper functions Date: Mon, 21 May 2018 22:57:12 +0530 Message-Id: <20180521172714.8551-7-sibis@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521172714.8551-1-sibis@codeaurora.org> References: <20180521172714.8551-1-sibis@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding reset assert/deassert helper functions to handle SoC specific reset sequences. This wil be used by SDM845 to assert and deassert ALT_RESET and MSS_RESET signals. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_pil.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index a5fa6521bb83..552805bc07c1 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -352,6 +352,16 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw) return 0; } +static int q6v5_reset_assert(struct q6v5 *qproc) +{ + return reset_control_assert(qproc->mss_restart); +} + +static int q6v5_reset_deassert(struct q6v5 *qproc) +{ + return reset_control_deassert(qproc->mss_restart); +} + static int q6v5_rmb_pbl_wait(struct q6v5 *qproc, int ms) { unsigned long timeout; @@ -767,7 +777,7 @@ static int q6v5_start(struct rproc *rproc) dev_err(qproc->dev, "failed to enable supplies\n"); goto disable_proxy_clk; } - ret = reset_control_deassert(qproc->mss_restart); + ret = q6v5_reset_deassert(qproc); if (ret) { dev_err(qproc->dev, "failed to deassert mss restart\n"); goto disable_vdd; @@ -859,7 +869,7 @@ static int q6v5_start(struct rproc *rproc) qproc->active_clk_count); assert_reset: - reset_control_assert(qproc->mss_restart); + q6v5_reset_assert(qproc); disable_vdd: q6v5_regulator_disable(qproc, qproc->active_regs, qproc->active_reg_count); @@ -909,7 +919,7 @@ static int q6v5_stop(struct rproc *rproc) qproc->mpss_phys, qproc->mpss_size); WARN_ON(ret); - reset_control_assert(qproc->mss_restart); + q6v5_reset_assert(qproc); q6v5_disable_irqs(qproc); if (!qproc->unvoted_flag) {