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

media: imx335: Switch to {enable,disable}_streams

Switch from s_stream to enable_streams and disable_streams callbacks.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Jai Luthra and committed by
Hans Verkuil
ca042de6 8a2451bd

+24 -29
+24 -29
drivers/media/i2c/imx335.c
··· 1012 1012 } 1013 1013 1014 1014 /** 1015 - * imx335_start_streaming() - Start sensor stream 1016 - * @imx335: pointer to imx335 device 1015 + * imx335_enable_streams() - Enable sensor streams 1016 + * @sd: V4L2 subdevice 1017 + * @state: V4L2 subdevice state 1018 + * @pad: The pad to enable 1019 + * @streams_mask: Bitmask of streams to enable 1017 1020 * 1018 1021 * Return: 0 if successful, error code otherwise. 1019 1022 */ 1020 - static int imx335_start_streaming(struct imx335 *imx335) 1023 + static int imx335_enable_streams(struct v4l2_subdev *sd, 1024 + struct v4l2_subdev_state *state, u32 pad, 1025 + u64 streams_mask) 1021 1026 { 1027 + struct imx335 *imx335 = to_imx335(sd); 1022 1028 const struct imx335_reg_list *reg_list; 1023 1029 int ret; 1024 1030 ··· 1098 1092 } 1099 1093 1100 1094 /** 1101 - * imx335_stop_streaming() - Stop sensor stream 1102 - * @imx335: pointer to imx335 device 1103 - */ 1104 - static void imx335_stop_streaming(struct imx335 *imx335) 1105 - { 1106 - cci_write(imx335->cci, IMX335_REG_MODE_SELECT, 1107 - IMX335_MODE_STANDBY, NULL); 1108 - pm_runtime_put(imx335->dev); 1109 - } 1110 - 1111 - /** 1112 - * imx335_set_stream() - Enable sensor streaming 1113 - * @sd: pointer to imx335 subdevice 1114 - * @enable: set to enable sensor streaming 1095 + * imx335_disable_streams() - Disable sensor streams 1096 + * @sd: V4L2 subdevice 1097 + * @state: V4L2 subdevice state 1098 + * @pad: The pad to disable 1099 + * @streams_mask: Bitmask of streams to disable 1115 1100 * 1116 1101 * Return: 0 if successful, error code otherwise. 1117 1102 */ 1118 - static int imx335_set_stream(struct v4l2_subdev *sd, int enable) 1103 + static int imx335_disable_streams(struct v4l2_subdev *sd, 1104 + struct v4l2_subdev_state *state, u32 pad, 1105 + u64 streams_mask) 1119 1106 { 1120 1107 struct imx335 *imx335 = to_imx335(sd); 1121 - struct v4l2_subdev_state *state; 1122 - int ret = 0; 1108 + int ret; 1123 1109 1124 - state = v4l2_subdev_lock_and_get_active_state(sd); 1125 - 1126 - if (enable) 1127 - ret = imx335_start_streaming(imx335); 1128 - else 1129 - imx335_stop_streaming(imx335); 1130 - 1131 - v4l2_subdev_unlock_state(state); 1110 + ret = cci_write(imx335->cci, IMX335_REG_MODE_SELECT, 1111 + IMX335_MODE_STANDBY, NULL); 1112 + pm_runtime_put(imx335->dev); 1132 1113 1133 1114 return ret; 1134 1115 } ··· 1235 1242 1236 1243 /* V4l2 subdevice ops */ 1237 1244 static const struct v4l2_subdev_video_ops imx335_video_ops = { 1238 - .s_stream = imx335_set_stream, 1245 + .s_stream = v4l2_subdev_s_stream_helper, 1239 1246 }; 1240 1247 1241 1248 static const struct v4l2_subdev_pad_ops imx335_pad_ops = { ··· 1245 1252 .set_selection = imx335_get_selection, 1246 1253 .get_fmt = v4l2_subdev_get_fmt, 1247 1254 .set_fmt = imx335_set_pad_format, 1255 + .enable_streams = imx335_enable_streams, 1256 + .disable_streams = imx335_disable_streams, 1248 1257 }; 1249 1258 1250 1259 static const struct v4l2_subdev_ops imx335_subdev_ops = {