Commit 34bbdc1
rtc: mt6359: Add RTC hardware range and add support for start-year
Add the RTC hardware range parameters to enable the possibility
of using the `start-year` devicetree property which, if present,
will set the start_secs parameter by overriding the defaults
that this driver is setting;
To keep compatibility with (hence have the same date/time reading
as) the old behavior, set:
- range_min to 1900-01-01 00:00:00
- range_max to 2027-12-31 23:59:59 (HW year max range is 0-127)
- start_secs defaulting to 1968-01-02 00:00:00
Please note that the oddness of starting from January 2nd is not
a hardware quirk and it's done only to get the same date/time
reading as an RTC which time was set before this commit.
Also remove the RTC_MIN_YEAR_OFFSET addition and subtraction in
callbacks set_time() and read_time() respectively, as now this
is already done by the API.
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Macpaul Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>1 parent 9beeecb commit 34bbdc1
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
122 | 116 | | |
123 | 117 | | |
124 | 118 | | |
125 | | - | |
126 | 119 | | |
127 | 120 | | |
128 | 121 | | |
| |||
178 | 171 | | |
179 | 172 | | |
180 | 173 | | |
181 | | - | |
182 | 174 | | |
183 | 175 | | |
184 | 176 | | |
| |||
194 | 186 | | |
195 | 187 | | |
196 | 188 | | |
197 | | - | |
198 | 189 | | |
199 | 190 | | |
200 | 191 | | |
| |||
302 | 293 | | |
303 | 294 | | |
304 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
305 | 300 | | |
306 | 301 | | |
307 | 302 | | |
| |||
0 commit comments