Skip to content

Commit 561a8eb

Browse files
committed
Merge tag 'rtc-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Subsystem: - remove .open() and .release() RTC ops - constify i2c_device_id New driver: - Realtek RTD1295 - Android emulator (goldfish) RTC Drivers: - ds1307: Beginning of a huge cleanup - s35390a: handle invalid RTC time - sun6i: external oscillator gate support" * tag 'rtc-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (40 commits) rtc: ds1307: use octal permissions rtc: ds1307: fix braces rtc: ds1307: fix alignments and blank lines rtc: ds1307: use BIT rtc: ds1307: use u32 rtc: ds1307: use sizeof rtc: ds1307: remove regs member rtc: Add Realtek RTD1295 dt-bindings: rtc: Add Realtek RTD1295 rtc: sun6i: Add support for the external oscillator gate rtc: goldfish: Add RTC driver for Android emulator dt-bindings: Add device tree binding for Goldfish RTC driver rtc: ds1307: add basic support for ds1341 chip rtc: ds1307: remove member nvram_offset from struct ds1307 rtc: ds1307: factor out offset to struct chip_desc rtc: ds1307: factor out rtc_ops to struct chip_desc rtc: ds1307: factor out irq_handler to struct chip_desc rtc: ds1307: improve irq setup rtc: ds1307: constify struct chip_desc variables rtc: ds1307: improve trickle charger initialization ...
2 parents 2818d0d + b4be271 commit 561a8eb

26 files changed

+953
-485
lines changed

Documentation/devicetree/bindings/power/wakeup-source.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ List of legacy properties and respective binding document
2020
1. "enable-sdio-wakeup" Documentation/devicetree/bindings/mmc/mmc.txt
2121
2. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt
2222
3. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt
23-
4. "isil,irq2-can-wakeup-machine" Documentation/devicetree/bindings/rtc/isil,isl12057.txt
24-
5. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
23+
4. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
2524
Documentation/devicetree/bindings/mfd/tc3589x.txt
2625
Documentation/devicetree/bindings/input/ads7846.txt
27-
6. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
28-
7. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung-keypad.txt
29-
8. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
26+
5. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
27+
6. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung-keypad.txt
28+
7. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
3029

3130
Examples
3231
--------
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Android Goldfish RTC
2+
3+
Android Goldfish RTC device used by Android emulator.
4+
5+
Required properties:
6+
7+
- compatible : should contain "google,goldfish-rtc"
8+
- reg : <registers mapping>
9+
- interrupts : <interrupt mapping>
10+
11+
Example:
12+
13+
goldfish_timer@9020000 {
14+
compatible = "google,goldfish-rtc";
15+
reg = <0x9020000 0x1000>;
16+
interrupts = <0x3>;
17+
};

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Optional properties:
2424

2525
- "wakeup-source": mark the chip as a wakeup source, independently of
2626
the availability of an IRQ line connected to the SoC.
27-
(Legacy property supported: "isil,irq2-can-wakeup-machine")
2827

2928
- "interrupt-parent", "interrupts": for passing the interrupt line
3029
of the SoC connected to IRQ#2 of the RTC chip.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Realtek RTD129x Real-Time Clock
2+
===============================
3+
4+
Required properties:
5+
- compatible : Should be "realtek,rtd1295-rtc"
6+
- reg : Specifies the physical base address and size
7+
- clocks : Specifies the clock gate
8+
9+
10+
Example:
11+
12+
rtc@9801b600 {
13+
compatible = "realtek,rtd1295-clk";
14+
reg = <0x9801b600 0x100>;
15+
clocks = <&clkc RTD1295_CLK_EN_MISC_RTC>;
16+
};

Documentation/devicetree/bindings/rtc/sun6i-rtc.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Required properties:
1010

