Skip to content

Commit 058bf14

Browse files
Yilun LinEnric Balletbo i Serra
authored andcommitted
platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
Add EC host command to inform EC of AP suspend/resume status. Signed-off-by: Yilun Lin <[email protected]> Tested-by: Pi-Hsun Shih <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
1 parent 38d3cfb commit 058bf14

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/platform/chrome/cros_ec_rpmsg.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev)
236236
cancel_work_sync(&ec_rpmsg->host_event_work);
237237
}
238238

239+
#ifdef CONFIG_PM_SLEEP
240+
static int cros_ec_rpmsg_suspend(struct device *dev)
241+
{
242+
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
243+
244+
return cros_ec_suspend(ec_dev);
245+
}
246+
247+
static int cros_ec_rpmsg_resume(struct device *dev)
248+
{
249+
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
250+
251+
return cros_ec_resume(ec_dev);
252+
}
253+
#endif
254+
255+
static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend,
256+
cros_ec_rpmsg_resume);
257+
239258
static const struct of_device_id cros_ec_rpmsg_of_match[] = {
240259
{ .compatible = "google,cros-ec-rpmsg", },
241260
{ }
@@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = {
246265
.drv = {
247266
.name = "cros-ec-rpmsg",
248267
.of_match_table = cros_ec_rpmsg_of_match,
268+
.pm = &cros_ec_rpmsg_pm_ops,
249269
},
250270
.probe = cros_ec_rpmsg_probe,
251271
.remove = cros_ec_rpmsg_remove,

0 commit comments

Comments
 (0)