From patchwork Wed May 31 12:27:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie Delaunay X-Patchwork-Id: 13262138 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 7D951C7EE23 for ; Wed, 31 May 2023 12:28:09 +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: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:In-Reply-To:References: List-Owner; bh=W7kACZQg6dcsZMA1tR6b8Tz2vjE7ZQAv4mHs2ITokUA=; b=HO03xVnA8wLhoK Q25JMcqABplp+QyS13hn/EPcOGCqDAi44uO+NuCPCdPxZ7JcxVaDQkfZctXY2tammKioBLqfMeASL /k0R5JX3uc+xjmZ4YNRfBuiPnX3nKcy7Y4DvIfvunk6nGF5Owuv3h3en1aQFY+YJdwGtp/8exilS+ 3sk9YwyfpV6zGUzJ5I0IsQui8e+ppgst07RO/rTBNsoyB3Gvpk0IAy7k19mSzefQprFthl106efP5 6bH1Oeo4LqfEAvmfclqD+lxi8BbuPAqvnEyo2fvFsY86wNrJhJ2eipvEQXd1ZiNjbrCCIul8/NUbo lEIDBgatZ0XpTrsxTqvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4KvW-00HMPd-11; Wed, 31 May 2023 12:27:42 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4KvS-00HMOq-2r for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2023 12:27:40 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34VCJ43R010603; Wed, 31 May 2023 14:27:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=h7L5j+RUM3hQ2mgGUZnVH7FJKV90A51gfQKR4MF9lFk=; b=sPP6nP4UaqPo/lkWbNS+0p/cmLiyBKEooMxSguV/7ivMg2GXexyS3K6WOu92iJQeDSYN 6ZkFLb+lt5y8VdcNnQVcB19PtXhBH7W+jmFOViY4LOzRMEOJPQDYVso6sXwYOwG4UF3i EJL22blZDCLwAXBYxArP1Waf4dxdaNy/2oIwz4eQbuQAOs+H0A6gyhFynk4yMIVnHo5A 9O8EKlk4e7nM5/Nsz2iaZ46NXMmnD8mMbBxfkvCiT/N1WhDx5ibB1/as4yZedB0fRsTi 7Z0lWx/nF/djt1/AnMGyGuZwcWq6mAf6qyHnMQEzaHJHcSq4rM84SCc9yMQFxAXILnkT Cw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3qx314sh8r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 May 2023 14:27:33 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ABB8C10002A; Wed, 31 May 2023 14:27:32 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A21E6233C97; Wed, 31 May 2023 14:27:32 +0200 (CEST) Received: from localhost (10.252.9.126) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 31 May 2023 14:27:32 +0200 From: Amelie Delaunay To: Alessandro Zummo , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue CC: Amelie Delaunay , , , , Subject: [PATCH] rtc: stm32: remove dedicated wakeup management Date: Wed, 31 May 2023 14:27:31 +0200 Message-ID: <20230531122732.1515594-1-amelie.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.252.9.126] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-31_08,2023-05-31_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230531_052739_237988_890193D3 X-CRM114-Status: GOOD ( 21.47 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alexandre Torgue There is no more needs to use a dedicated wake up interrupt for RTC as EXTI block manages by itself now all interrupt lines. Dedicated wakeup interrupt has been introduced with STM32 MP1 support commit b72252b6580c ("rtc: stm32: add stm32mp1 rtc support") because GIC & EXTI interrupts were not yet linked in EXTI driver. Removing this interrupt won't break compatibility with device trees which do use two interrupts entries: it could only prevent wakeup from low power modes on STM32MP1x, but platform power management is not yet available. Signed-off-by: Alexandre Torgue Signed-off-by: Amelie Delaunay --- drivers/rtc/rtc-stm32.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 229cb2847cc4..3d36e11cff80 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -114,7 +114,6 @@ struct stm32_rtc_data { void (*clear_events)(struct stm32_rtc *rtc, unsigned int flags); bool has_pclk; bool need_dbp; - bool has_wakeirq; }; struct stm32_rtc { @@ -127,7 +126,6 @@ struct stm32_rtc { struct clk *rtc_ck; const struct stm32_rtc_data *data; int irq_alarm; - int wakeirq_alarm; }; static void stm32_rtc_wpr_unlock(struct stm32_rtc *rtc) @@ -547,7 +545,6 @@ static void stm32_rtc_clear_events(struct stm32_rtc *rtc, static const struct stm32_rtc_data stm32_rtc_data = { .has_pclk = false, .need_dbp = true, - .has_wakeirq = false, .regs = { .tr = 0x00, .dr = 0x04, @@ -569,7 +566,6 @@ static const struct stm32_rtc_data stm32_rtc_data = { static const struct stm32_rtc_data stm32h7_rtc_data = { .has_pclk = true, .need_dbp = true, - .has_wakeirq = false, .regs = { .tr = 0x00, .dr = 0x04, @@ -600,7 +596,6 @@ static void stm32mp1_rtc_clear_events(struct stm32_rtc *rtc, static const struct stm32_rtc_data stm32mp1_data = { .has_pclk = true, .need_dbp = false, - .has_wakeirq = true, .regs = { .tr = 0x00, .dr = 0x04, @@ -779,19 +774,12 @@ static int stm32_rtc_probe(struct platform_device *pdev) } ret = device_init_wakeup(&pdev->dev, true); - if (rtc->data->has_wakeirq) { - rtc->wakeirq_alarm = platform_get_irq(pdev, 1); - if (rtc->wakeirq_alarm > 0) { - ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, - rtc->wakeirq_alarm); - } else { - ret = rtc->wakeirq_alarm; - if (rtc->wakeirq_alarm == -EPROBE_DEFER) - goto err; - } - } if (ret) - dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret); + goto err; + + ret = dev_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm); + if (ret) + goto err; platform_set_drvdata(pdev, rtc); @@ -879,9 +867,6 @@ static int stm32_rtc_suspend(struct device *dev) if (rtc->data->has_pclk) clk_disable_unprepare(rtc->pclk); - if (device_may_wakeup(dev)) - return enable_irq_wake(rtc->irq_alarm); - return 0; } @@ -903,9 +888,6 @@ static int stm32_rtc_resume(struct device *dev) return ret; } - if (device_may_wakeup(dev)) - return disable_irq_wake(rtc->irq_alarm); - return ret; } #endif