Skip to content

Commit 4b9abbc

Browse files
Tim Van PattenTzung-Bi Shih
Tim Van Patten
authored and
Tzung-Bi Shih
committed
platform/chrome: cros_ec_lpc: Move host command to prepare/complete
Update cros_ec_lpc_pm_ops to call cros_ec_lpc_prepare() during PM .prepare() and cros_ec_lpc_complete() during .complete(). This moves the host command that the AP sends and allows the EC to log entry/exit of AP's suspend/resume more accurately. Reviewed-by: Raul E Rangel <[email protected]> Signed-off-by: Tim Van Patten <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/20230515142552.1.I17cae37888be3a8683911991602f18e482e7a621@changeid
1 parent 2cbf475 commit 4b9abbc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/platform/chrome/cros_ec_lpc.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -546,23 +546,25 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
546546
MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);
547547

548548
#ifdef CONFIG_PM_SLEEP
549-
static int cros_ec_lpc_suspend(struct device *dev)
549+
static int cros_ec_lpc_prepare(struct device *dev)
550550
{
551551
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
552552

553553
return cros_ec_suspend(ec_dev);
554554
}
555555

556-
static int cros_ec_lpc_resume(struct device *dev)
556+
static void cros_ec_lpc_complete(struct device *dev)
557557
{
558558
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
559-
560-
return cros_ec_resume(ec_dev);
559+
cros_ec_resume(ec_dev);
561560
}
562561
#endif
563562

564563
static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
565-
SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
564+
#ifdef CONFIG_PM_SLEEP
565+
.prepare = cros_ec_lpc_prepare,
566+
.complete = cros_ec_lpc_complete
567+
#endif
566568
};
567569

568570
static struct platform_driver cros_ec_lpc_driver = {

0 commit comments

Comments
 (0)