Commit 56e9e480 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Hans Verkuil

media: i2c: ov9734: 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>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 19ae6ba5
...@@ -337,9 +337,6 @@ struct ov9734 { ...@@ -337,9 +337,6 @@ struct ov9734 {
/* To serialize asynchronus callbacks */ /* To serialize asynchronus callbacks */
struct mutex mutex; struct mutex mutex;
/* Streaming on/off */
bool streaming;
}; };
static inline struct ov9734 *to_ov9734(struct v4l2_subdev *subdev) static inline struct ov9734 *to_ov9734(struct v4l2_subdev *subdev)
...@@ -679,49 +676,11 @@ static int ov9734_set_stream(struct v4l2_subdev *sd, int enable) ...@@ -679,49 +676,11 @@ static int ov9734_set_stream(struct v4l2_subdev *sd, int enable)
pm_runtime_put(&client->dev); pm_runtime_put(&client->dev);
} }
ov9734->streaming = enable;
mutex_unlock(&ov9734->mutex); mutex_unlock(&ov9734->mutex);
return ret; return ret;
} }
static int __maybe_unused ov9734_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct ov9734 *ov9734 = to_ov9734(sd);
mutex_lock(&ov9734->mutex);
if (ov9734->streaming)
ov9734_stop_streaming(ov9734);
mutex_unlock(&ov9734->mutex);
return 0;
}
static int __maybe_unused ov9734_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct ov9734 *ov9734 = to_ov9734(sd);
int ret = 0;
mutex_lock(&ov9734->mutex);
if (!ov9734->streaming)
goto exit;
ret = ov9734_start_streaming(ov9734);
if (ret) {
ov9734->streaming = false;
ov9734_stop_streaming(ov9734);
}
exit:
mutex_unlock(&ov9734->mutex);
return ret;
}
static int ov9734_set_format(struct v4l2_subdev *sd, static int ov9734_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
...@@ -1007,10 +966,6 @@ static int ov9734_probe(struct i2c_client *client) ...@@ -1007,10 +966,6 @@ static int ov9734_probe(struct i2c_client *client)
return ret; return ret;
} }
static const struct dev_pm_ops ov9734_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(ov9734_suspend, ov9734_resume)
};
static const struct acpi_device_id ov9734_acpi_ids[] = { static const struct acpi_device_id ov9734_acpi_ids[] = {
{ "OVTI9734", }, { "OVTI9734", },
{} {}
...@@ -1021,7 +976,6 @@ MODULE_DEVICE_TABLE(acpi, ov9734_acpi_ids); ...@@ -1021,7 +976,6 @@ MODULE_DEVICE_TABLE(acpi, ov9734_acpi_ids);
static struct i2c_driver ov9734_i2c_driver = { static struct i2c_driver ov9734_i2c_driver = {
.driver = { .driver = {
.name = "ov9734", .name = "ov9734",
.pm = &ov9734_pm_ops,
.acpi_match_table = ov9734_acpi_ids, .acpi_match_table = ov9734_acpi_ids,
}, },
.probe = ov9734_probe, .probe = ov9734_probe,
......
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