Skip to content

Commit 0328b5f

Browse files
committed
Merge tag 'rtc-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Many cleanups and a few drivers removal this cycle. Subsystem: - Introduce features bitfield and the first feature: RTC_FEATURE_ALARM Removed drivers: - ab3100 - coh901331 - tx4939 - sirfsoc Drivers: - use rtc_lock and rtc_unlock instead of opencoding - constify all struct rtc_class_ops - quiet maybe-unused variable warning - replace spin_lock_irqsave with spin_lock in hard IRQ - pcf2127: disable Power-On Reset Override and run OTP refresh" * tag 'rtc-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (81 commits) rtc: abx80x: Add utility function for writing configuration key rtc: pcf2127: properly set flag WD_CD for rtc chips(pcf2129, pca2129) rtc: pcf8563: Add NXP PCA8565 compatible rtc: s3c: quiet maybe-unused variable warning rtc: s3c: stop setting bogus time rtc: sd3078: quiet maybe-unused variable warning rtc: s35390a: quiet maybe-unused variable warning rtc: rx8581: quiet maybe-unused variable warning rtc: rx8010: quiet maybe-unused variable warning rtc: rv8803: quiet maybe-unused variable warning rtc: rv3032: quiet maybe-unused variable warning rtc: rv3029: quiet maybe-unused variable warning rtc: rv3028: quiet maybe-unused variable warning rtc: rs5c372: quiet maybe-unused variable warning rtc: pcf85363: quiet maybe-unused variable warning rtc: pcf85063: quiet maybe-unused variable warnings rtc: meson: quiet maybe-unused variable warning rtc: m41t80: quiet maybe-unused variable warning rtc: isl1208: quiet maybe-unused variable warning rtc: ds3232: quiet maybe-unused variable warning ...
2 parents 36c1b20 + 49dfc1f commit 0328b5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+321
-1717
lines changed

Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
- atmel,sama5d4-rtc
2121
- atmel,sama5d2-rtc
2222
- microchip,sam9x60-rtc
23+
- microchip,sama7g5-rtc
2324

2425
reg:
2526
maxItems: 1
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/nxp,pcf2127.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP PCF2127 Real Time Clock
8+
9+
allOf:
10+
- $ref: "rtc.yaml#"
11+
12+
maintainers:
13+
- Alexandre Belloni <[email protected]>
14+
15+
properties:
16+
compatible:
17+
const: nxp,pcf2127
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
start-year: true
26+
27+
reset-source: true
28+
29+
required:
30+
- compatible
31+
- reg
32+
33+
additionalProperties: false
34+
35+
examples:
36+
- |
37+
#include <dt-bindings/interrupt-controller/irq.h>
38+
i2c {
39+
#address-cells = <1>;
40+
#size-cells = <0>;
41+
42+
rtc@51 {
43+
compatible = "nxp,pcf2127";
44+
reg = <0x51>;
45+
pinctrl-0 = <&rtc_nint_pins>;
46+
interrupts-extended = <&gpio1 16 IRQ_TYPE_LEVEL_HIGH>;
47+
reset-source;
48+
};
49+
};
50+
51+
...

Documentation/devicetree/bindings/rtc/pcf8563.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Philips PCF8563/Epson RTC8564 Real Time Clock
55
Required properties:
66
- compatible: Should contain "nxp,pcf8563",
77
"epson,rtc8564" or
8-
"microcrystal,rv8564"
8+
"microcrystal,rv8564" or
9+
"nxp,pca8565"
910
- reg: I2C address for chip.
1011

1112
Optional property:

Documentation/devicetree/bindings/rtc/sirf,prima2-sysrtc.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

Documentation/devicetree/bindings/rtc/stericsson,coh901331.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

Documentation/devicetree/bindings/rtc/trivial-rtc.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ properties:
4848
- microcrystal,rv3029
4949
# Real Time Clock
5050
- microcrystal,rv8523
51-
# Real-time clock
52-
- nxp,pcf2127
53-
# Real-time clock
54-
- nxp,pcf2129
55-
# Real-time clock
5651
- nxp,pca2129
52+
- nxp,pcf2129
5753
# Real-time Clock Module
5854
- pericom,pt7c4338
5955
# I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC

drivers/rtc/Kconfig

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ config RTC_DRV_S5M
692692
tristate "Samsung S2M/S5M series"
693693
depends on MFD_SEC_CORE || COMPILE_TEST
694694
select REGMAP_IRQ
695+
select REGMAP_I2C
695696
help
696697
If you say yes here you will get support for the
697698
RTC of Samsung S2MPS14 and S5M PMIC series.
@@ -1258,14 +1259,6 @@ config RTC_DRV_PCF50633
12581259
If you say yes here you get support for the RTC subsystem of the
12591260
NXP PCF50633 used in embedded systems.
12601261

