Commit 83c07114 authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent eea7615b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ properties:

  trickle-diode-disable: true

  wakeup-source: true

required:
  - compatible
  - reg
+5 −2
Original line number Diff line number Diff line
@@ -712,9 +712,12 @@ static int rv8803_probe(struct i2c_client *client)
			if (err)
				dev_err(&client->dev, "failed to set wake IRQ\n");
		}
	}
	if (!client->irq)
	} 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 (of_property_read_bool(client->dev.of_node, "epson,vdet-disable"))
		rv8803->backup |= RX8900_FLAG_VDETOFF;