mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
media: i2c: ov13858: 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: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
b8b84d7530
commit
f82344daa7
@ -1044,9 +1044,6 @@ struct ov13858 {
|
|||||||
|
|
||||||
/* Mutex for serialized access */
|
/* Mutex for serialized access */
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
||||||
/* Streaming on/off */
|
|
||||||
bool streaming;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define to_ov13858(_sd) container_of(_sd, struct ov13858, sd)
|
#define to_ov13858(_sd) container_of(_sd, struct ov13858, sd)
|
||||||
@ -1485,7 +1482,6 @@ static int ov13858_set_stream(struct v4l2_subdev *sd, int enable)
|
|||||||
pm_runtime_put(&client->dev);
|
pm_runtime_put(&client->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
ov13858->streaming = enable;
|
|
||||||
mutex_unlock(&ov13858->mutex);
|
mutex_unlock(&ov13858->mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1498,37 +1494,6 @@ err_unlock:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused ov13858_suspend(struct device *dev)
|
|
||||||
{
|
|
||||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
|
||||||
struct ov13858 *ov13858 = to_ov13858(sd);
|
|
||||||
|
|
||||||
if (ov13858->streaming)
|
|
||||||
ov13858_stop_streaming(ov13858);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __maybe_unused ov13858_resume(struct device *dev)
|
|
||||||
{
|
|
||||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
|
||||||
struct ov13858 *ov13858 = to_ov13858(sd);
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (ov13858->streaming) {
|
|
||||||
ret = ov13858_start_streaming(ov13858);
|
|
||||||
if (ret)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
error:
|
|
||||||
ov13858_stop_streaming(ov13858);
|
|
||||||
ov13858->streaming = false;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Verify chip ID */
|
/* Verify chip ID */
|
||||||
static int ov13858_identify_module(struct ov13858 *ov13858)
|
static int ov13858_identify_module(struct ov13858 *ov13858)
|
||||||
{
|
{
|
||||||
@ -1783,10 +1748,6 @@ static const struct i2c_device_id ov13858_id_table[] = {
|
|||||||
|
|
||||||
MODULE_DEVICE_TABLE(i2c, ov13858_id_table);
|
MODULE_DEVICE_TABLE(i2c, ov13858_id_table);
|
||||||
|
|
||||||
static const struct dev_pm_ops ov13858_pm_ops = {
|
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(ov13858_suspend, ov13858_resume)
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
static const struct acpi_device_id ov13858_acpi_ids[] = {
|
static const struct acpi_device_id ov13858_acpi_ids[] = {
|
||||||
{"OVTID858"},
|
{"OVTID858"},
|
||||||
@ -1799,7 +1760,6 @@ MODULE_DEVICE_TABLE(acpi, ov13858_acpi_ids);
|
|||||||
static struct i2c_driver ov13858_i2c_driver = {
|
static struct i2c_driver ov13858_i2c_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ov13858",
|
.name = "ov13858",
|
||||||
.pm = &ov13858_pm_ops,
|
|
||||||
.acpi_match_table = ACPI_PTR(ov13858_acpi_ids),
|
.acpi_match_table = ACPI_PTR(ov13858_acpi_ids),
|
||||||
},
|
},
|
||||||
.probe = ov13858_probe,
|
.probe = ov13858_probe,
|
||||||
|
Loading…
Reference in New Issue
Block a user