aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 17:19:29 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 17:20:50 +0200
commit2268551935dbf1abcbb4d4fb7b1ad74dbe0d1be0 (patch)
treef387d01196b4cf597ffd89c930725a4c46bd652d /drivers/rtc/class.c
parent6a8af1b6568ad9ee08a419fb12c793f7992cf8a4 (diff)
downloadlinux-2268551935dbf1abcbb4d4fb7b1ad74dbe0d1be0.tar.gz
rtc: expose correction feature
Add a new feature for RTCs able to correct the oscillator imprecision. This is also called offset or trimming. Such drivers have a .set_offset callback, use that to set the feature bit from the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211018151933.76865-4-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index dbccd71589b9d..2e0cbc190a8ae 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -389,6 +389,9 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
if (!rtc->ops->set_alarm)
clear_bit(RTC_FEATURE_ALARM, rtc->features);
+ if (rtc->ops->set_offset)
+ set_bit(RTC_FEATURE_CORRECTION, rtc->features);
+
rtc->owner = owner;
rtc_device_get_offset(rtc);