1111
Required properties for new device trees
1212
- clocks : phandle to the 32kHz external oscillator
13-
- clock-output-names : name of the LOSC clock created
13+
- clock-output-names : names of the LOSC and its external output clocks created
1414
- #clock-cells : must be equals to 1. The RTC provides two clocks: the
1515
LOSC and its external output, with index 0 and 1
1616
respectively.
@@ -21,7 +21,7 @@ rtc: rtc@01f00000 {
2121
compatible = "allwinner,sun6i-a31-rtc";
2222
reg = <0x01f00000 0x54>;
2323
interrupts = <0 40 4>, <0 41 4>;
24-
clock-output-names = "osc32k";
24+
clock-output-names = "osc32k", "osc32k-out";
2525
clocks = <&ext_osc32k>;
2626
#clock-cells = <1>;
2727
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,12 @@ S: Supported
855855
F: drivers/android/
856856
F: drivers/staging/android/
857857

858+
ANDROID GOLDFISH RTC DRIVER
859+
M: Miodrag Dinic <[email protected]>
860+
S: Supported
861+
F: Documentation/devicetree/bindings/rtc/google,goldfish-rtc.txt
862+
F: drivers/rtc/rtc-goldfish.c
863+
858864
ANDROID ION DRIVER
859865
M: Laura Abbott <[email protected]>
860866
M: Sumit Semwal <[email protected]>

drivers/rtc/Kconfig

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ config RTC_DRV_AS3722
227227
will be called rtc-as3722.
228228

229229
config RTC_DRV_DS1307
230-
tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025, ISL12057"
230+
tristate "Dallas/Maxim DS1307/37/38/39/40/41, ST M41T00, EPSON RX-8025, ISL12057"
231231
help
232232
If you say yes here you get support for various compatible RTC
233233
chips (often with battery backup) connected with I2C. This driver
234-
should handle DS1307, DS1337, DS1338, DS1339, DS1340, ST M41T00,
235-
EPSON RX-8025, Intersil ISL12057 and probably other chips. In some
236-
cases the RTC must already have been initialized (by manufacturing or
237-
a bootloader).
234+
should handle DS1307, DS1337, DS1338, DS1339, DS1340, DS1341,
235+
ST M41T00, EPSON RX-8025, Intersil ISL12057 and probably other chips.
236+
In some cases the RTC must already have been initialized (by
237+
manufacturing or a bootloader).
238238

239239
The first seven registers on these chips hold an RTC, and other
240240
registers may add features such as NVRAM, a trickle charger for
@@ -371,11 +371,11 @@ config RTC_DRV_MAX77686
371371
will be called rtc-max77686.
372372

373373
config RTC_DRV_RK808
374-
tristate "Rockchip RK808/RK818 RTC"
374+
tristate "Rockchip RK805/RK808/RK818 RTC"
375375
depends on MFD_RK808
376376
help
377377
If you say yes here you will get support for the
378-
RTC of RK808 and RK818 PMIC.
378+
RTC of RK805, RK808 and RK818 PMIC.
379379

380380
This driver can also be built as a module. If so, the module
381381
will be called rk808-rtc.
@@ -1765,6 +1765,14 @@ config RTC_DRV_CPCAP
17651765
Say y here for CPCAP rtc found on some Motorola phones
17661766
and tablets such as Droid 4.
17671767

1768+
config RTC_DRV_RTD119X
1769+
bool "Realtek RTD129x RTC"
1770+
depends on ARCH_REALTEK || COMPILE_TEST
1771+
default ARCH_REALTEK
1772+
help
1773+
If you say yes here, you get support for the RTD1295 SoC
1774+
Real Time Clock.
1775+
17681776
comment "HID Sensor RTC drivers"
17691777

17701778
config RTC_DRV_HID_SENSOR_TIME
@@ -1780,5 +1788,13 @@ config RTC_DRV_HID_SENSOR_TIME
17801788
If this driver is compiled as a module, it will be named
17811789
rtc-hid-sensor-time.
17821790

1791+
config RTC_DRV_GOLDFISH
1792+
tristate "Goldfish Real Time Clock"
1793+
depends on MIPS && (GOLDFISH || COMPILE_TEST)
1794+
help
1795+
Say yes to enable RTC driver for the Goldfish based virtual platform.
1796+
1797+
Goldfish is a code name for the virtual platform developed by Google
1798+
for Android emulation.
17831799

17841800
endif # RTC_CLASS

drivers/rtc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o
131131
obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o
132132
obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o
133133
obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o
134+
obj-$(CONFIG_RTC_DRV_RTD119X) += rtc-rtd119x.o
134135
obj-$(CONFIG_RTC_DRV_RV3029C2) += rtc-rv3029c2.o
135136
obj-$(CONFIG_RTC_DRV_RV8803) += rtc-rv8803.o
136137
obj-$(CONFIG_RTC_DRV_RX4581) += rtc-rx4581.o
@@ -170,3 +171,4 @@ obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o
170171
obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o
171172
obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o
172173
obj-$(CONFIG_RTC_DRV_ZYNQMP) += rtc-zynqmp.o
174+
obj-$(CONFIG_RTC_DRV_GOLDFISH) += rtc-goldfish.o

drivers/rtc/rtc-dev.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,19 @@ static dev_t rtc_devt;
2424

2525
static int rtc_dev_open(struct inode *inode, struct file *file)
2626
{
27-
int err;
2827
struct rtc_device *rtc = container_of(inode->i_cdev,
2928
struct rtc_device, char_dev);
30-
const struct rtc_class_ops *ops = rtc->ops;
3129

3230
if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags))
3331
return -EBUSY;
3432

3533
file->private_data = rtc;
3634

37-
err = ops->open ? ops->open(rtc->dev.parent) : 0;
38-
if (err == 0) {
39-
spin_lock_irq(&rtc->irq_lock);
40-
rtc->irq_data = 0;
41-
spin_unlock_irq(&rtc->irq_lock);
42-
43-
return 0;
44-
}
35+
spin_lock_irq(&rtc->irq_lock);
36+
rtc->irq_data = 0;
37+
spin_unlock_irq(&rtc->irq_lock);
4538

46-
/* something has gone wrong */
47-
clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
48-
return err;
39+
return 0;
4940
}
5041

5142
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
@@ -438,9 +429,6 @@ static int rtc_dev_release(struct inode *inode, struct file *file)
438429
rtc_update_irq_enable(rtc, 0);
439430
rtc_irq_set_state(rtc, NULL, 0);
440431

441-
if (rtc->ops->release)
442-
rtc->ops->release(rtc->dev.parent);
443-
444432
clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
445433
return 0;
446434
}

0 commit comments

Comments
 (0)