1261-
config RTC_DRV_AB3100
1262-
tristate "ST-Ericsson AB3100 RTC"
1263-
depends on AB3100_CORE
1264-
default y if AB3100_CORE
1265-
help
1266-
Select this to enable the ST-Ericsson AB3100 Mixed Signal IC RTC
1267-
support. This chip contains a battery- and capacitor-backed RTC.
1268-
12691262
config RTC_DRV_AB8500
12701263
tristate "ST-Ericsson AB8500 RTC"
12711264
depends on AB8500_CORE
@@ -1288,7 +1281,7 @@ config RTC_DRV_OPAL
12881281

12891282
config RTC_DRV_ZYNQMP
12901283
tristate "Xilinx Zynq Ultrascale+ MPSoC RTC"
1291-
depends on OF
1284+
depends on OF && HAS_IOMEM
12921285
help
12931286
If you say yes here you get support for the RTC controller found on
12941287
Xilinx Zynq Ultrascale+ MPSoC.
@@ -1575,13 +1568,6 @@ config RTC_DRV_STARFIRE
15751568
If you say Y here you will get support for the RTC found on
15761569
Starfire systems.
15771570

1578-
config RTC_DRV_TX4939
1579-
tristate "TX4939 SoC"
1580-
depends on SOC_TX4939 || COMPILE_TEST
1581-
help
1582-
Driver for the internal RTC (Realtime Clock) module found on
1583-
Toshiba TX4939 SoC.
1584-
15851571
config RTC_DRV_MV
15861572
tristate "Marvell SoC RTC"
15871573
depends on ARCH_DOVE || ARCH_MVEBU || COMPILE_TEST
@@ -1596,6 +1582,7 @@ config RTC_DRV_MV
15961582
config RTC_DRV_ARMADA38X
15971583
tristate "Armada 38x Marvell SoC RTC"
15981584
depends on ARCH_MVEBU || COMPILE_TEST
1585+
depends on OF
15991586
help
16001587
If you say yes here you will get support for the in-chip RTC
16011588
that can be found in the Armada 38x Marvell's SoC device
@@ -1633,18 +1620,6 @@ config RTC_DRV_PS3
16331620
This driver can also be built as a module. If so, the module
16341621
will be called rtc-ps3.
16351622

1636-
config RTC_DRV_COH901331
1637-
tristate "ST-Ericsson COH 901 331 RTC"
1638-
depends on ARCH_U300 || COMPILE_TEST
1639-
help
1640-
If you say Y here you will get access to ST-Ericsson
1641-
COH 901 331 RTC clock found in some ST-Ericsson Mobile
1642-
Platforms.
1643-
1644-
This driver can also be built as a module. If so, the module
1645-
will be called "rtc-coh901331".
1646-
1647-
16481623
config RTC_DRV_STMP
16491624
tristate "Freescale STMP3xxx/i.MX23/i.MX28 RTC"
16501625
depends on ARCH_MXS || COMPILE_TEST
@@ -1787,13 +1762,6 @@ config RTC_DRV_IMX_SC
17871762
If you say yes here you get support for the NXP i.MX System
17881763
Controller RTC module.
17891764

1790-
config RTC_DRV_SIRFSOC
1791-
tristate "SiRFSOC RTC"
1792-
depends on ARCH_SIRF
1793-
help
1794-
Say "yes" here to support the real time clock on SiRF SOC chips.
1795-
This driver can also be built as a module called rtc-sirfsoc.
1796-
17971765
config RTC_DRV_ST_LPC
17981766
tristate "STMicroelectronics LPC RTC"
17991767
depends on ARCH_STI

drivers/rtc/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ rtc-core-$(CONFIG_RTC_INTF_SYSFS) += sysfs.o
1919

