From patchwork Fri Mar 23 08:26:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 10302911 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 D87D360385 for ; Fri, 23 Mar 2018 08:26:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9C2028C94 for ; Fri, 23 Mar 2018 08:26:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE35528C95; Fri, 23 Mar 2018 08:26:31 +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 66F8728C92 for ; Fri, 23 Mar 2018 08:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbeCWI0b (ORCPT ); Fri, 23 Mar 2018 04:26:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47776 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbeCWI0a (ORCPT ); Fri, 23 Mar 2018 04:26:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D00D26081A; Fri, 23 Mar 2018 08:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521793589; bh=+hvaAn2zvU1tStfua0hLSxUYkkfFhw2E44QkYjNG2lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJgiG7eLOZqD+AiwMQYjTluqMG3rlxd/voRhLHINZ7sO9V0Pn07A4NUIK0ywXKyw9 dYUdjCn1KHORI8LBWzkvs+6ndTC847Aqq3/IFTPbssWQIaz+RCKFlVxHsNdQ9xShkY sic4aTY3Rb4E96gwXq287ryemcVsTDyiADfMxIhs= Received: from blr-ubuntu-173.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: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CAED060C64; Fri, 23 Mar 2018 08:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521793589; bh=+hvaAn2zvU1tStfua0hLSxUYkkfFhw2E44QkYjNG2lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJgiG7eLOZqD+AiwMQYjTluqMG3rlxd/voRhLHINZ7sO9V0Pn07A4NUIK0ywXKyw9 dYUdjCn1KHORI8LBWzkvs+6ndTC847Aqq3/IFTPbssWQIaz+RCKFlVxHsNdQ9xShkY sic4aTY3Rb4E96gwXq287ryemcVsTDyiADfMxIhs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CAED060C64 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=rnayak@codeaurora.org From: Rajendra Nayak To: sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, stanimir.varbanov@linaro.org, vivek.gautam@codeaurora.org, srinivas.kandagatla@linaro.org, Rajendra Nayak Subject: [PATCH v2 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Date: Fri, 23 Mar 2018 13:56:14 +0530 Message-Id: <20180323082616.10142-2-rnayak@codeaurora.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180323082616.10142-1-rnayak@codeaurora.org> References: <20180323082616.10142-1-rnayak@codeaurora.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some GDSCs might have software control to turn them off, but we might want to keep them enabled always, in some cases because of lack of support in kernel to handle a graceful turning off/on of such GDSCs. Most common instances would be the GDCSs which power up the noc/bus fabrics, which need bus drivers to handle them and atleast support for which is missing on all qcom SoCs. Signed-off-by: Rajendra Nayak Reviewed-by: Bjorn Andersson Tested-by: Srinivas Kandagatla --- drivers/clk/qcom/gdsc.c | 8 ++++++++ drivers/clk/qcom/gdsc.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index a4f3580587b7..15f4bb5efd68 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -291,6 +291,14 @@ static int gdsc_init(struct gdsc *sc) if ((sc->flags & VOTABLE) && on) gdsc_enable(&sc->pd); + /* If ALWAYS_ON GDSCs are not ON, turn them ON */ + if (sc->flags & ALWAYS_ON) { + if (!on) + gdsc_enable(&sc->pd); + on = true; + sc->pd.flags |= GENPD_FLAG_ALWAYS_ON; + } + if (on || (sc->pwrsts & PWRSTS_RET)) gdsc_force_mem_on(sc); else diff --git a/drivers/clk/qcom/gdsc.h b/drivers/clk/qcom/gdsc.h index 39648348e5ec..7fd78cec7e5b 100644 --- a/drivers/clk/qcom/gdsc.h +++ b/drivers/clk/qcom/gdsc.h @@ -53,6 +53,7 @@ struct gdsc { #define VOTABLE BIT(0) #define CLAMP_IO BIT(1) #define HW_CTRL BIT(2) +#define ALWAYS_ON BIT(3) struct reset_controller_dev *rcdev; unsigned int *resets; unsigned int reset_count;