6e9951bd4a7c0d058858a45c42ba0cea78e17386
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0759-Add-Micro-Crystal-RV-1805-to-i2c-rtc-overlays.patch
1 From 8c16d549cd0b9e9cf890ac3ead5d58d92590140f Mon Sep 17 00:00:00 2001
2 From: "Kevin P. Fleming" <kevin+linux@km6g.us>
3 Date: Mon, 1 Jun 2020 07:02:00 -0400
4 Subject: [PATCH] Add Micro Crystal RV-1805 to i2c-rtc overlays
5
6 While the RV-1805 is supported by the rtc-abx80x driver via
7 auto-detection, in order for it to be initialized properly
8 it must be explcitly selected.
9
10 Signed-off-by: Kevin P. Fleming <kevin+linux@km6g.us>
11 ---
12 arch/arm/boot/dts/overlays/README | 12 +++++---
13 .../dts/overlays/i2c-rtc-gpio-overlay.dts | 28 ++++++++++++++++---
14 .../arm/boot/dts/overlays/i2c-rtc-overlay.dts | 27 ++++++++++++++++--
15 3 files changed, 56 insertions(+), 11 deletions(-)
16
17 --- a/arch/arm/boot/dts/overlays/README
18 +++ b/arch/arm/boot/dts/overlays/README
19 @@ -1196,6 +1196,8 @@ Params: abx80x Select o
20
21 pcf8563 Select the PCF8563 device
22
23 + rv1805 Select the Micro Crystal RV1805 device
24 +
25 rv3028 Select the Micro Crystal RV3028 device
26
27 addr Sets the address for the RTC. Note that the
28 @@ -1203,10 +1205,10 @@ Params: abx80x Select o
29 address.
30
31 trickle-diode-type Diode type for trickle charge - "standard" or
32 - "schottky" (ABx80x only)
33 + "schottky" (ABx80x and RV1805 only)
34
35 trickle-resistor-ohms Resistor value for trickle charge (DS1339,
36 - ABx80x, RV3028)
37 + ABx80x, RV1805, RV3028)
38
39 wakeup-source Specify that the RTC can be used as a wakeup
40 source
41 @@ -1243,6 +1245,8 @@ Params: abx80x Select o
42
43 pcf8563 Select the PCF8563 device
44
45 + rv1805 Select the Micro Crystal RV1805 device
46 +
47 rv3028 Select the Micro Crystal RV3028 device
48
49 addr Sets the address for the RTC. Note that the
50 @@ -1250,10 +1254,10 @@ Params: abx80x Select o
51 address.
52
53 trickle-diode-type Diode type for trickle charge - "standard" or
54 - "schottky" (ABx80x only)
55 + "schottky" (ABx80x and RV1805 only)
56
57 trickle-resistor-ohms Resistor value for trickle charge (DS1339,
58 - ABx80x, RV3028)
59 + ABx80x, RV1805, RV3028)
60
61 wakeup-source Specify that the RTC can be used as a wakeup
62 source
63 --- a/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts
64 +++ b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts
65 @@ -204,6 +204,23 @@
66 };
67 };
68
69 + fragment@13 {
70 + target = <&i2c_gpio>;
71 + __dormant__ {
72 + #address-cells = <1>;
73 + #size-cells = <0>;
74 + status = "okay";
75 +
76 + rv1805: rv1805@69 {
77 + compatible = "microcrystal,rv1805";
78 + reg = <0x69>;
79 + abracon,tc-diode = "standard";
80 + abracon,tc-resistor = <0>;
81 + status = "okay";
82 + };
83 + };
84 + };
85 +
86 __overrides__ {
87 abx80x = <0>,"+1";
88 ds1307 = <0>,"+2";
89 @@ -217,6 +234,7 @@
90 m41t62 = <0>,"+10";
91 rv3028 = <0>,"+11";
92 pcf2129 = <0>,"+12";
93 + rv1805 = <0>,"+13";
94
95 addr = <&abx80x>, "reg:0",
96 <&ds1307>, "reg:0",
97 @@ -226,12 +244,14 @@
98 <&mcp7941x>, "reg:0",
99 <&pcf8523>, "reg:0",
100 <&pcf8563>, "reg:0",
101 - <&m41t62>, "reg:0";
102 -
103 - trickle-diode-type = <&abx80x>,"abracon,tc-diode";
104 + <&m41t62>, "reg:0",
105 + <&rv1805>, "reg:0";
106 + trickle-diode-type = <&abx80x>,"abracon,tc-diode",
107 + <&rv1805>,"abracon,tc-diode";
108 trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0",
109 <&abx80x>,"abracon,tc-resistor:0",
110 - <&rv3028>,"trickle-resistor-ohms:0";
111 + <&rv3028>,"trickle-resistor-ohms:0",
112 + <&rv1805>,"abracon,tc-resistor:0";
113 backup-switchover-mode = <&rv3028>,"backup-switchover-mode:0";
114 wakeup-source = <&ds1339>,"wakeup-source?",
115 <&ds3231>,"wakeup-source?",
116 --- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
117 +++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
118 @@ -203,6 +203,23 @@
119 };
120 };
121
122 + fragment@13 {
123 + target = <&i2c_arm>;
124 + __dormant__ {
125 + #address-cells = <1>;
126 + #size-cells = <0>;
127 + status = "okay";
128 +
129 + rv1805: rv1805@69 {
130 + compatible = "microcrystal,rv1805";
131 + reg = <0x69>;
132 + abracon,tc-diode = "standard";
133 + abracon,tc-resistor = <0>;
134 + status = "okay";
135 + };
136 + };
137 + };
138 +
139 __overrides__ {
140 abx80x = <0>,"+0";
141 ds1307 = <0>,"+1";
142 @@ -217,6 +234,7 @@
143 rv3028 = <0>,"+10";
144 pcf2129 = <0>,"+11";
145 pcf85363 = <0>,"+12";
146 + rv1805 = <0>,"+13";
147
148 addr = <&abx80x>, "reg:0",
149 <&ds1307>, "reg:0",
150 @@ -226,11 +244,14 @@
151 <&mcp7941x>, "reg:0",
152 <&pcf8523>, "reg:0",
153 <&pcf8563>, "reg:0",
154 - <&m41t62>, "reg:0";
155 - trickle-diode-type = <&abx80x>,"abracon,tc-diode";
156 + <&m41t62>, "reg:0",
157 + <&rv1805>, "reg:0";
158 + trickle-diode-type = <&abx80x>,"abracon,tc-diode",
159 + <&rv1805>,"abracon,tc-diode";
160 trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0",
161 <&abx80x>,"abracon,tc-resistor:0",
162 - <&rv3028>,"trickle-resistor-ohms:0";
163 + <&rv3028>,"trickle-resistor-ohms:0",
164 + <&rv1805>,"abracon,tc-resistor:0";
165 backup-switchover-mode = <&rv3028>,"backup-switchover-mode:0";
166 wakeup-source = <&ds1339>,"wakeup-source?",
167 <&ds3231>,"wakeup-source?",