From patchwork Sun Dec 17 22:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 13496042 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 400AAC3DA6E for ; Sun, 17 Dec 2023 22:59:16 +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=26mTRYLcBDvA2Dl1B/PqlIulblGeAm/uX6Q1txtCng0=; b=CRAJQ3EcVsmSDK 7XjxolF+rZY1N1RlyPWI+CPH7JMe0THKDZLe/72QUF6Lo2O5W0xlUUoXtB9RkzF84a8r7bM2xy7nk 6UNrqGZq4Taa54nU/vIqcs2ver2nHZPi9gJ/K6nK65oi3vcjw9Ctiogp4nMCPq65SH6PLNYQVEKmt kUfV8zCgZVqnPLaw4JLDPbXwZmHx0f6QE7O2+28t8oKjPAWisgUuwleeJwemvEmhslgtIx2mbrz1T bcdDiRJjHf+yWDuHgaPZ1bEfGqXvwKyQ1XISZJKLNQB58UFyWSZWpE9wT2TI7fCqFKoD7EnU9qodN D5C3Y7mtq6DjFZwcUHZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rF05z-008c3B-03; Sun, 17 Dec 2023 22:58:51 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rF05w-008c2m-0e for linux-arm-kernel@lists.infradead.org; Sun, 17 Dec 2023 22:58:49 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 71F9760004; Sun, 17 Dec 2023 22:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702853924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=IQbh91Xrwj+XG2jTq6iRDOWVcyvbuHgrs5HvatgUSrc=; b=kifrvNde1i9hU4dFxuMgi3J68tZjl0w+EDtS+r3gkeQib1fNBg4aB9MiEgyYciX0wwDJO/ s6iZbG/YqmCSSv05N8ycNST70qJNOimGJngBNtXtwlgdSZYRTi495rzjiJRKPiEUiHhCKj FGYYmYMIldfQa9ofSTLAwa1ps2hTwlafU8wwvg6U8kDSoZrdFQ5sPTQyKMX8uiiXvsEDQV F041+y/4yeFBxBvMuB3xvU2YQZjteTO543LG94evexntcqfVzEGYTMRnArZQp6nMLJEvGJ nRE9bnqVRsBxYhKX7m/OOod4+6orcABZW69UDXb6sw7uA4sGkDj71+3tB8VMKw== From: alexandre.belloni@bootlin.com To: Jacky Huang , Shan-Chun Hung , Alessandro Zummo , Alexandre Belloni Cc: linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: ma35d1: remove hardcoded UIE support Date: Sun, 17 Dec 2023 23:58:31 +0100 Message-ID: <20231217225831.48581-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231217_145848_393682_1927A377 X-CRM114-Status: GOOD ( 10.50 ) 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 Belloni Let the core handle UIE instead of enabling it forcefully at probe which means the RTC will generate an interrupt every second even when nobody cares. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ma35d1.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/rtc/rtc-ma35d1.c b/drivers/rtc/rtc-ma35d1.c index 07c9a083a9d5..cfcfc28060f6 100644 --- a/drivers/rtc/rtc-ma35d1.c +++ b/drivers/rtc/rtc-ma35d1.c @@ -79,11 +79,6 @@ static irqreturn_t ma35d1_rtc_interrupt(int irq, void *data) events |= RTC_AF | RTC_IRQF; } - if (rtc_irq & RTC_INTSTS_UIF) { - rtc_reg_write(rtc, MA35_REG_RTC_INTSTS, RTC_INTSTS_UIF); - events |= RTC_UF | RTC_IRQF; - } - rtc_update_irq(rtc->rtcdev, 1, events); return IRQ_HANDLED; @@ -216,7 +211,6 @@ static int ma35d1_rtc_probe(struct platform_device *pdev) { struct ma35_rtc *rtc; struct clk *clk; - u32 regval; int ret; rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); @@ -264,40 +258,26 @@ static int ma35d1_rtc_probe(struct platform_device *pdev) if (ret) return dev_err_probe(&pdev->dev, ret, "Failed to register rtc device\n"); - regval = rtc_reg_read(rtc, MA35_REG_RTC_INTEN); - regval |= RTC_INTEN_UIEN; - rtc_reg_write(rtc, MA35_REG_RTC_INTEN, regval); - return 0; } static int ma35d1_rtc_suspend(struct platform_device *pdev, pm_message_t state) { struct ma35_rtc *rtc = platform_get_drvdata(pdev); - u32 regval; if (device_may_wakeup(&pdev->dev)) enable_irq_wake(rtc->irq_num); - regval = rtc_reg_read(rtc, MA35_REG_RTC_INTEN); - regval &= ~RTC_INTEN_UIEN; - rtc_reg_write(rtc, MA35_REG_RTC_INTEN, regval); - return 0; } static int ma35d1_rtc_resume(struct platform_device *pdev) { struct ma35_rtc *rtc = platform_get_drvdata(pdev); - u32 regval; if (device_may_wakeup(&pdev->dev)) disable_irq_wake(rtc->irq_num); - regval = rtc_reg_read(rtc, MA35_REG_RTC_INTEN); - regval |= RTC_INTEN_UIEN; - rtc_reg_write(rtc, MA35_REG_RTC_INTEN, regval); - return 0; }