diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c index 79c675a608a6..43e28ba5494b 100644 --- a/drivers/rtc/rtc-s35390a.c +++ b/drivers/rtc/rtc-s35390a.c @@ -413,6 +413,22 @@ static int s35390a_rtc_ioctl(struct device *dev, unsigned int cmd, return 0; } +#ifdef CONFIG_PM_SLEEP +static int s35390a_resume(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct s35390a *s35390a = i2c_get_clientdata(client); + char buf; + + buf = S35390A_INT2_MODE_32K; + s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &buf, sizeof(buf)); + + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(s35390a_pm_ops, NULL, s35390a_resume); + static const struct rtc_class_ops s35390a_rtc_ops = { .read_time = s35390a_rtc_read_time, .set_time = s35390a_rtc_set_time, @@ -508,6 +524,7 @@ static int s35390a_probe(struct i2c_client *client) static struct i2c_driver s35390a_driver = { .driver = { .name = "rtc-s35390a", + .pm = &s35390a_pm_ops, .of_match_table = of_match_ptr(s35390a_of_match), }, .probe_new = s35390a_probe,