Skip to content

Commit 54eb846

Browse files
committed
Merge tag 'rtc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "A new driver represents the bulk of the changes and then we get the usual small fixes. New driver: - Renesas RZN1 rtc Drivers: - sun6i: Add nvmem support" * tag 'rtc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: mxc: Silence a clang warning rtc: rzn1: Fix a variable type rtc: rzn1: Fix error code in probe rtc: rzn1: Avoid mixing variables rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe rtc: mt6397: check return value after calling platform_get_resource() rtc: rzn1: fix platform_no_drv_owner.cocci warning rtc: gamecube: Add missing iounmap in gamecube_rtc_read_offset_from_sram rtc: meson: Fix email address in MODULE_AUTHOR rtc: simplify the return expression of rx8025_set_offset() rtc: pcf85063: Add a compatible entry for pca85073a dt-binding: pcf85063: Add an entry for pca85073a MAINTAINERS: Add myself as maintainer of the RZN1 RTC driver rtc: rzn1: Add oscillator offset support rtc: rzn1: Add alarm support rtc: rzn1: Add new RTC driver dt-bindings: rtc: rzn1: Describe the RZN1 RTC rtc: sun6i: Add NVMEM provider
2 parents 55fe921 + f78e3d4 commit 54eb846

File tree

14 files changed

+579
-18
lines changed

14 files changed

+579
-18
lines changed

Documentation/devicetree/bindings/rtc/nxp,pcf85063.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Required properties:
44
- compatible: Should one of contain:
5+
"nxp,pca85073a",
56
"nxp,pcf85063",
67
"nxp,pcf85063a",
78
"nxp,pcf85063tp",
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/renesas,rzn1-rtc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Renesas RZ/N1 SoCs Real-Time Clock DT bindings
8+
9+
maintainers:
10+
- Miquel Raynal <[email protected]>
11+
12+
allOf:
13+
- $ref: rtc.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- enum:
19+
- renesas,r9a06g032-rtc
20+
- const: renesas,rzn1-rtc
21+
22+
reg:
23+
maxItems: 1
24+
25+
interrupts:
26+
minItems: 3
27+
maxItems: 3
28+
29+
interrupt-names:
30+
items:
31+
- const: alarm
32+
- const: timer
33+
- const: pps
34+
35+
clocks:
36+
maxItems: 1
37+
38+
clock-names:
39+
const: hclk
40+
41+
power-domains:
42+
maxItems: 1
43+
44+
required:
45+
- compatible
46+
- reg
47+
- interrupts
48+
- interrupt-names
49+
- clocks
50+
- clock-names
51+
- power-domains
52+
53+
unevaluatedProperties: false
54+
55+
examples:
56+
- |
57+
#include <dt-bindings/interrupt-controller/arm-gic.h>
58+
#include <dt-bindings/clock/r9a06g032-sysctrl.h>
59+
rtc@40006000 {
60+
compatible = "renesas,r9a06g032-rtc", "renesas,rzn1-rtc";
61+
reg = <0x40006000 0x1000>;
62+
interrupts = <GIC_SPI 66 IRQ_TYPE_EDGE_RISING>,
63+
<GIC_SPI 67 IRQ_TYPE_EDGE_RISING>,
64+
<GIC_SPI 68 IRQ_TYPE_EDGE_RISING>;
65+
interrupt-names = "alarm", "timer", "pps";
66+
clocks = <&sysctrl R9A06G032_HCLK_RTC>;
67+
clock-names = "hclk";
68+
power-domains = <&sysctrl>;
69+
start-year = <2000>;
70+
};

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16995,6 +16995,14 @@ S: Supported
1699516995
F: Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
1699616996
F: drivers/iio/adc/rzg2l_adc.c
1699716997

16998+
RENESAS RZ/N1 RTC CONTROLLER DRIVER
16999+
M: Miquel Raynal <[email protected]>
17000+
17001+
17002+
S: Maintained
17003+
F: Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
17004+
F: drivers/rtc/rtc-rzn1.c
17005+
1699817006
RENESAS R-CAR GEN3 & RZ/N1 NAND CONTROLLER DRIVER
1699917007
M: Miquel Raynal <[email protected]>
1700017008

drivers/rtc/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,13 @@ config RTC_DRV_RS5C313
15481548
help
15491549
If you say yes here you get support for the Ricoh RS5C313 RTC chips.
15501550

1551+
config RTC_DRV_RZN1
1552+
tristate "Renesas RZ/N1 RTC"
1553+
depends on ARCH_RZN1 || COMPILE_TEST
1554+
depends on OF && HAS_IOMEM
1555+
help
1556+
If you say yes here you get support for the Renesas RZ/N1 RTC.
1557+
15511558
config RTC_DRV_GENERIC
15521559
tristate "Generic RTC support"
15531560
# Please consider writing a new RTC driver instead of using the generic

drivers/rtc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ obj-$(CONFIG_RTC_DRV_RX6110) += rtc-rx6110.o
151151
obj-$(CONFIG_RTC_DRV_RX8010) += rtc-rx8010.o
152152
obj-$(CONFIG_RTC_DRV_RX8025) += rtc-rx8025.o
153153
obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o
154+
obj-$(CONFIG_RTC_DRV_RZN1) += rtc-rzn1.o
154155
obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o
155156
obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o
156157
obj-$(CONFIG_RTC_DRV_S5M) += rtc-s5m.o

drivers/rtc/rtc-ftrtc010.c

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,34 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
137137
ret = clk_prepare_enable(rtc->extclk);
138138
if (ret) {
139139
dev_err(dev, "failed to enable EXTCLK\n");
140-
return ret;
140+
goto err_disable_pclk;
141141
}
142142
}
143143

