Skip to content

Commit 5782fd1

Browse files
committed
Merge tag 'rtc-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Subsystem: - constify rtc_class_ops structures New driver: - STM32 Drivers: - armada38x: fix errata, Armada 7K/8K support - ds3232: fix wakeup support - gemini: DT support - m48t86: huge cleanup and platform_data removal - mcp795: alarm support - sun6i: proper oscillator handling - tegra: proper clock handling - tps65910: calibration support" * tag 'rtc-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (44 commits) rtc: ds3232: Call device_init_wakeup before device_register rtc: pcf2127: bulk read only date and time registers. rtc: armada38x: Add support for Armada 7K/8K rtc: armada38x: Prepare driver to manage different versions rtc: ds3232: Add regmap max_register definition. rtc: ds3232: Cleanup whitespace around register and bit definitions. rtc: m48t86: remove unused platform_data ARM: Orion5x: ts78xx: allow rtc-m48t86 to manage it's own resources ARM: Orion5x: ts78xx: remove RTC detection ARM: ep93xx: ts72xx: allow rtc-m48t86 to manage its own resources rtc: m48t86: verify that the RTC is actually present rtc: m48t86: add NVRAM support rtc: m48t86: allow driver to manage its resources rtc: m48t86: shorten register name defines bindings: rtc: correct wrong reference in required properties rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() rtc: sun6i: extend test coverage rtc: sun6i: Fix compatibility with old DT binding rtc: snvs: add a missing write sync rtc: bq32000: add support to enable disable the trickle charge FET bypass ...
2 parents 45554b2 + d4f6c6f commit 5782fd1

35 files changed

Lines changed: 1956 additions & 376 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
What: /sys/bus/i2c/devices/.../trickle_charge_bypass
2+
Date: Jan 2017
3+
KernelVersion: 4.11
4+
Contact: Enric Balletbo i Serra <eballetbo@gmail.com>
5+
Description: Attribute for enable/disable the trickle charge bypass
6+
The trickle_charge_bypass attribute allows the userspace to
7+
enable/disable the Trickle charge FET bypass.

Documentation/devicetree/bindings/rtc/armada-380-rtc.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
* Real Time Clock of the Armada 38x SoCs
1+
* Real Time Clock of the Armada 38x/7K/8K SoCs
22

3-
RTC controller for the Armada 38x SoCs
3+
RTC controller for the Armada 38x, 7K and 8K SoCs
44

55
Required properties:
6-
- compatible : Should be "marvell,armada-380-rtc"
6+
- compatible : Should be one of the following:
7+
"marvell,armada-380-rtc" for Armada 38x SoC
8+
"marvell,armada-8k-rtc" for Aramda 7K/8K SoCs
79
- reg: a list of base address and size pairs, one for each entry in
810
reg-names
911
- reg names: should contain:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* Cortina Systems Gemini RTC
2+
3+
Gemini SoC real-time clock.
4+
5+
Required properties:
6+
- compatible : Should be "cortina,gemini-rtc"
7+
8+
Examples:
9+
10+
rtc@45000000 {
11+
compatible = "cortina,gemini-rtc";
12+
reg = <0x45000000 0x100>;
13+
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
14+
};

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ Required properties:
88
region.
99
- interrupts: rtc alarm interrupt
1010

11+
Optional properties:
12+
- interrupts: dryice security violation interrupt
13+
1114
Example:
1215

1316
rtc@80056000 {
1417
compatible = "fsl,imx53-rtc", "fsl,imx25-rtc";
1518
reg = <0x80056000 2000>;
16-
interrupts = <29>;
19+
interrupts = <29 56>;
1720
};

Documentation/devicetree/bindings/rtc/maxim,ds3231.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
* Maxim DS3231 Real Time Clock
22

33
Required properties:
4-
see: Documentation/devicetree/bindings/i2c/trivial-admin-guide/devices.rst
4+
- compatible: Should contain "maxim,ds3231".
5+
- reg: I2C address for chip.
56

67
Optional property:
78
- #clock-cells: Should be 1.

Documentation/devicetree/bindings/rtc/pcf8563.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Philips PCF8563/Epson RTC8564 Real Time Clock
44

55
Required properties:
6-
see: Documentation/devicetree/bindings/i2c/trivial-admin-guide/devices.rst
6+
- compatible: Should contain "nxp,pcf8563".
7+
- reg: I2C address for chip.
78

89
Optional property:
910
- #clock-cells: Should be 0.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
STM32 Real Time Clock
2+
3+
Required properties:
4+
- compatible: "st,stm32-rtc".
5+
- reg: address range of rtc register set.
6+
- clocks: reference to the clock entry ck_rtc.
7+
- interrupt-parent: phandle for the interrupt controller.
8+
- interrupts: rtc alarm interrupt.
9+
- st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup domain
10+
(RTC registers) write protection.
11+
12+
Optional properties (to override default ck_rtc parent clock):
13+
- assigned-clocks: reference to the ck_rtc clock entry.
14+
- assigned-clock-parents: phandle of the new parent clock of ck_rtc.
15+
16+
Example:
17+
18+
rtc: rtc@40002800 {
19+
compatible = "st,stm32-rtc";
20+
reg = <0x40002800 0x400>;
21+
clocks = <&rcc 1 CLK_RTC>;
22+
assigned-clocks = <&rcc 1 CLK_RTC>;
23+
assigned-clock-parents = <&rcc 1 CLK_LSE>;
24+
interrupt-parent = <&exti>;
25+
interrupts = <17 1>;
26+
st,syscfg = <&pwrcfg>;
27+
};

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ Required properties:
88
memory mapped region.
99
- interrupts : IRQ lines for the RTC alarm 0 and alarm 1, in that order.
1010

