rtc: ds1307: factor out more stuff from ds1307_probe and improve ds1307_set_time
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | rtc: ds1307: factor out determining the chip typedrivers/ | +20 | 0 replies | |
| 2/5 | rtc: ds1307: factor out trickle charger initializationdrivers/ | +28 | 0 replies | |
| 3/5 | rtc: ds1307: factor out fixing the weekdaydrivers/ | +25 | 0 replies | |
| 4/5 | rtc: ds1307: introduce constants for the timekeeping register masksdrivers/ | +34 | 0 replies | |
| 5/5 | rtc: ds1307: improve ds1307_set_time to respect config flag bitsdrivers/ | +34 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/5] rtc: ds1307: factor out more stuff from ds1307_probe and improve ds1307_set_time
Final goal of the refactoring is to abstract everything that the chips have in common and handle it in generic code. Then we can get rid of all the "switch (chip)" and "if (chip == xxx)" code.
To give one example:
A lot of chips have a bit for setting 12hr / 24hr mode. However some chips have this config bit in the timekeeping registers, others in a config register, and on some chips it's inverted.
But the functionality of the bit is always the same.
Ultimately adding support for a chip just requires to add one config structure member.
The way to reach this goal is a long one and to faciliate reviewing the patches I'll split them into series of 5 to 10 patches.
Heiner Kallweit (5):
rtc: ds1307: factor out determining the chip type
rtc: ds1307: factor out trickle charger initialization
rtc: ds1307: factor out fixing the weekday
rtc: ds1307: introduce constants for the timekeeping register masks
rtc: ds1307: improve ds1307_set_time to respect config flag bits
drivers/rtc/rtc-ds1307.c | 256 ++++++++++++++++++++++++++--------------------- 1 file changed, 140 insertions(+), 116 deletions(-)
Signature · 1 line
2.14.1