media: i2c: imx258: Drop system suspend and resume handlers
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 14 Sep 2023 18:16:50 +0000 (21:16 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 27 Sep 2023 07:40:00 +0000 (09:40 +0200)
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>
drivers/media/i2c/imx258.c

index 4be0422b7cdace4d8be4db85b2368fad2b7130e1..b3827f4bc0eb35c489dab8c8b0f728d2edf7ad8d 100644 (file)
@@ -622,9 +622,6 @@ struct imx258 {
         */
        struct mutex mutex;
 
-       /* Streaming on/off */
-       bool streaming;
-
        struct clk *clk;
 };
 
@@ -1053,7 +1050,6 @@ static int imx258_set_stream(struct v4l2_subdev *sd, int enable)
                pm_runtime_put(&client->dev);
        }
 
-       imx258->streaming = enable;
        mutex_unlock(&imx258->mutex);
 
        return ret;
@@ -1066,37 +1062,6 @@ err_unlock:
        return ret;
 }
 
-static int __maybe_unused imx258_suspend(struct device *dev)
-{
-       struct v4l2_subdev *sd = dev_get_drvdata(dev);
-       struct imx258 *imx258 = to_imx258(sd);
-
-       if (imx258->streaming)
-               imx258_stop_streaming(imx258);
-
-       return 0;
-}
-
-static int __maybe_unused imx258_resume(struct device *dev)
-{
-       struct v4l2_subdev *sd = dev_get_drvdata(dev);
-       struct imx258 *imx258 = to_imx258(sd);
-       int ret;
-
-       if (imx258->streaming) {
-               ret = imx258_start_streaming(imx258);
-               if (ret)
-                       goto error;
-       }
-
-       return 0;
-
-error:
-       imx258_stop_streaming(imx258);
-       imx258->streaming = 0;
-       return ret;
-}
-
 /* Verify chip ID */
 static int imx258_identify_module(struct imx258 *imx258)
 {
@@ -1365,7 +1330,6 @@ static void imx258_remove(struct i2c_client *client)
 }
 
 static const struct dev_pm_ops imx258_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(imx258_suspend, imx258_resume)
        SET_RUNTIME_PM_OPS(imx258_power_off, imx258_power_on, NULL)
 };