Skip to content

Commit 75242f3

Browse files
committed
Merge tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Two new drivers this cycle and a significant rework of the CMOS driver make the bulk of the changes. I also carry powerpc changes with the agreement of Michael. New drivers: - Sunplus SP7021 RTC - Nintendo GameCube, Wii and Wii U RTC Driver updates: - cmos: refactor UIP handling and presence check, fix century - rs5c372: offset correction support, report low voltage - rv8803: Epson RX8804 support" * tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (33 commits) rtc: sunplus: fix return value in sp_rtc_probe() rtc: cmos: Evaluate century appropriate rtc: gamecube: Fix an IS_ERR() vs NULL check rtc: mc146818-lib: fix signedness bug in mc146818_get_time() dt-bindings: rtc: qcom-pm8xxx-rtc: update register numbers rtc: pxa: fix null pointer dereference rtc: ftrtc010: Use platform_get_irq() to get the interrupt rtc: Move variable into switch case statement rtc: pcf2127: Fix typo in comment dt-bindings: rtc: Add Sunplus RTC json-schema rtc: Add driver for RTC in Sunplus SP7021 rtc: rs5c372: fix incorrect oscillation value on r2221tl rtc: rs5c372: add offset correction support rtc: cmos: avoid UIP when writing alarm time rtc: cmos: avoid UIP when reading alarm time rtc: mc146818-lib: refactor mc146818_does_rtc_work rtc: mc146818-lib: refactor mc146818_get_time rtc: mc146818-lib: extract mc146818_avoid_UIP rtc: mc146818-lib: fix RTC presence check rtc: Check return value from mc146818_get_time() ...
2 parents c2c94b3 + 5ceee54 commit 75242f3

File tree

25 files changed

+1390
-191
lines changed

25 files changed

+1390
-191
lines changed

Documentation/devicetree/bindings/rtc/epson,rx8900.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allOf:
1515
properties:
1616
compatible:
1717
enum:
18+
- epson,rx8804
1819
- epson,rx8900
1920
- microcrystal,rv8803
2021

Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ properties:
1919
- qcom,pmk8350-rtc
2020

2121
reg:
22-
maxItems: 1
22+
minItems: 1
23+
maxItems: 2
24+
25+
reg-names:
26+
minItems: 1
27+
items:
28+
- const: rtc
29+
- const: alarm
2330

2431
interrupts:
2532
maxItems: 1
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) Sunplus Co., Ltd. 2021
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/rtc/sunplus,sp7021-rtc.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Sunplus SP7021 Real Time Clock controller
9+
10+
maintainers:
11+
- Vincent Shih <vincent.sunplus@gmail.com>
12+
13+
properties:
14+
compatible:
15+
const: sunplus,sp7021-rtc
16+
17+
reg:
18+
maxItems: 1
19+
20+
reg-names:
21+
items:
22+
- const: rtc
23+
24+
clocks:
25+
maxItems: 1
26+
27+
resets:
28+
maxItems: 1
29+
30+
interrupts:
31+
maxItems: 1
32+
33+
required:
34+
- compatible
35+
- reg
36+
- reg-names
37+
- clocks
38+
- resets
39+
- interrupts
40+
41+
additionalProperties: false
42+
43+
examples:
44+
- |
45+
#include <dt-bindings/interrupt-controller/irq.h>
46+
47+
rtc: serial@9c003a00 {
48+
compatible = "sunplus,sp7021-rtc";
49+
reg = <0x9c003a00 0x80>;
50+
reg-names = "rtc";
51+
clocks = <&clkc 0x12>;
52+
resets = <&rstc 0x02>;
53+
interrupt-parent = <&intc>;
54+
interrupts = <163 IRQ_TYPE_EDGE_RISING>;
55+
};
56+
...

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18491,6 +18491,13 @@ L: netdev@vger.kernel.org
1849118491
S: Maintained
1849218492
F: drivers/net/ethernet/dlink/sundance.c
1849318493

