095-v4.13-0001-rtc-ds1307-add-ds1308-variant.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 300a7735becf55f7fd18f8cd3dc3b945a0cab712 Mon Sep 17 00:00:00 2001
  2. From: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
  3. Date: Thu, 8 Jun 2017 12:36:54 +0200
  4. Subject: rtc: ds1307: add ds1308 variant
  5. The ds1308 variant is very similar to the already supported ds1338
  6. variant, it have more debug registers and a square wave clock output.
  7. Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
  8. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  9. ---
  10. drivers/rtc/rtc-ds1307.c | 12 ++++++++++++
  11. 1 file changed, 12 insertions(+)
  12. --- a/drivers/rtc/rtc-ds1307.c
  13. +++ b/drivers/rtc/rtc-ds1307.c
  14. @@ -31,6 +31,7 @@
  15. */
  16. enum ds_type {
  17. ds_1307,
  18. + ds_1308,
  19. ds_1337,
  20. ds_1338,
  21. ds_1339,
  22. @@ -144,6 +145,10 @@ static struct chip_desc chips[last_ds_ty
  23. .nvram_offset = 8,
  24. .nvram_size = 56,
  25. },
  26. + [ds_1308] = {
  27. + .nvram_offset = 8,
  28. + .nvram_size = 56,
  29. + },
  30. [ds_1337] = {
  31. .alarm = 1,
  32. },
  33. @@ -175,6 +180,7 @@ static struct chip_desc chips[last_ds_ty
  34. static const struct i2c_device_id ds1307_id[] = {
  35. { "ds1307", ds_1307 },
  36. + { "ds1308", ds_1308 },
  37. { "ds1337", ds_1337 },
  38. { "ds1338", ds_1338 },
  39. { "ds1339", ds_1339 },
  40. @@ -1488,6 +1494,7 @@ read_rtc:
  41. goto read_rtc;
  42. }
  43. break;
  44. + case ds_1308:
  45. case ds_1338:
  46. /* clock halted? turn it on, so clock can tick. */
  47. if (tmp & DS1307_BIT_CH)