linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liam Beguin <liambeguin@gmail.com>
To: liambeguin@gmail.com, a.zummo@towertech.it,
	alexandre.belloni@bootlin.com, panfilov.artyom@gmail.com
Cc: linux-rtc@vger.kernel.org
Subject: [PATCH v2 3/3] rtc: ab-eoz9: make use of RTC_FEATURE_ALARM
Date: Wed,  7 Apr 2021 22:40:28 -0400	[thread overview]
Message-ID: <20210408024028.3526564-4-liambeguin@gmail.com> (raw)
In-Reply-To: <20210408024028.3526564-1-liambeguin@gmail.com>

From: Liam Beguin <lvb@xiphos.com>

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>
---
 drivers/rtc/rtc-ab-eoz9.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c
index 7dc96fabc76f..a9b355510cd4 100644
--- a/drivers/rtc/rtc-ab-eoz9.c
+++ b/drivers/rtc/rtc-ab-eoz9.c
@@ -368,11 +368,6 @@ static int abeoz9_rtc_setup(struct device *dev, struct device_node *node)
 }
 
 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,
 	.set_time = abeoz9_rtc_set_time,
 	.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_max = RTC_TIMESTAMP_END_2099;
 	data->rtc->uie_unsupported = 1;
+	clear_bit(RTC_FEATURE_ALARM, data->rtc->features);
 
 	if (client->irq > 0) {
 		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")) {
 		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);
-- 
2.30.1.489.g328c10930387


  parent reply	other threads:[~2021-04-08  2:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  2:40 [PATCH v2 0/3] add alarm support for the rtc-ab-eoz9 Liam Beguin
2021-04-08  2:40 ` [PATCH v2 1/3] rtc: ab-eoz9: set regmap max_register Liam Beguin
2021-04-08  2:40 ` [PATCH v2 2/3] rtc: ab-eoz9: add alarm support Liam Beguin
2021-04-08  2:40 ` Liam Beguin [this message]
2021-04-16 22:09 ` [PATCH v2 0/3] add alarm support for the rtc-ab-eoz9 Alexandre Belloni
2021-04-16 22:29   ` Liam Beguin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408024028.3526564-4-liambeguin@gmail.com \
    --to=liambeguin@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=panfilov.artyom@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).