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

media: i2c: imx214: 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>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
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
0484cde1 c628b64d

-37
-37
drivers/media/i2c/imx214.c
··· 58 58 * and start streaming. 59 59 */ 60 60 struct mutex mutex; 61 - 62 - bool streaming; 63 61 }; 64 62 65 63 struct reg_8 { ··· 788 790 pm_runtime_put(imx214->dev); 789 791 } 790 792 791 - imx214->streaming = enable; 792 793 return 0; 793 794 794 795 err_rpm_put: ··· 900 903 done: 901 904 v4l2_fwnode_endpoint_free(&bus_cfg); 902 905 fwnode_handle_put(endpoint); 903 - return ret; 904 - } 905 - 906 - static int __maybe_unused imx214_suspend(struct device *dev) 907 - { 908 - struct i2c_client *client = to_i2c_client(dev); 909 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 910 - struct imx214 *imx214 = to_imx214(sd); 911 - 912 - if (imx214->streaming) 913 - imx214_stop_streaming(imx214); 914 - 915 - return 0; 916 - } 917 - 918 - static int __maybe_unused imx214_resume(struct device *dev) 919 - { 920 - struct i2c_client *client = to_i2c_client(dev); 921 - struct v4l2_subdev *sd = i2c_get_clientdata(client); 922 - struct imx214 *imx214 = to_imx214(sd); 923 - int ret; 924 - 925 - if (imx214->streaming) { 926 - ret = imx214_start_streaming(imx214); 927 - if (ret) 928 - goto error; 929 - } 930 - 931 - return 0; 932 - 933 - error: 934 - imx214_stop_streaming(imx214); 935 - imx214->streaming = 0; 936 906 return ret; 937 907 } 938 908 ··· 1063 1099 MODULE_DEVICE_TABLE(of, imx214_of_match); 1064 1100 1065 1101 static const struct dev_pm_ops imx214_pm_ops = { 1066 - SET_SYSTEM_SLEEP_PM_OPS(imx214_suspend, imx214_resume) 1067 1102 SET_RUNTIME_PM_OPS(imx214_power_off, imx214_power_on, NULL) 1068 1103 }; 1069 1104