From 6771fce5060e10f6c878b5d644e9d66dd7f68950 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Fri, 29 Sep 2017 12:23:56 +0200 Subject: media: smiapp: Rely on runtime PM Instead of relying on a mix of runtime PM and the s_power() callback, drop the s_power() callback altogether and use runtime PM solely. As device access is required during device power-on and power-off sequences, runtime PM alone cannot tell whether the device is available. Thus the "active" field is introduced in struct smiapp_sensor to tell whether it is safe to write to the device. Consequently there is no need to power on the device whenever a file handle is open. This functionality is removed as well. The user may still control the device power management through sysfs. Autosuspend remains enabled, with 1 s delay. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/smiapp/smiapp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/i2c/smiapp/smiapp.h') diff --git a/drivers/media/i2c/smiapp/smiapp.h b/drivers/media/i2c/smiapp/smiapp.h index f74d695018b9..e6a5ab402d7f 100644 --- a/drivers/media/i2c/smiapp/smiapp.h +++ b/drivers/media/i2c/smiapp/smiapp.h @@ -206,6 +206,7 @@ struct smiapp_sensor { u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */ u8 frame_skip; + bool active; /* is the sensor powered on? */ u16 embedded_start; /* embedded data start line */ u16 embedded_end; u16 image_start; /* image data start line */ -- cgit