From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2374C433EF for ; Thu, 3 Feb 2022 02:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y/pRzyBuO1klpTh8B/Iqa7IYJGUgBjRx5mSapDnY/ws=; b=jCXAq/bcfQAfQJ m5VjkrAS7sKsjG8I6EcPJ8Lkri8/DCI1QbRe7aBr58gqKWhGHsEdEOUWNddb0Nsfqpmq4t66ia0Xo bRidGzg+B7WUNmKTtFGlaJX6bT4frTwKNApzrdlZ8vHuULGdtPZZKBoy/NaOKUqIRFIoTGpsNsWwr 3UZSnwi/cvzMpxHjebU7/LBNbsuOxwYgErcv9WuL1Ik/BN9L8bGDqC6bk1KufmwUba7ZdJ8ntuxvX AQp0eWUBMyTxSvWeZpBGC6Tlf8ytjeUombT7ZAsqehKjjSpxHvSPHm1FpfZzqqhY/yM/EbNG37MVb IE8vePBclk2nupuBMfYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFRhP-00HOrK-Du; Thu, 03 Feb 2022 02:18:15 +0000 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFRh1-00HOie-SR for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 02:17:53 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 465C12B001A5; Wed, 2 Feb 2022 21:17:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 02 Feb 2022 21:17:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; bh=TGiBQ7VmjM7mVAr+H+Xl3LR9ImpLbL k7tYOeYCfQiH4=; b=Yc0/g9AyUyVuRW3P3ICmzCgxGWL2k2t9skVOT+zcHXLPp7 Pm16SN4hRAs6qbP9/vMdnFluf9mavhfiriqX+ueZ9VrFy51m14SbMS/yefkDcbpD kIw+Xzg9fxJHxYaZacmXFyc1qiUteWh4OdbVFl/5v4fs2gGOkEWUcsbeTHvgQtBp EguMAogX6FHSg3ezktIxTOacwp0oiuQlXRdHqzjBtSSPmItYbMa+nLDQvFWsH5qA s+7yrPeZxxZOQFFeF4PfwmrpWRlifW/di3/Tv73JP2ya+Y86bvkQ6IYMeEKuXNP9 i+lzfpOLy2f8ytR+ro3q7KLmQRKbjL/7Id798Dgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=TGiBQ7 VmjM7mVAr+H+Xl3LR9ImpLbLk7tYOeYCfQiH4=; b=kFhwLSp/Pjl5lmAa8lxl64 u8xxaq4wu4pNr4/G6AOlazYIkv00xlBjeW5TnP3Xo37TWN/MqcC/x0OoFIkNLw/W nd/oOjVTezajRbtLdr7tgj23l230v8BEaQcygKn+AwVgczZSbuOQmJ/Vg1ge/HFI tNJHfnAyEWxxw3Pr/18C6pBtqUutN5H0r78Y5r8OO2nHIKruzCpT72grGPgbyspL 4KcTxLZ3JcE0y8mff6tHg/98kpF01wv50+11xUIcWIhkaVKKRLeoA2DPw7NnVcXe kbpL7he8SJ+35Q4pcwa1jlZLj20xkDra9vKldSo9eA/TDeojnBxKZNvBibUibNsg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeeigdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Feb 2022 21:17:48 -0500 (EST) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev Cc: Alessandro Zummo , Michael Turquette , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, Rob Herring , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Samuel Holland Subject: [PATCH v3 3/6] rtc: sun6i: Enable the bus clock when provided Date: Wed, 2 Feb 2022 20:17:33 -0600 Message-Id: <20220203021736.13434-4-samuel@sholland.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220203021736.13434-1-samuel@sholland.org> References: <20220203021736.13434-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_181751_962332_64316681 X-CRM114-Status: GOOD ( 16.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org H6 and newer variants of the RTC hardware have a bus clock gate in the PRCM CCU. This was not known at the time H6 support was added, so it was not included in the H6 RTC binding, nor in the H6 PRCM CCU driver. Now that this clock gate is documented, it is included in the A100 and D1 PRCM CCU drivers. Therefore, the RTC driver needs to have a consumer for the clock gate to prevent Linux from disabling it. Patch-changes: 3 - New patch for compatibility with new CCU drivers Signed-off-by: Samuel Holland --- (no changes since v1) drivers/rtc/rtc-sun6i.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 711832c758ae..d5a86cbb2e94 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -668,11 +668,35 @@ static int sun6i_rtc_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(sun6i_rtc_pm_ops, sun6i_rtc_suspend, sun6i_rtc_resume); +static void sun6i_rtc_bus_clk_cleanup(void *data) +{ + struct clk *bus_clk = data; + + clk_disable_unprepare(bus_clk); +} + static int sun6i_rtc_probe(struct platform_device *pdev) { struct sun6i_rtc_dev *chip = sun6i_rtc; + struct device *dev = &pdev->dev; + struct clk *bus_clk; int ret; + bus_clk = devm_clk_get_optional(dev, "bus"); + if (IS_ERR(bus_clk)) + return PTR_ERR(bus_clk); + + if (bus_clk) { + ret = clk_prepare_enable(bus_clk); + if (ret) + return ret; + + ret = devm_add_action_or_reset(dev, sun6i_rtc_bus_clk_cleanup, + bus_clk); + if (ret) + return ret; + } + if (!chip) { chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); if (!chip) -- 2.33.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel