mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-11 13:04:03 +08:00
media: i2c: imx208: 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
35e663b4a3
commit
c628b64d31
@ -290,9 +290,6 @@ struct imx208 {
|
||||
*/
|
||||
struct mutex imx208_mx;
|
||||
|
||||
/* Streaming on/off */
|
||||
bool streaming;
|
||||
|
||||
/* OTP data */
|
||||
bool otp_read;
|
||||
char otp_data[IMX208_OTP_SIZE];
|
||||
@ -734,7 +731,6 @@ static int imx208_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
pm_runtime_put(&client->dev);
|
||||
}
|
||||
|
||||
imx208->streaming = enable;
|
||||
mutex_unlock(&imx208->imx208_mx);
|
||||
|
||||
/* vflip and hflip cannot change during streaming */
|
||||
@ -750,40 +746,6 @@ err_rpm_put:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused imx208_suspend(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct v4l2_subdev *sd = i2c_get_clientdata(client);
|
||||
struct imx208 *imx208 = to_imx208(sd);
|
||||
|
||||
if (imx208->streaming)
|
||||
imx208_stop_streaming(imx208);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused imx208_resume(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct v4l2_subdev *sd = i2c_get_clientdata(client);
|
||||
struct imx208 *imx208 = to_imx208(sd);
|
||||
int ret;
|
||||
|
||||
if (imx208->streaming) {
|
||||
ret = imx208_start_streaming(imx208);
|
||||
if (ret)
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
imx208_stop_streaming(imx208);
|
||||
imx208->streaming = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Verify chip ID */
|
||||
static const struct v4l2_subdev_video_ops imx208_video_ops = {
|
||||
.s_stream = imx208_set_stream,
|
||||
@ -1077,10 +1039,6 @@ static void imx208_remove(struct i2c_client *client)
|
||||
mutex_destroy(&imx208->imx208_mx);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops imx208_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(imx208_suspend, imx208_resume)
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id imx208_acpi_ids[] = {
|
||||
{ "INT3478" },
|
||||
@ -1093,7 +1051,6 @@ MODULE_DEVICE_TABLE(acpi, imx208_acpi_ids);
|
||||
static struct i2c_driver imx208_i2c_driver = {
|
||||
.driver = {
|
||||
.name = "imx208",
|
||||
.pm = &imx208_pm_ops,
|
||||
.acpi_match_table = ACPI_PTR(imx208_acpi_ids),
|
||||
},
|
||||
.probe = imx208_probe,
|
||||
|
Loading…
Reference in New Issue
Block a user