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: pcf8523: 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-15-alexandre.belloni@bootlin.com

+1 -8
+1 -8
drivers/rtc/rtc-pcf8523.c
··· 212 212 if (err < 0) 213 213 return err; 214 214 215 - /* The alarm has no seconds, round up to nearest minute */ 216 - if (tm->time.tm_sec) { 217 - time64_t alarm_time = rtc_tm_to_time64(&tm->time); 218 - 219 - alarm_time += 60 - tm->time.tm_sec; 220 - rtc_time64_to_tm(alarm_time, &tm->time); 221 - } 222 - 223 215 regs[0] = bin2bcd(tm->time.tm_min); 224 216 regs[1] = bin2bcd(tm->time.tm_hour); 225 217 regs[2] = bin2bcd(tm->time.tm_mday); ··· 442 450 rtc->ops = &pcf8523_rtc_ops; 443 451 rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; 444 452 rtc->range_max = RTC_TIMESTAMP_END_2099; 453 + set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->features); 445 454 clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); 446 455 447 456 if (client->irq > 0) {