]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.117/rtc-da9063-set-uie_unsupported-when-relevant.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.117 / rtc-da9063-set-uie_unsupported-when-relevant.patch
CommitLineData
b28724f3
SL
1From 710cf8dd462dbab9e67a9e1af219c2a8435ae8dc Mon Sep 17 00:00:00 2001
2From: Alexandre Belloni <alexandre.belloni@bootlin.com>
3Date: Tue, 2 Apr 2019 12:26:36 +0200
4Subject: rtc: da9063: set uie_unsupported when relevant
5
6[ Upstream commit 882c5e552ffd06856de42261460f46e18319d259 ]
7
8The DA9063AD doesn't support alarms on any seconds and its granularity is
9the minute. Set uie_unsupported in that case.
10
11Reported-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
12Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
13Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
14Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
15Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
16Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
17Signed-off-by: Sasha Levin <sashal@kernel.org>
18---
19 drivers/rtc/rtc-da9063.c | 7 +++++++
20 1 file changed, 7 insertions(+)
21
22diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
23index f85cae240f12..7e92e491c2e7 100644
24--- a/drivers/rtc/rtc-da9063.c
25+++ b/drivers/rtc/rtc-da9063.c
26@@ -480,6 +480,13 @@ static int da9063_rtc_probe(struct platform_device *pdev)
27 da9063_data_to_tm(data, &rtc->alarm_time, rtc);
28 rtc->rtc_sync = false;
29
30+ /*
31+ * TODO: some models have alarms on a minute boundary but still support
32+ * real hardware interrupts. Add this once the core supports it.
33+ */
34+ if (config->rtc_data_start != RTC_SEC)
35+ rtc->rtc_dev->uie_unsupported = 1;
36+
37 irq_alarm = platform_get_irq_byname(pdev, "ALARM");
38 ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
39 da9063_alarm_event,
40--
412.20.1
42