media: i2c: ar0521: Drop system suspend and resume handlers
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 14 Sep 2023 18:16:42 +0000 (21:16 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 27 Sep 2023 07:39:59 +0000 (09:39 +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>
Acked-by: Krzysztof HaƂasa <khalasa@piap.pl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ar0521.c

index a4e39871e8f75c558af3f0e244aee985425102c1..701f36345f1e767212bc6b6b7a547c553e1c3ae4 100644 (file)
@@ -133,8 +133,6 @@ struct ar0521_dev {
                u16 mult2;
                u16 vt_pix;
        } pll;
-
-       bool streaming;
 };
 
 static inline struct ar0521_dev *to_ar0521_dev(struct v4l2_subdev *sd)
@@ -991,12 +989,9 @@ static int ar0521_s_stream(struct v4l2_subdev *sd, int enable)
        int ret;
 
        mutex_lock(&sensor->lock);
-
        ret = ar0521_set_stream(sensor, enable);
-       if (!ret)
-               sensor->streaming = enable;
-
        mutex_unlock(&sensor->lock);
+
        return ret;
 }
 
@@ -1023,28 +1018,6 @@ static const struct v4l2_subdev_ops ar0521_subdev_ops = {
        .pad = &ar0521_pad_ops,
 };
 
-static int __maybe_unused ar0521_suspend(struct device *dev)
-{
-       struct v4l2_subdev *sd = dev_get_drvdata(dev);
-       struct ar0521_dev *sensor = to_ar0521_dev(sd);
-
-       if (sensor->streaming)
-               ar0521_set_stream(sensor, 0);
-
-       return 0;
-}
-
-static int __maybe_unused ar0521_resume(struct device *dev)
-{
-       struct v4l2_subdev *sd = dev_get_drvdata(dev);
-       struct ar0521_dev *sensor = to_ar0521_dev(sd);
-
-       if (sensor->streaming)
-               return ar0521_set_stream(sensor, 1);
-
-       return 0;
-}
-
 static int ar0521_probe(struct i2c_client *client)
 {
        struct v4l2_fwnode_endpoint ep = {
@@ -1183,7 +1156,6 @@ static void ar0521_remove(struct i2c_client *client)
 }
 
 static const struct dev_pm_ops ar0521_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(ar0521_suspend, ar0521_resume)
        SET_RUNTIME_PM_OPS(ar0521_power_off, ar0521_power_on, NULL)
 };
 static const struct of_device_id ar0521_dt_ids[] = {