Skip to content

Commit

Permalink
rtc: rv8803: add wakeup-source support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alexandrebelloni committed Jan 15, 2024
1 parent eea7615 commit 83c0711
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/rtc/epson,rx8900.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ properties:
trickle-diode-disable: true

wakeup-source: true

required:
- compatible
- reg
Expand Down
7 changes: 5 additions & 2 deletions drivers/rtc/rtc-rv8803.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 83c0711

Please sign in to comment.