11+
Required properties for new device trees
12+
- clocks : phandle to the 32kHz external oscillator
13+
- clock-output-names : name of the LOSC clock created
14+
- #clock-cells : must be equals to 1. The RTC provides two clocks: the
15+
LOSC and its external output, with index 0 and 1
16+
respectively.
17+
1118
Example:
1219

1320
rtc: rtc@01f00000 {
1421
compatible = "allwinner,sun6i-a31-rtc";
1522
reg = <0x01f00000 0x54>;
1623
interrupts = <0 40 4>, <0 41 4>;
24+
clock-output-names = "osc32k";
25+
clocks = <&ext_osc32k>;
26+
#clock-cells = <1>;
1727
};

arch/arm/mach-ep93xx/ts72xx.c

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/init.h>
1717
#include <linux/platform_device.h>
1818
#include <linux/io.h>
19-
#include <linux/platform_data/rtc-m48t86.h>
2019
#include <linux/mtd/nand.h>
2120
#include <linux/mtd/partitions.h>
2221

@@ -45,16 +44,6 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
4544
.pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
4645
.length = TS72XX_OPTIONS2_SIZE,
4746
.type = MT_DEVICE,
48-
}, {
49-
.virtual = (unsigned long)TS72XX_RTC_INDEX_VIRT_BASE,
50-
.pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE),
51-
.length = TS72XX_RTC_INDEX_SIZE,
52-
.type = MT_DEVICE,
53-
}, {
54-
.virtual = (unsigned long)TS72XX_RTC_DATA_VIRT_BASE,
55-
.pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE),
56-
.length = TS72XX_RTC_DATA_SIZE,
57-
.type = MT_DEVICE,
5847
}
5948
};
6049

@@ -179,31 +168,22 @@ static void __init ts72xx_register_flash(void)
179168
}
180169
}
181170

171+
/*************************************************************************
172+
* RTC M48T86
173+
*************************************************************************/
174+
#define TS72XX_RTC_INDEX_PHYS_BASE (EP93XX_CS1_PHYS_BASE + 0x00800000)
175+
#define TS72XX_RTC_DATA_PHYS_BASE (EP93XX_CS1_PHYS_BASE + 0x01700000)
182176

183-
static unsigned char ts72xx_rtc_readbyte(unsigned long addr)
184-
{
185-
__raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
186-
return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE);
187-
}
188-
189-
static void ts72xx_rtc_writebyte(unsigned char value, unsigned long addr)
190-
{
191-
__raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
192-
__raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE);
193-
}
194-
195-
static struct m48t86_ops ts72xx_rtc_ops = {
196-
.readbyte = ts72xx_rtc_readbyte,
197-
.writebyte = ts72xx_rtc_writebyte,
177+
static struct resource ts72xx_rtc_resources[] = {
178+
DEFINE_RES_MEM(TS72XX_RTC_INDEX_PHYS_BASE, 0x01),
179+
DEFINE_RES_MEM(TS72XX_RTC_DATA_PHYS_BASE, 0x01),
198180
};
199181

200182
static struct platform_device ts72xx_rtc_device = {
201183
.name = "rtc-m48t86",
202184
.id = -1,
203-
.dev = {
204-
.platform_data = &ts72xx_rtc_ops,
205-
},
206-
.num_resources = 0,
185+
.resource = ts72xx_rtc_resources,
186+
.num_resources = ARRAY_SIZE(ts72xx_rtc_resources),
207187
};
208188

209189
static struct resource ts72xx_wdt_resources[] = {

arch/arm/mach-ep93xx/ts72xx.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* febff000 22000000 4K model number register (bits 0-2)
1010
* febfe000 22400000 4K options register
1111
* febfd000 22800000 4K options register #2
12-
* febf9000 10800000 4K TS-5620 RTC index register
13-
* febf8000 11700000 4K TS-5620 RTC data register
1412
*/
1513

1614
#define TS72XX_MODEL_PHYS_BASE 0x22000000
@@ -40,15 +38,6 @@
4038
#define TS72XX_OPTIONS2_TS9420 0x04
4139
#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
4240

43-
44-
#define TS72XX_RTC_INDEX_VIRT_BASE IOMEM(0xfebf9000)
45-
#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000
46-
#define TS72XX_RTC_INDEX_SIZE 0x00001000
47-
48-
#define TS72XX_RTC_DATA_VIRT_BASE IOMEM(0xfebf8000)
49-
#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000
50-
#define TS72XX_RTC_DATA_SIZE 0x00001000
51-
5241
#define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000
5342
#define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000
5443

0 commit comments

Comments
 (0)