Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp220397ybh; Tue, 14 Jul 2020 23:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoth8zJ/DBlM05sSpkHFbcIq7wXoH+eOyvHBeSZXoWD3z+n4DnRqMELtAIK7CH+zTQfuIf X-Received: by 2002:a17:907:1189:: with SMTP id uz9mr8126621ejb.478.1594795112879; Tue, 14 Jul 2020 23:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594795112; cv=none; d=google.com; s=arc-20160816; b=VbN/0MPZrtUFKqWFFYCdV7spOVNH6eXn5VaV3Y/5/m/QYFotJTCAW3CDta6JNivjQm OTBu7l9fFWNohUZ6BtnQWBPxFulo9gLu05OnMY+4zHfgohIcf3mFHIIGDrWzYEFUhM64 vBsJMJuH37y5oe9cABu/1vQf3akpUEi7Z5fAK28Fd8hBKtlooqYEXqImkhe9kErajn3r kybrm0Zi7w55hE5HNoTF3Uk+Mn9QvYNoam5pcUkjWALQ4JnwdKtMW1TgAtGxq8kbvqQ7 nfN5nXos7WsuRxg5IYmm2PKvk+eVv6IfJx999Wq9jBf1l4hAJThdvCznGhEqTH+fAU3w 0l7A== 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=PM+xeVJ6wrxW7hb60Kf8cH4RWQtUCh6rx7vX8734Bn+7w6Mqhff731y4PCNSfqzNYN To4R57QoxJ7Rg6tYtnQSM0B9iJumuzzoHvWULge4XkzKXuKx8rUL8YuKoGghG3oXkEMg WMSxB9ByhgtaeTf3hbEJI10TRNl8b+UCcV99bDbgTSQ0qNmFs5gR0I21Jp71l+9VEuUb 36qAYcn3T7Q1+S+l2hsGKEPt1GY3lQfxWITrH+NDd4NrOipRDbOf3d8xpUm8avuDK5x/ 825z49cn24g7Q07mbuMMEUU+CSXZyKheKKw4ymuVGfe2k9zWC7OAZoD07+zYAf1xb7xI Vt8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=FRTzjbA7; 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 v21si809602ejg.127.2020.07.14.23.38.08; Tue, 14 Jul 2020 23:38:32 -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=FRTzjbA7; 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 S1728838AbgGOGhN (ORCPT + 99 others); Wed, 15 Jul 2020 02:37:13 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:20062 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728806AbgGOGhK (ORCPT ); Wed, 15 Jul 2020 02:37:10 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1594795030; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Z7VcFhGfQeC2uFAHORg1EVlpA7tEAa/KJ7mZGO2/rp0=; b=FRTzjbA7KaecXH9VrneRo+PF8jBwW0+7NzDW3HUIXmAazjuBRaymFJx2rzKr6Ao6CN2JX3qH 076uz9E1RaNvwqtlrYCbHFhng58euR0K38D0WG9VaomzZHLzDFo/RE8BToahFEa/Xfr7vdP2 SCzXp729ZZ2GQQp3gJWa4Xqw/Ro= X-Mailgun-Sending-Ip: 69.72.43.7 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-n02.prod.us-east-1.postgun.com with SMTP id 5f0ea416c7a053446ae432bb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 15 Jul 2020 06:37:10 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7FFD4C433CA; Wed, 15 Jul 2020 06:37:09 +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, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from tdas-linux.qualcomm.com (unknown [202.46.22.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 EB82AC433C8; Wed, 15 Jul 2020 06:37:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EB82AC433C8 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 v4 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR Date: Wed, 15 Jul 2020 12:06:47 +0530 Message-Id: <1594795010-9074-2-git-send-email-tdas@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594795010-9074-1-git-send-email-tdas@codeaurora.org> References: <1594795010-9074-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.