Skip to content

Commit 7773b63

Browse files
committed
media: imx355: Switch to changing pixel array clock for 2 lane mode
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 05ae907 commit 7773b63

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/media/i2c/imx355.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,7 @@ imx355_set_pad_format(struct v4l2_subdev *sd,
913913
__v4l2_ctrl_modify_range(imx355->vblank, vblank_min, height, 1,
914914
vblank_def);
915915
__v4l2_ctrl_s_ctrl(imx355->vblank, vblank_def);
916-
h_blank = (imx355->hwcfg->lane_multiplier * mode->llp) -
917-
imx355->cur_mode->width;
916+
h_blank = mode->llp - imx355->cur_mode->width;
918917
/*
919918
* Currently hblank is not changeable.
920919
* So FPS control is done only by vblank.
@@ -1003,6 +1002,10 @@ static int imx355_start_streaming(struct imx355 *imx355)
10031002
imx355->clk_params->pll_op_mpy);
10041003
if (ret)
10051004
return ret;
1005+
ret = imx355_write_reg(imx355, 0x0303, 1,
1006+
imx355->hwcfg->lane_multiplier);
1007+
if (ret)
1008+
return ret;
10061009

10071010
/* Set MIPI configuration */
10081011
ret = imx355_write_reg(imx355, IMX355_REG_LANE_SEL, 1,
@@ -1204,7 +1207,7 @@ static int imx355_init_controls(struct imx355 *imx355)
12041207
imx355->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
12051208

12061209
/* pixel_rate = link_freq * 2 * nr_of_lanes / bits_per_sample */
1207-
pixel_rate = IMX355_LINK_FREQ_DEFAULT * 2 * 4;
1210+
pixel_rate = IMX355_LINK_FREQ_DEFAULT * 2 * imx355->hwcfg->num_lanes;
12081211
do_div(pixel_rate, 10);
12091212
/* By default, PIXEL_RATE is read only */
12101213
imx355->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops,
@@ -1220,7 +1223,7 @@ static int imx355_init_controls(struct imx355 *imx355)
12201223
IMX355_FLL_MAX - mode->height,
12211224
1, vblank_def);
12221225

1223-
hblank = imx355->hwcfg->lane_multiplier * mode->llp - mode->width;
1226+
hblank = mode->llp - mode->width;
12241227
imx355->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops,
12251228
V4L2_CID_HBLANK, hblank, hblank,
12261229
1, hblank);

0 commit comments

Comments
 (0)