Commit 0484cde1 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Hans Verkuil

media: i2c: imx214: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent c628b64d
...@@ -58,8 +58,6 @@ struct imx214 { ...@@ -58,8 +58,6 @@ struct imx214 {
* and start streaming. * and start streaming.
*/ */
struct mutex mutex; struct mutex mutex;
bool streaming;
}; };
struct reg_8 { struct reg_8 {
...@@ -790,7 +788,6 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable) ...@@ -790,7 +788,6 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable)
pm_runtime_put(imx214->dev); pm_runtime_put(imx214->dev);
} }
imx214->streaming = enable;
return 0; return 0;
err_rpm_put: err_rpm_put:
...@@ -906,39 +903,6 @@ static int imx214_parse_fwnode(struct device *dev) ...@@ -906,39 +903,6 @@ static int imx214_parse_fwnode(struct device *dev)
return ret; return ret;
} }
static int __maybe_unused imx214_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct imx214 *imx214 = to_imx214(sd);
if (imx214->streaming)
imx214_stop_streaming(imx214);
return 0;
}
static int __maybe_unused imx214_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct imx214 *imx214 = to_imx214(sd);
int ret;
if (imx214->streaming) {
ret = imx214_start_streaming(imx214);
if (ret)
goto error;
}
return 0;
error:
imx214_stop_streaming(imx214);
imx214->streaming = 0;
return ret;
}
static int imx214_probe(struct i2c_client *client) static int imx214_probe(struct i2c_client *client)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
...@@ -1099,7 +1063,6 @@ static const struct of_device_id imx214_of_match[] = { ...@@ -1099,7 +1063,6 @@ static const struct of_device_id imx214_of_match[] = {
MODULE_DEVICE_TABLE(of, imx214_of_match); MODULE_DEVICE_TABLE(of, imx214_of_match);
static const struct dev_pm_ops imx214_pm_ops = { static const struct dev_pm_ops imx214_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(imx214_suspend, imx214_resume)
SET_RUNTIME_PM_OPS(imx214_power_off, imx214_power_on, NULL) SET_RUNTIME_PM_OPS(imx214_power_off, imx214_power_on, NULL)
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment