mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
UPSTREAM: rtc: hym8563: enable wakeup when applicable
Enable wakeup in the hym8563 driver if the IRQ was successfully requested or if wakeup-source is set in the devicetree. As per the description of device_init_wakeup(), it should be enabled for "devices that everyone expects to be wakeup sources". One would expect this to be the case with a real-time clock. Tested on rk3288-rock2-square, which has an IRQ configured for the RTC. As a result, wakeup was enabled during driver initialisation. Change-Id: I1e0c3f99d38c84ba7e6c15bf8919a3f30289e7ae Fixes:dcaf038493("rtc: add hym8563 rtc-driver") Reported-by: kernelci.org bot <bot@kernelci.org> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/1ea023e2ba50a4dab6e39be93d7de3146af71a60.1604653374.git.guillaume.tucker@collabora.com Signed-off-by: Tao Huang <huangtao@rock-chips.com> (cherry picked from commitc56ac7a0f4)
This commit is contained in:
committed by
Tao Huang
parent
e5f9e39692
commit
eb98d6c9f9
@@ -534,8 +534,6 @@ static int hym8563_probe(struct i2c_client *client,
|
||||
hym8563->client = client;
|
||||
i2c_set_clientdata(client, hym8563);
|
||||
|
||||
device_set_wakeup_capable(&client->dev, true);
|
||||
|
||||
ret = hym8563_init_device(client);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "could not init device, %d\n", ret);
|
||||
@@ -554,6 +552,11 @@ static int hym8563_probe(struct i2c_client *client,
|
||||
}
|
||||
}
|
||||
|
||||
if (client->irq > 0 ||
|
||||
device_property_read_bool(&client->dev, "wakeup-source")) {
|
||||
device_init_wakeup(&client->dev, true);
|
||||
}
|
||||
|
||||
/* check state of calendar information */
|
||||
ret = i2c_smbus_read_byte_data(client, HYM8563_SEC);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user