Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2296653ybh; Fri, 24 Jul 2020 09:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyofu4OKETK+3id6oA0bTlD+epF+nKv2b84STQcifQwsS/EaFbUTS6sHSD9kORbQlvmcRvL X-Received: by 2002:a17:906:364e:: with SMTP id r14mr9664531ejb.258.1595607152024; Fri, 24 Jul 2020 09:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595607152; cv=none; d=google.com; s=arc-20160816; b=j4N2ZutD+IgDwJLaAXsiEwWv1+BOCEm4KW2Oou44q8+CaqaHNYknkFMiEAAMUTMee3 SeM/KvGVaIt1Z1TuUp7YQKt1kVtd3JU6w7HizMLIueEgGqoKTunGPcexyHmxe1TV4wNt UdrJINTiPO5KzluvTCeJhC9yJW8PniQsqSMJuFrGNMY7wWnTWjIxIOwaqet8nZX73CPE X+es3BQ9VTHqLUVNqX2QDAeje9BW5+B9CqrR+oyrHq1Uw514f3oBkaG9ymuRXjMZp+ZF k1W9Iw/lR1Bee6YPd3LjTyqx69xCfuFIEX3YBvguo3BKkH1rcUx01S09Yu22CsCvmuZD ilPw== 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=t64qIunYUkZ7z2HBIOykPkNBNzZ4n4azNc2m1TzjwQjUyKNKPwT1cK+x2u6AsTQWJl mIgmayyV/YHWf1RvWPgfJb2lAy9uy/lAOM/wtofCfLPcDnAQ6a11d6pQI+c3ZPCB9if0 Z27IHPWVOihh4XYn82MzY3EyxE2eOxy00HYUufPQ/qAc8NNpPEjF5aT5NI6VZad+d8hx 65N30/MGDYo+DyUNz7dvssGFdctfhDZzBa8HWrEbu/ObWknfL0MqcUO/rHGWUpWgVifg kQVQVMuL1Lpyrdu8XHJjGOKe3DkYGdr9VVU5XWbs6cB1xbcGVXHPewZKvj1CkbriK6j9 zukw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=IKINh5c2; 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 a18si797412ejr.22.2020.07.24.09.12.09; Fri, 24 Jul 2020 09:12: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=IKINh5c2; 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 S1728562AbgGXQIq (ORCPT + 99 others); Fri, 24 Jul 2020 12:08:46 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:64167 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727959AbgGXQIp (ORCPT ); Fri, 24 Jul 2020 12:08:45 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595606925; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Z7VcFhGfQeC2uFAHORg1EVlpA7tEAa/KJ7mZGO2/rp0=; b=IKINh5c2ex71+DmU98wKdFLzFaoWWL3khnuWaKVqB/A3PJUfr8Joob2GFlzKbZ9s+FGI1SkM 8voTV7E1Cpn0B+bnOZC3B05C9c3wen+a68pH5zDPipneRlBfQjGiSOWTHWMvxYJ0i08F6lWR h9Qk2p867g85plgS9nh3BGt4TkE= 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-n04.prod.us-west-2.postgun.com with SMTP id 5f1b078449176bd38251886c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 24 Jul 2020 16:08:36 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 77416C433CB; Fri, 24 Jul 2020 16:08:36 +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 (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 17BC3C433A1; Fri, 24 Jul 2020 16:08:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 17BC3C433A1 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 v5 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR Date: Fri, 24 Jul 2020 21:37:55 +0530 Message-Id: <1595606878-2664-2-git-send-email-tdas@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595606878-2664-1-git-send-email-tdas@codeaurora.org> References: <1595606878-2664-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.