Skip to content

Commit 7846b61

Browse files
committed
Merge tag 'rtc-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Subsystem: - add missing MODULE_DESCRIPTION() macro - fix offset addition for alarms Drivers: - isl1208: alarm clearing fixes - mcp794xx: oscillator failure detection - stm32: stm32mp25 support - tps6594: power management support" * tag 'rtc-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: stm32: add new st,stm32mp25-rtc compatible and check RIF configuration dt-bindings: rtc: stm32: introduce new st,stm32mp25-rtc compatible rtc: Drop explicit initialization of struct i2c_device_id::driver_data to 0 rtc: interface: Add RTC offset to alarm after fix-up rtc: ds1307: Clamp year to valid BCD (0-99) in `set_time()` rtc: ds1307: Detect oscillator fail on mcp794xx rtc: isl1208: Update correct procedure for clearing alarm rtc: isl1208: Add a delay for clearing alarm dt-bindings: rtc: Convert rtc-fsl-ftm-alarm.txt to yaml format rtc: add missing MODULE_DESCRIPTION() macro rtc: abx80x: Fix return value of nvmem callback on read rtc: cmos: Fix return value of nvmem callbacks rtc: isl1208: Fix return value of nvmem callbacks rtc: tps6594: Add power management support rtc: tps6594: introduce private structure as drvdata rtc: tps6594: Fix memleak in probe
2 parents 33c9de2 + efa9c5b commit 7846b61

40 files changed

+299
-103
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/fsl,ls-ftm-alarm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Freescale FlexTimer Module (FTM) Alarm
8+
9+
maintainers:
10+
- Frank Li <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- fsl,ls1012a-ftm-alarm
16+
- fsl,ls1021a-ftm-alarm
17+
- fsl,ls1028a-ftm-alarm
18+
- fsl,ls1043a-ftm-alarm
19+
- fsl,ls1046a-ftm-alarm
20+
- fsl,ls1088a-ftm-alarm
21+
- fsl,ls208xa-ftm-alarm
22+
- fsl,lx2160a-ftm-alarm
23+
24+
reg:
25+
maxItems: 1
26+
27+
interrupts:
28+
maxItems: 1
29+
30+
fsl,rcpm-wakeup:
31+
$ref: /schemas/types.yaml#/definitions/phandle-array
32+
items:
33+
- items:
34+
- description: phandle to rcpm node
35+
- description: bit mask of IPPDEXPCR0
36+
- description: bit mask of IPPDEXPCR1
37+
- description: bit mask of IPPDEXPCR2
38+
- description: bit mask of IPPDEXPCR3
39+
- description: bit mask of IPPDEXPCR4
40+
- description: bit mask of IPPDEXPCR5
41+
- description: bit mask of IPPDEXPCR6
42+
minItems: 1
43+
description:
44+
phandle to rcpm node, Please refer
45+
Documentation/devicetree/bindings/soc/fsl/rcpm.txt
46+
47+
big-endian:
48+
$ref: /schemas/types.yaml#/definitions/flag
49+
description:
50+
If the host controller is big-endian mode, specify this property.
51+
The default endian mode is little-endian.
52+
53+
required:
54+
- compatible
55+
- reg
56+
- interrupts
57+
- fsl,rcpm-wakeup
58+
59+
allOf:
60+
- $ref: rtc.yaml#
61+
62+
unevaluatedProperties: false
63+
64+
examples:
65+
- |
66+
#include <dt-bindings/interrupt-controller/arm-gic.h>
67+
68+
rtc@2800000 {
69+
compatible = "fsl,ls1088a-ftm-alarm";
70+
reg = <0x2800000 0x10000>;
71+
fsl,rcpm-wakeup = <&rcpm 0x0 0x0 0x0 0x0 0x4000 0x0>;
72+
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
73+
};

Documentation/devicetree/bindings/rtc/rtc-fsl-ftm-alarm.txt

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

Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ properties:
1515
- st,stm32-rtc
1616
- st,stm32h7-rtc
1717
- st,stm32mp1-rtc
18+
- st,stm32mp25-rtc
1819

1920
reg:
2021
maxItems: 1
@@ -90,7 +91,9 @@ allOf:
9091
properties:
9192
compatible:
9293
contains:
93-
const: st,stm32mp1-rtc
94+
enum:
95+
- st,stm32mp1-rtc
96+
- st,stm32mp25-rtc
9497

9598
then:
9699
properties:

drivers/rtc/interface.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,9 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
274274
return err;
275275

276276
/* full-function RTCs won't have such missing fields */
277-
if (rtc_valid_tm(&alarm->time) == 0) {
278-
rtc_add_offset(rtc, &alarm->time);
279-
return 0;
280-
}
277+
err = rtc_valid_tm(&alarm->time);
278+
if (!err)
279+
goto done;
281280

