mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexandre.belloni@bootlin.com
To: Jacky Huang <ychuang3@nuvoton.com>,
	Shan-Chun Hung <schung@nuvoton.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
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	[thread overview]
Message-ID: <20231217225831.48581-1-alexandre.belloni@bootlin.com> (raw)

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

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 <alexandre.belloni@bootlin.com>
---
 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;
 }
 
-- 
2.43.0


                 reply	other threads:[~2023-12-17 22:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231217225831.48581-1-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=schung@nuvoton.com \
    --cc=ychuang3@nuvoton.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®