mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
media: i2c: hi556: 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
2c13a5ad04
commit
5d821eb21f
@ -577,9 +577,6 @@ struct hi556 {
|
||||
/* To serialize asynchronus callbacks */
|
||||
struct mutex mutex;
|
||||
|
||||
/* Streaming on/off */
|
||||
bool streaming;
|
||||
|
||||
/* True if the device has been identified */
|
||||
bool identified;
|
||||
};
|
||||
@ -995,50 +992,11 @@ static int hi556_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
pm_runtime_put(&client->dev);
|
||||
}
|
||||
|
||||
hi556->streaming = enable;
|
||||
mutex_unlock(&hi556->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused hi556_suspend(struct device *dev)
|
||||
{
|
||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
||||
struct hi556 *hi556 = to_hi556(sd);
|
||||
|
||||
mutex_lock(&hi556->mutex);
|
||||
if (hi556->streaming)
|
||||
hi556_stop_streaming(hi556);
|
||||
|
||||
mutex_unlock(&hi556->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused hi556_resume(struct device *dev)
|
||||
{
|
||||
struct v4l2_subdev *sd = dev_get_drvdata(dev);
|
||||
struct hi556 *hi556 = to_hi556(sd);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&hi556->mutex);
|
||||
if (hi556->streaming) {
|
||||
ret = hi556_start_streaming(hi556);
|
||||
if (ret)
|
||||
goto error;
|
||||
}
|
||||
|
||||
mutex_unlock(&hi556->mutex);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
hi556_stop_streaming(hi556);
|
||||
hi556->streaming = 0;
|
||||
mutex_unlock(&hi556->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hi556_set_format(struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_state *sd_state,
|
||||
struct v4l2_subdev_format *fmt)
|
||||
@ -1328,10 +1286,6 @@ probe_error_v4l2_ctrl_handler_free:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops hi556_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(hi556_suspend, hi556_resume)
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id hi556_acpi_ids[] = {
|
||||
{"INT3537"},
|
||||
@ -1344,7 +1298,6 @@ MODULE_DEVICE_TABLE(acpi, hi556_acpi_ids);
|
||||
static struct i2c_driver hi556_i2c_driver = {
|
||||
.driver = {
|
||||
.name = "hi556",
|
||||
.pm = &hi556_pm_ops,
|
||||
.acpi_match_table = ACPI_PTR(hi556_acpi_ids),
|
||||
},
|
||||
.probe = hi556_probe,
|
||||
|
Loading…
Reference in New Issue
Block a user