2020
obj-$(CONFIG_RTC_DRV_88PM80X) += rtc-88pm80x.o
2121
obj-$(CONFIG_RTC_DRV_88PM860X) += rtc-88pm860x.o
22-
obj-$(CONFIG_RTC_DRV_AB3100) += rtc-ab3100.o
2322
obj-$(CONFIG_RTC_DRV_AB8500) += rtc-ab8500.o
2423
obj-$(CONFIG_RTC_DRV_ABB5ZES3) += rtc-ab-b5ze-s3.o
2524
obj-$(CONFIG_RTC_DRV_ABEOZ9) += rtc-ab-eoz9.o
@@ -38,7 +37,6 @@ obj-$(CONFIG_RTC_DRV_BQ4802) += rtc-bq4802.o
3837
obj-$(CONFIG_RTC_DRV_BRCMSTB) += rtc-brcmstb-waketimer.o
3938
obj-$(CONFIG_RTC_DRV_CADENCE) += rtc-cadence.o
4039
obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o
41-
obj-$(CONFIG_RTC_DRV_COH901331) += rtc-coh901331.o
4240
obj-$(CONFIG_RTC_DRV_CPCAP) += rtc-cpcap.o
4341
obj-$(CONFIG_RTC_DRV_CROS_EC) += rtc-cros-ec.o
4442
obj-$(CONFIG_RTC_DRV_DA9052) += rtc-da9052.o
@@ -154,7 +152,6 @@ obj-$(CONFIG_RTC_DRV_SA1100) += rtc-sa1100.o
154152
obj-$(CONFIG_RTC_DRV_SC27XX) += rtc-sc27xx.o
155153
obj-$(CONFIG_RTC_DRV_SD3078) += rtc-sd3078.o
156154
obj-$(CONFIG_RTC_DRV_SH) += rtc-sh.o
157-
obj-$(CONFIG_RTC_DRV_SIRFSOC) += rtc-sirfsoc.o
158155
obj-$(CONFIG_RTC_DRV_SNVS) += rtc-snvs.o
159156
obj-$(CONFIG_RTC_DRV_SPEAR) += rtc-spear.o
160157
obj-$(CONFIG_RTC_DRV_STARFIRE) += rtc-starfire.o
@@ -171,7 +168,6 @@ obj-$(CONFIG_RTC_DRV_TPS6586X) += rtc-tps6586x.o
171168
obj-$(CONFIG_RTC_DRV_TPS65910) += rtc-tps65910.o
172169
obj-$(CONFIG_RTC_DRV_TPS80031) += rtc-tps80031.o
173170
obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl.o
174-
obj-$(CONFIG_RTC_DRV_TX4939) += rtc-tx4939.o
175171
obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o
176172
obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o
177173
obj-$(CONFIG_RTC_DRV_VT8500) += rtc-vt8500.o

drivers/rtc/class.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ static struct rtc_device *rtc_allocate_device(void)
231231
rtc->pie_timer.function = rtc_pie_update_irq;
232232
rtc->pie_enabled = 0;
233233

234+
set_bit(RTC_FEATURE_ALARM, rtc->features);
235+
234236
return rtc;
235237
}
236238

@@ -322,11 +324,6 @@ static void rtc_device_get_offset(struct rtc_device *rtc)
322324
rtc->offset_secs = 0;
323325
}
324326

325-
/**
326-
* rtc_device_unregister - removes the previously registered RTC class device
327-
*
328-
* @rtc: the RTC class device to destroy
329-
*/
330327
static void devm_rtc_unregister_device(void *data)
331328
{
332329
struct rtc_device *rtc = data;
@@ -386,6 +383,9 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
386383
return -EINVAL;
387384
}
388385

386+
if (!rtc->ops->set_alarm)
387+
clear_bit(RTC_FEATURE_ALARM, rtc->features);
388+
389389
rtc->owner = owner;
390390
rtc_device_get_offset(rtc);
391391

drivers/rtc/interface.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int rtc_read_alarm_internal(struct rtc_device *rtc,
186186

187187
if (!rtc->ops) {
188188
err = -ENODEV;
189-
} else if (!rtc->ops->read_alarm) {
189+
} else if (!test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->read_alarm) {
190190
err = -EINVAL;
191191
} else {
192192
alarm->enabled = 0;
@@ -392,7 +392,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
392392
return err;
393393
if (!rtc->ops) {
394394
err = -ENODEV;
395-
} else if (!rtc->ops->read_alarm) {
395+
} else if (!test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->read_alarm) {
396396
err = -EINVAL;
397397
} else {
398398
memset(alarm, 0, sizeof(struct rtc_wkalrm));
@@ -436,7 +436,7 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
436436

437437
if (!rtc->ops)
438438
err = -ENODEV;
439-
else if (!rtc->ops->set_alarm)
439+
else if (!test_bit(RTC_FEATURE_ALARM, rtc->features))
440440
err = -EINVAL;
441441
else
442442
err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
@@ -451,7 +451,7 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
451451

452452
if (!rtc->ops)
453453
return -ENODEV;
454-
else if (!rtc->ops->set_alarm)
454+
else if (!test_bit(RTC_FEATURE_ALARM, rtc->features))
455455
return -EINVAL;
456456

457457
err = rtc_valid_tm(&alarm->time);
@@ -531,7 +531,7 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
531531
/* nothing */;
532532
else if (!rtc->ops)
533533
err = -ENODEV;
534-
else if (!rtc->ops->alarm_irq_enable)
534+
else if (!test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->alarm_irq_enable)
535535
err = -EINVAL;
536536
else
537537
err = rtc->ops->alarm_irq_enable(rtc->dev.parent, enabled);
@@ -843,7 +843,7 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
843843

844844
static void rtc_alarm_disable(struct rtc_device *rtc)
845845
{
846-
if (!rtc->ops || !rtc->ops->alarm_irq_enable)
846+
if (!rtc->ops || !test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->alarm_irq_enable)
847847
return;
848848

849849
rtc->ops->alarm_irq_enable(rtc->dev.parent, false);

0 commit comments

Comments
 (0)