brcm2708: update to latest patches from RPi foundation
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0703-overlays-Add-PCF2129-RTC.patch
1 From 747a71aefc4990f9db830f18c41e0a52b0d7b4e0 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 15 Jul 2019 10:39:05 +0100
4 Subject: [PATCH 703/773] overlays: Add PCF2129 RTC
5
6 Add support for the PCF2129 RTC to i2c-rtc and i2c-rtc-gpio overlays.
7 Also add rv3028 to i2c-rtc-gpio (it was missed previously), and don't
8 attempt to set an alternate address for the PCF2127.
9
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
11 ---
12 arch/arm/boot/dts/overlays/README | 11 ++++-
13 .../dts/overlays/i2c-rtc-gpio-overlay.dts | 41 +++++++++++++++++--
14 .../arm/boot/dts/overlays/i2c-rtc-overlay.dts | 19 ++++++++-
15 3 files changed, 64 insertions(+), 7 deletions(-)
16
17 --- a/arch/arm/boot/dts/overlays/README
18 +++ b/arch/arm/boot/dts/overlays/README
19 @@ -1022,6 +1022,8 @@ Params: abx80x Select o
20
21 pcf2127 Select the PCF2127 device
22
23 + pcf2129 Select the PCF2129 device
24 +
25 pcf8523 Select the PCF8523 device
26
27 pcf8563 Select the PCF8563 device
28 @@ -1067,10 +1069,14 @@ Params: abx80x Select o
29
30 pcf2127 Select the PCF2127 device
31
32 + pcf2129 Select the PCF2129 device
33 +
34 pcf8523 Select the PCF8523 device
35
36 pcf8563 Select the PCF8563 device
37
38 + rv3028 Select the Micro Crystal RV3028 device
39 +
40 addr Sets the address for the RTC. Note that the
41 device must be configured to use the specified
42 address.
43 @@ -1079,11 +1085,14 @@ Params: abx80x Select o
44 "schottky" (ABx80x only)
45
46 trickle-resistor-ohms Resistor value for trickle charge (DS1339,
47 - ABx80x)
48 + ABx80x, RV3028)
49
50 wakeup-source Specify that the RTC can be used as a wakeup
51 source
52
53 + backup-switchover-mode Backup power supply switch mode. Must be 0 for
54 + off or 1 for Vdd < VBackup (RV3028 only)
55 +
56 i2c_gpio_sda GPIO used for I2C data (default "23")
57
58 i2c_gpio_scl GPIO used for I2C clock (default "24")
59 --- a/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts
60 +++ b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts
61 @@ -121,7 +121,7 @@
62 #size-cells = <0>;
63 status = "okay";
64
65 - pcf2127: pcf2127@51 {
66 + pcf2127@51 {
67 compatible = "nxp,pcf2127";
68 reg = <0x51>;
69 status = "okay";
70 @@ -174,6 +174,36 @@
71 };
72 };
73
74 + fragment@11 {
75 + target = <&i2c_gpio>;
76 + __dormant__ {
77 + #address-cells = <1>;
78 + #size-cells = <0>;
79 + status = "okay";
80 +
81 + rv3028: rv3028@52 {
82 + compatible = "microcrystal,rv3028";
83 + reg = <0x52>;
84 + status = "okay";
85 + };
86 + };
87 + };
88 +
89 + fragment@12 {
90 + target = <&i2c_gpio>;
91 + __dormant__ {
92 + #address-cells = <1>;
93 + #size-cells = <0>;
94 + status = "okay";
95 +
96 + pcf2129@51 {
97 + compatible = "nxp,pcf2129";
98 + reg = <0x51>;
99 + status = "okay";
100 + };
101 + };
102 + };
103 +
104 __overrides__ {
105 abx80x = <0>,"+1";
106 ds1307 = <0>,"+2";
107 @@ -185,6 +215,8 @@
108 pcf8523 = <0>,"+8";
109 pcf8563 = <0>,"+9";
110 m41t62 = <0>,"+10";
111 + rv3028 = <0>,"+11";
112 + pcf2129 = <0>,"+12";
113
114 addr = <&abx80x>, "reg:0",
115 <&ds1307>, "reg:0",
116 @@ -192,18 +224,19 @@
117 <&ds3231>, "reg:0",
118 <&mcp7940x>, "reg:0",
119 <&mcp7941x>, "reg:0",
120 - <&pcf2127>, "reg:0",
121 <&pcf8523>, "reg:0",
122 <&pcf8563>, "reg:0",
123 <&m41t62>, "reg:0";
124
125 trickle-diode-type = <&abx80x>,"abracon,tc-diode";
126 trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0",
127 - <&abx80x>,"abracon,tc-resistor";
128 + <&abx80x>,"abracon,tc-resistor",
129 + <&rv3028>,"trickle-resistor-ohms:0";
130 + backup-switchover-mode = <&rv3028>,"backup-switchover-mode:0";
131 wakeup-source = <&ds1339>,"wakeup-source?",
132 <&ds3231>,"wakeup-source?",
133 <&mcp7940x>,"wakeup-source?",
134 - <&mcp7941x>,"wakeup-source?";
135 + <&mcp7941x>,"wakeup-source?";
136 i2c_gpio_sda = <&i2c_gpio>,"gpios:4";
137 i2c_gpio_scl = <&i2c_gpio>,"gpios:16";
138 i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";
139 --- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
140 +++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
141 @@ -105,7 +105,7 @@
142 #size-cells = <0>;
143 status = "okay";
144
145 - pcf2127: pcf2127@51 {
146 + pcf2127@51 {
147 compatible = "nxp,pcf2127";
148 reg = <0x51>;
149 status = "okay";
150 @@ -173,6 +173,21 @@
151 };
152 };
153
154 + fragment@11 {
155 + target = <&i2c_arm>;
156 + __dormant__ {
157 + #address-cells = <1>;
158 + #size-cells = <0>;
159 + status = "okay";
160 +
161 + pcf2129@51 {
162 + compatible = "nxp,pcf2129";
163 + reg = <0x51>;
164 + status = "okay";
165 + };
166 + };
167 + };
168 +
169 __overrides__ {
170 abx80x = <0>,"+0";
171 ds1307 = <0>,"+1";
172 @@ -185,6 +200,7 @@
173 pcf8563 = <0>,"+8";
174 m41t62 = <0>,"+9";
175 rv3028 = <0>,"+10";
176 + pcf2129 = <0>,"+11";
177
178 addr = <&abx80x>, "reg:0",
179 <&ds1307>, "reg:0",
180 @@ -192,7 +208,6 @@
181 <&ds3231>, "reg:0",
182 <&mcp7940x>, "reg:0",
183 <&mcp7941x>, "reg:0",
184 - <&pcf2127>, "reg:0",
185 <&pcf8523>, "reg:0",
186 <&pcf8563>, "reg:0",
187 <&m41t62>, "reg:0";