Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp770371ybg; Wed, 10 Jun 2020 13:16:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4dEzkE+X0mLyamO2kqN2MSMl78XO+Pr2L5iosU1iSnABLRvTcM4SOqxz14SbPCKEFiGZR X-Received: by 2002:aa7:ca02:: with SMTP id y2mr3904067eds.106.1591820166514; Wed, 10 Jun 2020 13:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591820166; cv=none; d=google.com; s=arc-20160816; b=plZAL6Zn/+sPuGwFXUd/4mx7XPa1kuwqYCYBWRq/Lpb+dirVJGOOIW8gZajMuS8Q2a 9kKUdwOWqgSc7LcVB9dIZ0wkdEU9uMlGIzl2VJ/1Y/v9sM5WgJBi3DUgSkyPBD52YA5q Svfz3xqsNUaQxUKtZ83TiAwf0hP54zd0og72vS9RDC3fHBdTK0IDW7jGmuGY+aPNnB16 h4vcmyol5gFlaiEtgwKF8yaQflywB6JLYzYe5iSLb2zY4eKiMfJtbgRRNscp+5udBX4Z s5TbMRcPy5FFfc1spH+C8yy5s9UXLBX6tX2zkHgOaNW7mRFAdNSCKvHY5WkYtjDLHuvo nXsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=Z7VcFhGfQeC2uFAHORg1EVlpA7tEAa/KJ7mZGO2/rp0=; b=n8Jpx2T4eKmNS1+HJ6LLnQJt4QDGmPRrbqmEvv8eqk2L1/5n6h26vy6GNnFX8I66s8 K4gFBSeFuJguweabnzCwZk0cTjFXhYntieFPeYgTHXKB4yZEh+UOTIJGb0xkymen3FxY BViAHuHsJ8GZWviu2l0wWzShnezrunq30WEQFbPv+R2FKrDViqsqQoePo080J5ljpd+k +DZffy4Ha8a7F3sv4gBM0fn+veWrlY4/E2jBwniax7IZ8QdTRoZ4LGq9MO3Zmw4Mi6jR Ax3B0YIs1gWAf4735F0nlb+04lhQL4CKTkJIFtNOcAeuxPUnaZlzjfijENQs2fMj/FmM U8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ICIh5EqV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si364738edo.592.2020.06.10.13.15.43; Wed, 10 Jun 2020 13:16:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ICIh5EqV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728431AbgFJRSh (ORCPT + 99 others); Wed, 10 Jun 2020 13:18:37 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:31492 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbgFJRSg (ORCPT ); Wed, 10 Jun 2020 13:18:36 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1591809516; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Z7VcFhGfQeC2uFAHORg1EVlpA7tEAa/KJ7mZGO2/rp0=; b=ICIh5EqVpgNoNPcd/cTs78enD7717P7KWYmJpfdPHUOAISzpWn29XG+FoZG1Z7Zr06HBQ2UW 6YFv11EQjrJ9VG15slZAeEjn8cY5oryafuhr2PME1P5l5p+9RDHOD2mNCveWMjPyFRmUuMlT I4hvc8QM90eeZIQX/8wSrVuUyTs= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 5ee115e4f3deea03f3af5d15 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 10 Jun 2020 17:18:28 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C969AC433C6; Wed, 10 Jun 2020 17:18:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from tdas-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas) by smtp.codeaurora.org (Postfix) with ESMTPSA id 47B27C433A0; Wed, 10 Jun 2020 17:18:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 47B27C433A0 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=tdas@codeaurora.org From: Taniya Das To: Stephen Boyd , =?UTF-8?q?Michael=20Turquette=20=C2=A0?= Cc: David Brown , Rajendra Nayak , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , devicetree@vger.kernel.org, robh@kernel.org, robh+dt@kernel.org, Taniya Das Subject: [PATCH v3 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR Date: Wed, 10 Jun 2020 22:48:04 +0530 Message-Id: <1591809487-5588-2-git-send-email-tdas@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591809487-5588-1-git-send-email-tdas@codeaurora.org> References: <1591809487-5588-1-git-send-email-tdas@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the RETAIN_FF_ENABLE feature which enables the usage of retention registers. These registers maintain their state after disabling and re-enabling a GDSC. Signed-off-by: Taniya Das --- drivers/clk/qcom/gdsc.c | 12 ++++++++++++ drivers/clk/qcom/gdsc.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index 04944f1..2502430 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -29,6 +29,7 @@ /* CFG_GDSCR */ #define GDSC_POWER_UP_COMPLETE BIT(16) #define GDSC_POWER_DOWN_COMPLETE BIT(15) +#define GDSC_RETAIN_FF_ENABLE BIT(11) #define CFG_GDSCR_OFFSET 0x4 /* Wait 2^n CXO cycles between all states. Here, n=2 (4 cycles). */ @@ -216,6 +217,14 @@ static inline void gdsc_assert_reset_aon(struct gdsc *sc) regmap_update_bits(sc->regmap, sc->clamp_io_ctrl, GMEM_RESET_MASK, 0); } + +static void gdsc_retain_ff_on(struct gdsc *sc) +{ + u32 mask = GDSC_RETAIN_FF_ENABLE; + + regmap_update_bits(sc->regmap, sc->gdscr, mask, mask); +} + static int gdsc_enable(struct generic_pm_domain *domain) { struct gdsc *sc = domain_to_gdsc(domain); @@ -268,6 +277,9 @@ static int gdsc_enable(struct generic_pm_domain *domain) udelay(1); } + if (sc->flags & RETAIN_FF_ENABLE) + gdsc_retain_ff_on(sc); + return 0; } diff --git a/drivers/clk/qcom/gdsc.h b/drivers/clk/qcom/gdsc.h index c36fc26..a5076fe 100644 --- a/drivers/clk/qcom/gdsc.h +++ b/drivers/clk/qcom/gdsc.h @@ -50,6 +50,7 @@ struct gdsc { #define AON_RESET BIT(4) #define POLL_CFG_GDSCR BIT(5) #define ALWAYS_ON BIT(6) +#define RETAIN_FF_ENABLE BIT(7) struct reset_controller_dev *rcdev; unsigned int *resets; unsigned int reset_count; -- Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.