144144
rtc->rtc_irq = platform_get_irq(pdev, 0);
145-
if (rtc->rtc_irq < 0)
146-
return rtc->rtc_irq;
145+
if (rtc->rtc_irq < 0) {
146+
ret = rtc->rtc_irq;
147+
goto err_disable_extclk;
148+
}
147149

148150
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
149-
if (!res)
150-
return -ENODEV;
151+
if (!res) {
152+
ret = -ENODEV;
153+
goto err_disable_extclk;
154+
}
151155

152156
rtc->rtc_base = devm_ioremap(dev, res->start,
153157
resource_size(res));
154-
if (!rtc->rtc_base)
155-
return -ENOMEM;
158+
if (!rtc->rtc_base) {
159+
ret = -ENOMEM;
160+
goto err_disable_extclk;
161+
}
156162

157163
rtc->rtc_dev = devm_rtc_allocate_device(dev);
158-
if (IS_ERR(rtc->rtc_dev))
159-
return PTR_ERR(rtc->rtc_dev);
164+
if (IS_ERR(rtc->rtc_dev)) {
165+
ret = PTR_ERR(rtc->rtc_dev);
166+
goto err_disable_extclk;
167+
}
160168

161169
rtc->rtc_dev->ops = &ftrtc010_rtc_ops;
162170

@@ -172,9 +180,15 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
172180
ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
173181
IRQF_SHARED, pdev->name, dev);
174182
if (unlikely(ret))
175-
return ret;
183+
goto err_disable_extclk;
176184

177185
return devm_rtc_register_device(rtc->rtc_dev);
186+
187+
err_disable_extclk:
188+
clk_disable_unprepare(rtc->extclk);
189+
err_disable_pclk:
190+
clk_disable_unprepare(rtc->pclk);
191+
return ret;
178192
}
179193

180194
static int ftrtc010_rtc_remove(struct platform_device *pdev)

drivers/rtc/rtc-gamecube.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ static int gamecube_rtc_read_offset_from_sram(struct priv *d)
267267
ret = regmap_read(d->regmap, RTC_SRAM_BIAS, &d->rtc_bias);
268268
if (ret) {
269269
pr_err("failed to get the RTC bias\n");
270+
iounmap(hw_srnprot);
270271
return -1;
271272
}
272273

drivers/rtc/rtc-meson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static struct platform_driver meson_rtc_driver = {
399399
module_platform_driver(meson_rtc_driver);
400400

401401
MODULE_DESCRIPTION("Amlogic Meson RTC Driver");
402-
MODULE_AUTHOR("Ben Dooks <ben.doosk@codethink.co.uk>");
402+
MODULE_AUTHOR("Ben Dooks <ben.dooks@codethink.co.uk>");
403403
MODULE_AUTHOR("Martin Blumenstingl <[email protected]>");
404404
MODULE_LICENSE("GPL v2");
405405
MODULE_ALIAS("platform:meson-rtc");

drivers/rtc/rtc-mt6397.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ static int mtk_rtc_probe(struct platform_device *pdev)
269269
return -ENOMEM;
270270

271271
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
272+
if (!res)
273+
return -EINVAL;
272274
rtc->addr_base = res->start;
273275

274276
rtc->data = of_device_get_match_data(&pdev->dev);

drivers/rtc/rtc-mxc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
311311
if (!pdata)
312312
return -ENOMEM;
313313

314-
pdata->devtype = (enum imx_rtc_type)of_device_get_match_data(&pdev->dev);
314+
pdata->devtype = (uintptr_t)of_device_get_match_data(&pdev->dev);
315315

316316
pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
317317
if (IS_ERR(pdata->ioaddr))

drivers/rtc/rtc-pcf85063.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ static int pcf85063_probe(struct i2c_client *client)
650650
}
651651

652652
static const struct i2c_device_id pcf85063_ids[] = {
653+
{ "pca85073a", PCF85063A },
653654
{ "pcf85063", PCF85063 },
654655
{ "pcf85063tp", PCF85063TP },
655656
{ "pcf85063a", PCF85063A },
@@ -660,6 +661,7 @@ MODULE_DEVICE_TABLE(i2c, pcf85063_ids);
660661

661662
#ifdef CONFIG_OF
662663
static const struct of_device_id pcf85063_of_match[] = {
664+
{ .compatible = "nxp,pca85073a", .data = &pcf85063_cfg[PCF85063A] },
663665
{ .compatible = "nxp,pcf85063", .data = &pcf85063_cfg[PCF85063] },
664666
{ .compatible = "nxp,pcf85063tp", .data = &pcf85063_cfg[PCF85063TP] },
665667
{ .compatible = "nxp,pcf85063a", .data = &pcf85063_cfg[PCF85063A] },

drivers/rtc/rtc-rx8025.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ static int rx8025_set_offset(struct device *dev, long offset)
436436
{
437437
struct i2c_client *client = to_i2c_client(dev);
438438
u8 digoff;
439-
int err;
440439

441440
offset /= RX8025_ADJ_RESOLUTION;
442441
if (offset > RX8025_ADJ_DATA_MAX)
@@ -449,11 +448,7 @@ static int rx8025_set_offset(struct device *dev, long offset)
449448
offset += 128;
450449
digoff = offset;
451450

452-
err = rx8025_write_reg(client, RX8025_REG_DIGOFF, digoff);
453-
if (err)
454-
return err;
455-
456-
return 0;
451+
return rx8025_write_reg(client, RX8025_REG_DIGOFF, digoff);
457452
}
458453

459454
static const struct rtc_class_ops rx8025_rtc_ops = {

0 commit comments

Comments
 (0)