282281
/* get the "after" timestamp, to detect wrapped fields */
283282
err = rtc_read_time(rtc, &now);
@@ -379,6 +378,8 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
379378
if (err && alarm->enabled)
380379
dev_warn(&rtc->dev, "invalid alarm value: %ptR\n",
381380
&alarm->time);
381+
else
382+
rtc_add_offset(rtc, &alarm->time);
382383

383384
return err;
384385
}

drivers/rtc/lib_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ static struct kunit_suite rtc_lib_test_suite = {
9797

9898
kunit_test_suite(rtc_lib_test_suite);
9999

100+
MODULE_DESCRIPTION("KUnit test for RTC lib functions");
100101
MODULE_LICENSE("GPL");

drivers/rtc/rtc-ab-b5ze-s3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ MODULE_DEVICE_TABLE(of, abb5zes3_dt_match);
933933
#endif
934934

935935
static const struct i2c_device_id abb5zes3_id[] = {
936-
{ "abb5zes3", 0 },
936+
{ "abb5zes3" },
937937
{ }
938938
};
939939
MODULE_DEVICE_TABLE(i2c, abb5zes3_id);

drivers/rtc/rtc-ab-eoz9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ MODULE_DEVICE_TABLE(of, abeoz9_dt_match);
575575
#endif
576576

577577
static const struct i2c_device_id abeoz9_id[] = {
578-
{ "abeoz9", 0 },
578+
{ "abeoz9" },
579579
{ }
580580
};
581581

drivers/rtc/rtc-abx80x.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,18 @@ static int abx80x_nvmem_xfer(struct abx80x_priv *priv, unsigned int offset,
705705
if (ret)
706706
return ret;
707707

708-
if (write)
708+
if (write) {
709709
ret = i2c_smbus_write_i2c_block_data(priv->client, reg,
710710
len, val);
711-
else
711+
if (ret)
712+
return ret;
713+
} else {
712714
ret = i2c_smbus_read_i2c_block_data(priv->client, reg,
713715
len, val);
714-
if (ret)
715-
return ret;
716+
if (ret <= 0)
717+
return ret ? ret : -EIO;
718+
len = ret;
719+
}
716720

717721
offset += len;
718722
val += len;

drivers/rtc/rtc-bq32k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static void bq32k_remove(struct i2c_client *client)
304304
}
305305

306306
static const struct i2c_device_id bq32k_id[] = {
307-
{ "bq32000", 0 },
307+
{ "bq32000" },
308308
{ }
309309
};
310310
MODULE_DEVICE_TABLE(i2c, bq32k_id);

drivers/rtc/rtc-cmos.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,10 @@ static int cmos_nvram_read(void *priv, unsigned int off, void *val,
643643
size_t count)
644644
{
645645
unsigned char *buf = val;
646-
int retval;
647646

648647
off += NVRAM_OFFSET;
649648
spin_lock_irq(&rtc_lock);
650-
for (retval = 0; count; count--, off++, retval++) {
649+
for (; count; count--, off++) {
651650
if (off < 128)
652651
*buf++ = CMOS_READ(off);
653652
else if (can_bank2)
@@ -657,15 +656,14 @@ static int cmos_nvram_read(void *priv, unsigned int off, void *val,
657656
}
658657
spin_unlock_irq(&rtc_lock);
659658

660-
return retval;
659+
return count ? -EIO : 0;
661660
}
662661

663662
static int cmos_nvram_write(void *priv, unsigned int off, void *val,
664663
size_t count)
665664
{
666665
struct cmos_rtc *cmos = priv;
667666
unsigned char *buf = val;
668-
int retval;
669667

670668
/* NOTE: on at least PCs and Ataris, the boot firmware uses a
671669
* checksum on part of the NVRAM data. That's currently ignored
@@ -674,7 +672,7 @@ static int cmos_nvram_write(void *priv, unsigned int off, void *val,
674672
*/
675673
off += NVRAM_OFFSET;
676674
spin_lock_irq(&rtc_lock);
677-
for (retval = 0; count; count--, off++, retval++) {
675+
for (; count; count--, off++) {
678676
/* don't trash RTC registers */
679677
if (off == cmos->day_alrm
680678
|| off == cmos->mon_alrm
@@ -689,7 +687,7 @@ static int cmos_nvram_write(void *priv, unsigned int off, void *val,
689687
}
690688
spin_unlock_irq(&rtc_lock);
691689

692-
return retval;
690+
return count ? -EIO : 0;
693691
}
694692

695693
/*----------------------------------------------------------------*/

0 commit comments

Comments
 (0)