diff options
author | Archana Patni <archana.patni@intel.com> | 2017-05-16 11:46:48 -0400 |
---|---|---|
committer | Benson Leung <bleung@chromium.org> | 2017-06-23 19:12:16 -0400 |
commit | 450de8f43fa665189b8663ae54985152781fb6a4 (patch) | |
tree | 84b33c29bc27bfe35cf0f491b4912a70ede1af67 | |
parent | 12278dc7c572e87727715ecce9cda15b70efeca5 (diff) |
platform/chrome: cros_ec_lpc: Add power management ops
This patch adds suspend and resume pm ops to the LPC ChromeOS EC driver.
These LPC handlers call the croc_ec generic handlers.
Signed-off-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
-rw-r--r-- | drivers/platform/chrome/cros_ec_lpc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index 9070352168a6..89afad7bb16e 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c | |||
@@ -333,10 +333,31 @@ static struct dmi_system_id cros_ec_lpc_dmi_table[] __initdata = { | |||
333 | }; | 333 | }; |
334 | MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table); | 334 | MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table); |
335 | 335 | ||
336 | #ifdef CONFIG_PM_SLEEP | ||
337 | static int cros_ec_lpc_suspend(struct device *dev) | ||
338 | { | ||
339 | struct cros_ec_device *ec_dev = dev_get_drvdata(dev); | ||
340 | |||
341 | return cros_ec_suspend(ec_dev); | ||
342 | } | ||
343 | |||
344 | static int cros_ec_lpc_resume(struct device *dev) | ||
345 | { | ||
346 | struct cros_ec_device *ec_dev = dev_get_drvdata(dev); | ||
347 | |||
348 | return cros_ec_resume(ec_dev); | ||
349 | } | ||
350 | #endif | ||
351 | |||
352 | const struct dev_pm_ops cros_ec_lpc_pm_ops = { | ||
353 | SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume) | ||
354 | }; | ||
355 | |||
336 | static struct platform_driver cros_ec_lpc_driver = { | 356 | static struct platform_driver cros_ec_lpc_driver = { |
337 | .driver = { | 357 | .driver = { |
338 | .name = DRV_NAME, | 358 | .name = DRV_NAME, |
339 | .acpi_match_table = cros_ec_lpc_acpi_device_ids, | 359 | .acpi_match_table = cros_ec_lpc_acpi_device_ids, |
360 | .pm = &cros_ec_lpc_pm_ops, | ||
340 | }, | 361 | }, |
341 | .probe = cros_ec_lpc_probe, | 362 | .probe = cros_ec_lpc_probe, |
342 | .remove = cros_ec_lpc_remove, | 363 | .remove = cros_ec_lpc_remove, |