Skip to content

Commit 76d6279

Browse files
jailuthrapelwell
authored andcommitted
media: imx335: Switch to {enable,disable}_streams
commit ca042de upstream. 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>
1 parent a991394 commit 76d6279

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

drivers/media/i2c/imx335.c

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,13 +1019,19 @@ static int imx335_set_framefmt(struct imx335 *imx335)
10191019
}
10201020

10211021
/**
1022-
* imx335_start_streaming() - Start sensor stream
1023-
* @imx335: pointer to imx335 device
1022+
* imx335_enable_streams() - Enable sensor streams
1023+
* @sd: V4L2 subdevice
1024+
* @state: V4L2 subdevice state
1025+
* @pad: The pad to enable
1026+
* @streams_mask: Bitmask of streams to enable
10241027
*
10251028
* Return: 0 if successful, error code otherwise.
10261029
*/
1027-
static int imx335_start_streaming(struct imx335 *imx335)
1030+
static int imx335_enable_streams(struct v4l2_subdev *sd,
1031+
struct v4l2_subdev_state *state, u32 pad,
1032+
u64 streams_mask)
10281033
{
1034+
struct imx335 *imx335 = to_imx335(sd);
10291035
const struct imx335_reg_list *reg_list;
10301036
int ret;
10311037

@@ -1099,37 +1105,24 @@ static int imx335_start_streaming(struct imx335 *imx335)
10991105
}
11001106

11011107
/**
1102-
* imx335_stop_streaming() - Stop sensor stream
1103-
* @imx335: pointer to imx335 device
1104-
*/
1105-
static void imx335_stop_streaming(struct imx335 *imx335)
1106-
{
1107-
cci_write(imx335->cci, IMX335_REG_MODE_SELECT,
1108-
IMX335_MODE_STANDBY, NULL);
1109-
pm_runtime_put(imx335->dev);
1110-
}
1111-
1112-
/**
1113-
* imx335_set_stream() - Enable sensor streaming
1114-
* @sd: pointer to imx335 subdevice
1115-
* @enable: set to enable sensor streaming
1108+
* imx335_disable_streams() - Disable sensor streams
1109+
* @sd: V4L2 subdevice
1110+
* @state: V4L2 subdevice state
1111+
* @pad: The pad to disable
1112+
* @streams_mask: Bitmask of streams to disable
11161113
*
11171114
* Return: 0 if successful, error code otherwise.
11181115
*/
1119-
static int imx335_set_stream(struct v4l2_subdev *sd, int enable)
1116+
static int imx335_disable_streams(struct v4l2_subdev *sd,
1117+
struct v4l2_subdev_state *state, u32 pad,
1118+
u64 streams_mask)
11201119
{
11211120
struct imx335 *imx335 = to_imx335(sd);
1122-
struct v4l2_subdev_state *state;
1123-
int ret = 0;
1124-
1125-
state = v4l2_subdev_lock_and_get_active_state(sd);
1126-
1127-
if (enable)
1128-
ret = imx335_start_streaming(imx335);
1129-
else
1130-
imx335_stop_streaming(imx335);
1121+
int ret;
11311122

1132-
v4l2_subdev_unlock_state(state);
1123+
ret = cci_write(imx335->cci, IMX335_REG_MODE_SELECT,
1124+
IMX335_MODE_STANDBY, NULL);
1125+
pm_runtime_put(imx335->dev);
11331126

11341127
return ret;
11351128
}
@@ -1249,7 +1242,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
12491242

12501243
/* V4l2 subdevice ops */
12511244
static const struct v4l2_subdev_video_ops imx335_video_ops = {
1252-
.s_stream = imx335_set_stream,
1245+
.s_stream = v4l2_subdev_s_stream_helper,
12531246
};
12541247

12551248
static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
@@ -1259,6 +1252,8 @@ static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
12591252
.set_selection = imx335_get_selection,
12601253
.get_fmt = v4l2_subdev_get_fmt,
12611254
.set_fmt = imx335_set_pad_format,
1255+
.enable_streams = imx335_enable_streams,
1256+
.disable_streams = imx335_disable_streams,
12621257
};
12631258

12641259
static const struct v4l2_subdev_ops imx335_subdev_ops = {

0 commit comments

Comments
 (0)