18494+
SUNPLUS RTC DRIVER
18495+
M: Vincent Shih <vincent.sunplus@gmail.com>
18496+
L: linux-rtc@vger.kernel.org
18497+
S: Maintained
18498+
F: Documentation/devicetree/bindings/rtc/sunplus,sp7021-rtc.yaml
18499+
F: drivers/rtc/rtc-sunplus.c
18500+
1849418501
SUPERH
1849518502
M: Yoshinori Sato <ysato@users.sourceforge.jp>
1849618503
M: Rich Felker <dalias@libc.org>

arch/alpha/kernel/rtc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ init_rtc_epoch(void)
8080
static int
8181
alpha_rtc_read_time(struct device *dev, struct rtc_time *tm)
8282
{
83-
mc146818_get_time(tm);
83+
int ret = mc146818_get_time(tm);
84+
85+
if (ret < 0) {
86+
dev_err_ratelimited(dev, "unable to read current time\n");
87+
return ret;
88+
}
8489

8590
/* Adjust for non-default epochs. It's easier to depend on the
8691
generic __get_rtc_time and adjust the epoch here than create

arch/powerpc/boot/dts/wii.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@
168168
interrupts = <14>;
169169
};
170170

171+
srnprot@d800060 {
172+
compatible = "nintendo,hollywood-srnprot";
173+
reg = <0x0d800060 0x4>;
174+
};
175+
171176
GPIO: gpio@d8000c0 {
172177
#gpio-cells = <2>;
173178
compatible = "nintendo,hollywood-gpio";

arch/powerpc/configs/gamecube_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CONFIG_SND_SEQUENCER=y
6868
CONFIG_SND_SEQUENCER_OSS=y
6969
# CONFIG_USB_SUPPORT is not set
7070
CONFIG_RTC_CLASS=y
71-
CONFIG_RTC_DRV_GENERIC=y
71+
CONFIG_RTC_DRV_GAMECUBE=y
7272
CONFIG_EXT2_FS=y
7373
CONFIG_EXT4_FS=y
7474
CONFIG_ISO9660_FS=y

arch/powerpc/configs/wii_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ CONFIG_LEDS_TRIGGERS=y
9898
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
9999
CONFIG_LEDS_TRIGGER_PANIC=y
100100
CONFIG_RTC_CLASS=y
101-
CONFIG_RTC_DRV_GENERIC=y
101+
CONFIG_RTC_DRV_GAMECUBE=y
102102
CONFIG_NVMEM_NINTENDO_OTP=y
103103
CONFIG_EXT2_FS=y
104104
CONFIG_EXT4_FS=y

arch/x86/kernel/hpet.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,12 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
14351435
hpet_rtc_timer_reinit();
14361436
memset(&curr_time, 0, sizeof(struct rtc_time));
14371437

1438-
if (hpet_rtc_flags & (RTC_UIE | RTC_AIE))
1439-
mc146818_get_time(&curr_time);
1438+
if (hpet_rtc_flags & (RTC_UIE | RTC_AIE)) {
1439+
if (unlikely(mc146818_get_time(&curr_time) < 0)) {
1440+
pr_err_ratelimited("unable to read current time from RTC\n");
1441+
return IRQ_HANDLED;
1442+
}
1443+
}
14401444

14411445
if (hpet_rtc_flags & RTC_UIE &&
14421446
curr_time.tm_sec != hpet_prev_update_sec) {

drivers/base/power/trace.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ static unsigned int read_magic_time(void)
120120
struct rtc_time time;
121121
unsigned int val;
122122

123-
mc146818_get_time(&time);
123+
if (mc146818_get_time(&time) < 0) {
124+
pr_err("Unable to read current time from RTC\n");
125+
return 0;
126+
}
127+
124128
pr_info("RTC time: %ptRt, date: %ptRd\n", &time, &time);
125129
val = time.tm_year; /* 100 years */
126130
if (val > 100)

0 commit comments

Comments
 (0)