aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rv8803.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2024-01-08 01:43:57 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-01-15 22:29:48 +0100
commit83c0711453e54dc696b13e9512fbbed6d9180ea2 (patch)
tree553a248f6b74f5df9b3b1398ee3b16782ac7365f /drivers/rtc/rtc-rv8803.c
parenteea7615b684fc98cd0403beaaa2194e6f029c812 (diff)
downloadlinux-83c0711453e54dc696b13e9512fbbed6d9180ea2.tar.gz
rtc: rv8803: add wakeup-source support
The RV8803 can be wired directly to a PMIC that can wake up an SoC without the CPU getting interrupts. Link: https://lore.kernel.org/r/20240108004357.602918-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-rv8803.c')
-rw-r--r--drivers/rtc/rtc-rv8803.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index 11e6b0d31f5d7..1327251e527c2 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -712,9 +712,12 @@ static int rv8803_probe(struct i2c_client *client)
if (err)
dev_err(&client->dev, "failed to set wake IRQ\n");
}
+ } else {
+ if (device_property_read_bool(&client->dev, "wakeup-source"))
+ device_init_wakeup(&client->dev, true);
+ else
+ clear_bit(RTC_FEATURE_ALARM, rv8803->rtc->features);
}
- if (!client->irq)
- clear_bit(RTC_FEATURE_ALARM, rv8803->rtc->features);
if (of_property_read_bool(client->dev.of_node, "epson,vdet-disable"))
rv8803->backup |= RX8900_FLAG_VDETOFF;