Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: pcf8563: let the core handle the alarm resolution

Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a
resolution of a minute. Also, the core will properly round down the alarm
instead of up.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220309162301.61679-16-alexandre.belloni@bootlin.com

+1 -13
+1 -13
drivers/rtc/rtc-pcf8563.c
··· 330 330 unsigned char buf[4]; 331 331 int err; 332 332 333 - /* The alarm has no seconds, round up to nearest minute */ 334 - if (tm->time.tm_sec) { 335 - time64_t alarm_time = rtc_tm_to_time64(&tm->time); 336 - 337 - alarm_time += 60 - tm->time.tm_sec; 338 - rtc_time64_to_tm(alarm_time, &tm->time); 339 - } 340 - 341 - dev_dbg(dev, "%s, min=%d hour=%d wday=%d mday=%d " 342 - "enabled=%d pending=%d\n", __func__, 343 - tm->time.tm_min, tm->time.tm_hour, tm->time.tm_wday, 344 - tm->time.tm_mday, tm->enabled, tm->pending); 345 - 346 333 buf[0] = bin2bcd(tm->time.tm_min); 347 334 buf[1] = bin2bcd(tm->time.tm_hour); 348 335 buf[2] = bin2bcd(tm->time.tm_mday); ··· 553 566 pcf8563->rtc->ops = &pcf8563_rtc_ops; 554 567 /* the pcf8563 alarm only supports a minute accuracy */ 555 568 pcf8563->rtc->uie_unsupported = 1; 569 + set_bit(RTC_FEATURE_ALARM_RES_MINUTE, pcf8563->rtc->features); 556 570 pcf8563->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; 557 571 pcf8563->rtc->range_max = RTC_TIMESTAMP_END_2099; 558 572 pcf8563->rtc->set_start_time = true;