WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3e9701c

Browse files
committed
media: imx335: Switch to {enable,disable}_streams
commit ca042de64800a0bcc3e0866e4efaa4a657e8ddc9 upstream. Switch from s_stream to enable_streams and disable_streams callbacks. Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Jai Luthra <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 75d8397 commit 3e9701c

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
}
@@ -1250,7 +1243,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
12501243

12511244
/* V4l2 subdevice ops */
12521245
static const struct v4l2_subdev_video_ops imx335_video_ops = {
1253-
.s_stream = imx335_set_stream,
1246+
.s_stream = v4l2_subdev_s_stream_helper,
12541247
};
12551248

12561249
static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
@@ -1260,6 +1253,8 @@ static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
12601253
.set_selection = imx335_get_selection,
12611254
.get_fmt = v4l2_subdev_get_fmt,
12621255
.set_fmt = imx335_set_pad_format,
1256+
.enable_streams = imx335_enable_streams,
1257+
.disable_streams = imx335_disable_streams,
12631258
};
12641259

12651260
static const struct v4l2_subdev_ops imx335_subdev_ops = {

0 commit comments

Comments
 (0)