From 0dad1eceeb9c7497e7e2a592900ddac79b128c56 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Wed, 21 Feb 2018 16:11:09 +0100 Subject: iio: cros_ec: Relax sampling frequency before suspending If an application set a tight sampling frequency, given the interrupt use is a wakeup source, suspend will not happen: the kernel will receive a wake up interrupt and will cancel the suspend process. Given cros_ec sensors type is non wake up, this patch adds prepare and complete callbacks to set 1s sampling period just before suspend. This ensures the sensor hub will not be a source of interrupt during the suspend process. Signed-off-by: Gwendal Grignou Signed-off-by: Enric Balletbo i Serra Acked-by: Jonathan Cameron Signed-off-by: Jonathan Cameron --- drivers/iio/light/cros_ec_light_prox.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/iio/light/cros_ec_light_prox.c') diff --git a/drivers/iio/light/cros_ec_light_prox.c b/drivers/iio/light/cros_ec_light_prox.c index acfad4aeb27a..8e8a0e7f78d1 100644 --- a/drivers/iio/light/cros_ec_light_prox.c +++ b/drivers/iio/light/cros_ec_light_prox.c @@ -276,6 +276,7 @@ MODULE_DEVICE_TABLE(platform, cros_ec_light_prox_ids); static struct platform_driver cros_ec_light_prox_platform_driver = { .driver = { .name = "cros-ec-light-prox", + .pm = &cros_ec_sensors_pm_ops, }, .probe = cros_ec_light_prox_probe, .id_table = cros_ec_light_prox_ids, -- cgit v1.2.3