Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1845602ybk; Sun, 17 May 2020 02:25:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAQA/AIvB0tbl/xyysL+rQWQuz9OMkSrJD3cfBmn5EGzjWB6tFQfkEYvZTmQr/F5a/cqq1 X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr11013674ejb.6.1589707544467; Sun, 17 May 2020 02:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589707544; cv=none; d=google.com; s=arc-20160816; b=emQdys5h63NGZ0ITe6bXzQqxZ54OFWnsnJY7u3bzaEvzV7BkgvgIkb6ed3yfzCgx4n eDBG7c7aJBy13YLlekElHog7NGswiTDfL87UmEDP5U9dko4ArPFPoBmhBmSR/SDhkfYk ORBAfnndkMUzO2sGOVgwjQchnjTGJaAriKUhMamoNUWwEOQBovrG8CQ/7JZbbI2Lx8kW fccsVAoQj8z14z1jWh4oCdpOnL2UtNla3Fyi7cjM8ANtLjzVTLYumPaNu0FGxmj6w8GS ySkFqznVJzz7l7vlQ+l+ZGt8XWu85uzRwCrD83lisaFOft8g4+b6uGilrhmRCpGn0OWz UhRQ== 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=YxhaePZ5mhm2ku+O6cUBaSUemw+KdK8gKbz7PYDWDB8=; b=RsnACyLRkwEBMRyN1gzmBYgRI4jiaSNWfALEiiHrY4iW2sQhy10U6UHR48IOIt6jza PgpaMixuuF7mhU1Cl8Az+Nkz8Tmgeu/vvCDwY3p4+tHtlwFTpy4HBOQiMy5Wn4f41Yvy Fd+grjPuxwgMjnb4YA+SgE+4ujBr4TI1lLeMF/O6epVfPSjWFIpJWHPsXUww4rURPEWf CyNHEWlxp4CmNvEWU6rw1i8shZnRtO5t6OsdLG0sHfR41fNidF+sbNY3XbFZiVIqOObO pwnZjEWGHeobtUYssX7EFzbK3+AL2I9YJakvvNh6nqVrRjSOhSnEPpcf7EhjM799EscK D7Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=WS4vbM8B; 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 j18si1958400edq.98.2020.05.17.02.25.21; Sun, 17 May 2020 02:25:44 -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=WS4vbM8B; 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 S1727835AbgEQJXW (ORCPT + 99 others); Sun, 17 May 2020 05:23:22 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:19476 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgEQJXW (ORCPT ); Sun, 17 May 2020 05:23:22 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1589707401; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=YxhaePZ5mhm2ku+O6cUBaSUemw+KdK8gKbz7PYDWDB8=; b=WS4vbM8BRnthzNTlN5bQtf57V9rHo4tVTMa4bmH5LO85HkyI+VTyd9GlD0Tc5hQBy4SKepW0 tUDK3sT19FbyMx75BR7gFMDAV+LqSSc9cvCe0z6VUYnpNdBlHDjUqAN2hWhA3GZcUjDFFxVD UWcAotJ2SYw2Wxp+qorqO6UZqTc= X-Mailgun-Sending-Ip: 104.130.122.26 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-east-1.postgun.com with SMTP id 5ec102708ebbf95ecb907ab3 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 17 May 2020 09:22:56 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7E243C43636; Sun, 17 May 2020 09:22:55 +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 (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 C707FC433D2; Sun, 17 May 2020 09:22:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C707FC433D2 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 v2 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR Date: Sun, 17 May 2020 14:52:21 +0530 Message-Id: <1589707344-8871-2-git-send-email-tdas@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589707344-8871-1-git-send-email-tdas@codeaurora.org> References: <1589707344-8871-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 a250f59..9983456 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -28,6 +28,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). */ @@ -202,6 +203,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); @@ -254,6 +263,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 64cdc8c..8604d44 100644 --- a/drivers/clk/qcom/gdsc.h +++ b/drivers/clk/qcom/gdsc.h @@ -49,6 +49,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.