The DA9062 and DA9063 have a year register that can go up to 0x3F.
Unified · Split
| @@ -464,11 +464,14 @@ static int da9063_rtc_probe(struct platform_device *pdev) · 463 unmodified lines | |||
| 464 | 464 | ||
| 465 | platform_set_drvdata(pdev, rtc); | 465 | platform_set_drvdata(pdev, rtc); |
| 466 | 466 | ||
| 467 | rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, DA9063_DRVNAME_RTC, | 467 | rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev); |
| 468 | &da9063_rtc_ops, THIS_MODULE); | ||
| 469 | if (IS_ERR(rtc->rtc_dev)) | 468 | if (IS_ERR(rtc->rtc_dev)) |
| 470 | return PTR_ERR(rtc->rtc_dev); | 469 | return PTR_ERR(rtc->rtc_dev); |
| 471 | 470 | ||
| 471 | rtc->rtc_dev->ops = &da9063_rtc_ops; | ||
| 472 | rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000; | ||
| 473 | rtc->rtc_dev->range_max = RTC_TIMESTAMP_END_2063; | ||
| 474 | |||
| 472 | da9063_data_to_tm(data, &rtc->alarm_time, rtc); | 475 | da9063_data_to_tm(data, &rtc->alarm_time, rtc); |
| 473 | rtc->rtc_sync = false; | 476 | rtc->rtc_sync = false; |
| 474 | 477 | ||
| @@ -481,7 +484,7 @@ static int da9063_rtc_probe(struct platform_device *pdev) · 6 unmodified lines | |||
| 481 | dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", | 484 | dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", |
| 482 | irq_alarm, ret); | 485 | irq_alarm, ret); |
| 483 | 486 | ||
| 484 | return ret; | 487 | return rtc_register_device(rtc->rtc_dev); |
| 485 | } | 488 | } |
| 486 | 489 | ||
| 487 | static struct platform_driver da9063_rtc_driver = { | 490 | static struct platform_driver da9063_rtc_driver = { |
| @@ -164,6 +164,7 @@ struct rtc_device { · 163 unmodified lines | |||
| 164 | /* useful timestamps */ | 164 | /* useful timestamps */ |
| 165 | #define RTC_TIMESTAMP_BEGIN_1900 -2208989361LL /* 1900-01-01 00:00:00 */ | 165 | #define RTC_TIMESTAMP_BEGIN_1900 -2208989361LL /* 1900-01-01 00:00:00 */ |
| 166 | #define RTC_TIMESTAMP_BEGIN_2000 946684800LL /* 2000-01-01 00:00:00 */ | 166 | #define RTC_TIMESTAMP_BEGIN_2000 946684800LL /* 2000-01-01 00:00:00 */ |
| 167 | #define RTC_TIMESTAMP_END_2063 2966371199LL /* 2063-12-31 23:59:59 */ | ||
| 167 | #define RTC_TIMESTAMP_END_2099 4102444799LL /* 2099-12-31 23:59:59 */ | 168 | #define RTC_TIMESTAMP_END_2099 4102444799LL /* 2099-12-31 23:59:59 */ |
| 168 | #define RTC_TIMESTAMP_END_9999 253402300799LL /* 9999-12-31 23:59:59 */ | 169 | #define RTC_TIMESTAMP_END_9999 253402300799LL /* 9999-12-31 23:59:59 */ |
| 169 | 170 | ||