Skip to content

Commit 211d593

Browse files
committed
Merge tag 'rtc-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Subsystem: - add data_race() in rtc_dev_poll() Drivers: - remove i2c_match_id usage - abx80x: Disable alarm feature if no interrupt attached - ti-k3: support resuming from IO DDR low power mode" * tag 'rtc-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: abx80x: Disable alarm feature if no interrupt attached rtc: ntxec: fix OF node reference imbalance rtc: pic32: allow driver to be compiled with COMPILE_TEST rtc: ti-k3: Add support to resume from IO DDR low power mode rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe() dt-bindings: rtc: add olpc,xo1-rtc to trivial-rtc dt-bindings: rtc: sc2731: Add compatible for SC2730 rtc: add data_race() in rtc_dev_poll() rtc: armada38x: zalloc + calloc to single allocation dt-bindings: rtc: isl12026: convert to YAML schema dt-bindings: rtc: microcrystal,rv3028: Allow to specify vdd-supply rtc: max77686: convert to i2c_new_ancillary_device dt-bindings: rtc: mpfs-rtc: permit resets rtc: rx8025: Remove use of i2c_match_id() rtc: rv8803: Remove use of i2c_match_id() rtc: rs5c372: Remove use of i2c_match_id() rtc: pcf2127: Remove use of i2c_match_id() rtc: m41t80: Remove use of i2c_match_id() rtc: abx80x: Remove use of i2c_match_id()
2 parents 1d9f1b5 + 0fedce7 commit 211d593

20 files changed

Lines changed: 132 additions & 90 deletions

Documentation/devicetree/bindings/rtc/isil,isl12026.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/isil,isl12026.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Intersil ISL12026 I2C RTC/EEPROM
8+
9+
maintainers:
10+
- Piyush Patle <piyushpatle228@gmail.com>
11+
12+
description:
13+
The ISL12026 is a combination RTC and EEPROM device connected via I2C.
14+
The RTC and control registers respond at address 0x6f, while the EEPROM
15+
array responds at address 0x57. The "reg" property refers to the RTC
16+
portion of the device.
17+
18+
allOf:
19+
- $ref: rtc.yaml#
20+
21+
properties:
22+
compatible:
23+
const: isil,isl12026
24+
25+
reg:
26+
maxItems: 1
27+
description: I2C address of the RTC portion (must be 0x6f)
28+
29+
isil,pwr-bsw:
30+
$ref: /schemas/types.yaml#/definitions/uint32
31+
enum: [ 0, 1 ]
32+
description:
33+
Value written to the PWR.BSW bit for proper device operation.
34+
35+
isil,pwr-sbib:
36+
$ref: /schemas/types.yaml#/definitions/uint32
37+
enum: [ 0, 1 ]
38+
description:
39+
Value written to the PWR.SBIB bit for proper device operation.
40+
41+
required:
42+
- compatible
43+
- reg
44+
45+
unevaluatedProperties: false
46+
47+
examples:
48+
- |
49+
i2c {
50+
#address-cells = <1>;
51+
#size-cells = <0>;
52+
53+
rtc@6f {
54+
compatible = "isil,isl12026";
55+
reg = <0x6f>;
56+
isil,pwr-bsw = <0>;
57+
isil,pwr-sbib = <1>;
58+
};
59+
};

Documentation/devicetree/bindings/rtc/microchip,mpfs-rtc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ properties:
4747
- const: rtc
4848
- const: rtcref
4949

50+
resets:
51+
maxItems: 1
52+
5053
required:
5154
- compatible
5255
- reg

Documentation/devicetree/bindings/rtc/microcrystal,rv3028.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ properties:
3232
- 9000
3333
- 15000
3434

35+
vdd-supply: true
36+
3537
required:
3638
- compatible
3739
- reg

Documentation/devicetree/bindings/rtc/olpc-xo1-rtc.txt

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

Documentation/devicetree/bindings/rtc/sprd,sc2731-rtc.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ maintainers:
1313

1414
properties:
1515
compatible:
16-
const: sprd,sc2731-rtc
16+
oneOf:
17+
- items:
18+
- enum:
19+
- sprd,sc2730-rtc
20+
- const: sprd,sc2731-rtc
21+
- const: sprd,sc2731-rtc
1722

1823
reg:
1924
maxItems: 1

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ properties:
6565
- microcrystal,rv3029
6666
# Real Time Clock
6767
- microcrystal,rv8523
68+
# OLPC XO-1 RTC
69+
- olpc,xo1-rtc
6870
# I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
6971
- ricoh,r2025sd
7072
# I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC

drivers/rtc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ config RTC_DRV_XGENE
19861986

19871987
config RTC_DRV_PIC32
19881988
tristate "Microchip PIC32 RTC"
1989-
depends on MACH_PIC32
1989+
depends on MACH_PIC32 || COMPILE_TEST
19901990
default y
19911991
help
19921992
If you say yes here you get support for the PIC32 RTC module.

drivers/rtc/dev.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,16 @@ static __poll_t rtc_dev_poll(struct file *file, poll_table *wait)
195195

196196
poll_wait(file, &rtc->irq_queue, wait);
197197

198-
data = rtc->irq_data;
198+
/*
199+
* This read can race with the write in rtc_handle_legacy_irq().
200+
*
201+
* - If this check misses a zero to non-zero transition the next check
202+
* will pick it up (rtc_handle_legacy_irq() wakes up rtc->irq_queue).
203+
* - Non-zero to non-zero transition misses do not change return value.
204+
* - And a non-zero to zero transition is unlikely to be missed, since
205+
* it occurs on rtc_dev_read(), during which polling is not expected.
206+
*/
207+
data = data_race(rtc->irq_data);
199208

200209
return (data != 0) ? (EPOLLIN | EPOLLRDNORM) : 0;
201210
}

drivers/rtc/rtc-abx80x.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,7 @@ static int abx80x_probe(struct i2c_client *client)
772772
struct abx80x_priv *priv;
773773
int i, data, err, trickle_cfg = -EINVAL;
774774
char buf[7];
775-
const struct i2c_device_id *id = i2c_match_id(abx80x_id, client);
776-
unsigned int part = id->driver_data;
775+
unsigned int part = (uintptr_t)i2c_get_match_data(client);
777776
unsigned int partnumber;
778777
unsigned int majrev, minrev;
779778
unsigned int lot;
@@ -933,6 +932,8 @@ static int abx80x_probe(struct i2c_client *client)
933932
client->irq = 0;
934933
}
935934
}
935+
if (client->irq <= 0)
936+
clear_bit(RTC_FEATURE_ALARM, priv->rtc->features);
936937

937938
err = rtc_add_group(priv->rtc, &rtc_calib_attr_group);
938939
if (err) {

0 commit comments

Comments
 (0)