From patchwork Thu Oct 12 06:58:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 10001139 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 0D13A602BF for ; Thu, 12 Oct 2017 06:59:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 008DE28CF6 for ; Thu, 12 Oct 2017 06:59:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9D1D28CF7; Thu, 12 Oct 2017 06:59: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=-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 98B0C28CF4 for ; Thu, 12 Oct 2017 06:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbdJLG7K (ORCPT ); Thu, 12 Oct 2017 02:59:10 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42236 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751924AbdJLG7J (ORCPT ); Thu, 12 Oct 2017 02:59:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 20E3C607E8; Thu, 12 Oct 2017 06:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507791549; bh=k2IzRj9Nm7DF6AqzfvmBeWH8lTRZGzuv8rk2roze8qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pxww4QlWLhknOs1mXbhYmwrA7Gf2JYEd7wsJPQNdn5wLVH0hD1fHEUGYFBGomBjUX 0con0tw3T2RiSoJI6HRZYUAZj4sC7AUs4uhgC0fL6zu7+DdzG78AT0V3sAwJ61ywfi yq08npo/f8DcCs3d6MefjNBNqsitqLn2k9dhrtlE= Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3261E6072F; Thu, 12 Oct 2017 06:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507791548; bh=k2IzRj9Nm7DF6AqzfvmBeWH8lTRZGzuv8rk2roze8qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EuuMFYeJmfE65c9LDWIH18cAbcvH0qjM9HHq6JLNS/Sdp3DX6zYKwXGqIjGCtuSSk eJD+Rja3GbLS/imQFbppDfbc/5G5iO8cw4fX8L0XYdygiUw/dP85vCmS035lotRfNH lMV+IrSzu++LkcMybLdOIQJS1KYHnY252iSXG7EQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3261E6072F 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@codeaurora.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, stanimir.varbanov@linaro.org, vivek.gautam@codeaurora.org, architt@codeaurora.org, Rajendra Nayak Subject: [PATCH 1/3] clk: qcom: gdsc: Add support for ALWAYS_ON gdscs Date: Thu, 12 Oct 2017 12:28:47 +0530 Message-Id: <1507791529-24353-2-git-send-email-rnayak@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507791529-24353-1-git-send-email-rnayak@codeaurora.org> References: <1507791529-24353-1-git-send-email-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 Tested-by: Archit Taneja --- 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 a4f3580..15f4bb5 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 3964834..7fd78ce 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;