Skip to content

Commit 0a886f7

Browse files
committed
Update pixel rate for 4lane full resolution and make HBLANK controllable
1 parent 2d38887 commit 0a886f7

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

drivers/media/i2c/imx708.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ MODULE_PARM_DESC(qbc_adjust, "Quad Bayer broken line correction strength [0,2-5]
5454
#define IMX708_REG_FRAME_LENGTH 0x0340
5555
#define IMX708_FRAME_LENGTH_MAX 0xffff
5656

57+
/* H_TIMING internal */
58+
#define IMX708_REG_LINE_LENGTH 0x0342
59+
5760
/* Long exposure multiplier */
5861
#define IMX708_LONG_EXP_SHIFT_MAX 7
5962
#define IMX708_LONG_EXP_SHIFT_REG 0x3100
@@ -318,8 +321,6 @@ static const struct imx708_reg mode_common_regs[] = {
318321

319322
/* 10-bit. */
320323
static const struct imx708_reg mode_4608x2592_regs[] = {
321-
{0x0342, 0x28}, //REG_LINE_LEN_MSB 0x28, 0x3D
322-
{0x0343, 0xC0}, //REG_LINE_LEN_LSB 0xC0, 0x20
323324
{0x0340, 0x0A}, //REG_FRAME_LEN_MSB
324325
{0x0341, 0xC4}, //REG_FRAME_LEN_LSB (0xC4, 0x5A, 0x59)
325326
{0x0344, 0x00}, //REG_X_ADD_STA_MSB
@@ -701,7 +702,7 @@ static const struct imx708_mode supported_modes_10bit_no_hdr[] = {
701702
/* Full resolution. */
702703
.width = 4608,
703704
.height = 2592,
704-
.line_length_pix = 0x3d20,
705+
.line_length_pix = 10432,
705706
.crop = {
706707
.left = IMX708_PIXEL_ARRAY_LEFT,
707708
.top = IMX708_PIXEL_ARRAY_TOP,
@@ -714,7 +715,7 @@ static const struct imx708_mode supported_modes_10bit_no_hdr[] = {
714715
.num_of_regs = ARRAY_SIZE(mode_4608x2592_regs),
715716
.regs = mode_4608x2592_regs,
716717
},
717-
.pixel_rate = 595200000, //1123200000
718+
.pixel_rate = 854400000, //595200000,
718719
.exposure_lines_min = 8,
719720
.exposure_lines_step = 1,
720721
.hdr = false,
@@ -1148,11 +1149,6 @@ static void imx708_set_framing_limits(struct imx708 *imx708)
11481149
IMX708_FRAME_LENGTH_MAX) - mode->height,
11491150
1, mode->vblank_default);
11501151

1151-
/*
1152-
* Currently PPL is fixed to the mode specified value, so hblank
1153-
* depends on mode->width only, and is not changeable in any
1154-
* way other than changing the mode.
1155-
*/
11561152
hblank = mode->line_length_pix - mode->width;
11571153
__v4l2_ctrl_modify_range(imx708->hblank, hblank, hblank, 1, hblank);
11581154
}
@@ -1243,6 +1239,10 @@ static int imx708_set_ctrl(struct v4l2_ctrl *ctrl)
12431239
ret = imx708_set_frame_length(imx708,
12441240
imx708->mode->height + ctrl->val);
12451241
break;
1242+
case V4L2_CID_HBLANK:
1243+
ret = imx708_write_reg(imx708, IMX708_REG_LINE_LENGTH, 2,
1244+
imx708->mode->width + ctrl->val);
1245+
break;
12461246
case V4L2_CID_NOTIFY_GAINS:
12471247
ret = imx708_write_reg(imx708, IMX708_REG_COLOUR_BALANCE_BLUE,
12481248
IMX708_REG_VALUE_16BIT,
@@ -1937,7 +1937,6 @@ static int imx708_init_controls(struct imx708 *imx708)
19371937
goto error;
19381938
}
19391939

1940-
imx708->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
19411940
imx708->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
19421941
imx708->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
19431942
imx708->hdr_mode->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;

0 commit comments

Comments
 (0)