rtc: ab-eoz9: make use of RTC_FEATURE_ALARM
Move the alarm callbacks in rtc_ops and use RTC_FEATURE_ALARM to notify the core whether alarm capabilities are available or not. Signed-off-by: Liam Beguin <lvb@xiphos.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210408024028.3526564-4-liambeguin@gmail.com
This commit is contained in:
committed by
Alexandre Belloni
parent
e70e52e1bf
commit
c52409eb16
@@ -368,11 +368,6 @@ static int abeoz9_rtc_setup(struct device *dev, struct device_node *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct rtc_class_ops rtc_ops = {
|
static const struct rtc_class_ops rtc_ops = {
|
||||||
.read_time = abeoz9_rtc_get_time,
|
|
||||||
.set_time = abeoz9_rtc_set_time,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct rtc_class_ops rtc_alarm_ops = {
|
|
||||||
.read_time = abeoz9_rtc_get_time,
|
.read_time = abeoz9_rtc_get_time,
|
||||||
.set_time = abeoz9_rtc_set_time,
|
.set_time = abeoz9_rtc_set_time,
|
||||||
.read_alarm = abeoz9_rtc_read_alarm,
|
.read_alarm = abeoz9_rtc_read_alarm,
|
||||||
@@ -540,6 +535,7 @@ static int abeoz9_probe(struct i2c_client *client,
|
|||||||
data->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
|
data->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
|
||||||
data->rtc->range_max = RTC_TIMESTAMP_END_2099;
|
data->rtc->range_max = RTC_TIMESTAMP_END_2099;
|
||||||
data->rtc->uie_unsupported = 1;
|
data->rtc->uie_unsupported = 1;
|
||||||
|
clear_bit(RTC_FEATURE_ALARM, data->rtc->features);
|
||||||
|
|
||||||
if (client->irq > 0) {
|
if (client->irq > 0) {
|
||||||
ret = devm_request_threaded_irq(dev, client->irq, NULL,
|
ret = devm_request_threaded_irq(dev, client->irq, NULL,
|
||||||
@@ -554,7 +550,7 @@ static int abeoz9_probe(struct i2c_client *client,
|
|||||||
|
|
||||||
if (client->irq > 0 || device_property_read_bool(dev, "wakeup-source")) {
|
if (client->irq > 0 || device_property_read_bool(dev, "wakeup-source")) {
|
||||||
ret = device_init_wakeup(dev, true);
|
ret = device_init_wakeup(dev, true);
|
||||||
data->rtc->ops = &rtc_alarm_ops;
|
set_bit(RTC_FEATURE_ALARM, data->rtc->features);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_rtc_register_device(data->rtc);
|
ret = devm_rtc_register_device(data->rtc);
|
||||||
|
|||||||
Reference in New Issue
Block a user