Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: imx258: 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>

authored by

Laurent Pinchart and committed by
Hans Verkuil
e1124ace b8074db0

-36
-36
drivers/media/i2c/imx258.c
··· 622 622 */ 623 623 struct mutex mutex; 624 624 625 - /* Streaming on/off */ 626 - bool streaming; 627 - 628 625 struct clk *clk; 629 626 }; 630 627 ··· 1050 1053 pm_runtime_put(&client->dev); 1051 1054 } 1052 1055 1053 - imx258->streaming = enable; 1054 1056 mutex_unlock(&imx258->mutex); 1055 1057 1056 1058 return ret; ··· 1059 1063 err_unlock: 1060 1064 mutex_unlock(&imx258->mutex); 1061 1065 1062 - return ret; 1063 - } 1064 - 1065 - static int __maybe_unused imx258_suspend(struct device *dev) 1066 - { 1067 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1068 - struct imx258 *imx258 = to_imx258(sd); 1069 - 1070 - if (imx258->streaming) 1071 - imx258_stop_streaming(imx258); 1072 - 1073 - return 0; 1074 - } 1075 - 1076 - static int __maybe_unused imx258_resume(struct device *dev) 1077 - { 1078 - struct v4l2_subdev *sd = dev_get_drvdata(dev); 1079 - struct imx258 *imx258 = to_imx258(sd); 1080 - int ret; 1081 - 1082 - if (imx258->streaming) { 1083 - ret = imx258_start_streaming(imx258); 1084 - if (ret) 1085 - goto error; 1086 - } 1087 - 1088 - return 0; 1089 - 1090 - error: 1091 - imx258_stop_streaming(imx258); 1092 - imx258->streaming = 0; 1093 1066 return ret; 1094 1067 } 1095 1068 ··· 1330 1365 } 1331 1366 1332 1367 static const struct dev_pm_ops imx258_pm_ops = { 1333 - SET_SYSTEM_SLEEP_PM_OPS(imx258_suspend, imx258_resume) 1334 1368 SET_RUNTIME_PM_OPS(imx258_power_off, imx258_power_on, NULL) 1335 1369 }; 1336 1370