Skip to content

Commit 1714888

Browse files
committed
media: imx355: Set LINE_LENGTH_PCK programmatically
The driver already has the line length stored in the mode structure, but also had the same value set via register writes in the mode's register list. Remove this duplication. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> --- This should be possible via a set_ctrl(V4L2_CID_HBLANK) hook, but something is wrong with the pm_runtime handling here, and the call to __v4l2_ctrl_handler_setup fails at the pm_runtime_get_if_in_use stage for all the calls.
1 parent 5feb272 commit 1714888

1 file changed

Lines changed: 10 additions & 28 deletions

File tree

drivers/media/i2c/imx355.c

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#define IMX355_REG_FLL 0x0340
3535
#define IMX355_FLL_MAX 0xffff
3636

37+
#define IMX355_REG_LLP 0x0342
38+
#define IMX355_LLP_MAX 0xffff
39+
3740
#define IMX355_REG_X_ADD_START 0x0344
3841
#define IMX355_REG_Y_ADD_START 0x0346
3942
#define IMX355_REG_X_ADD_END 0x0348
@@ -266,8 +269,6 @@ static const struct imx355_reg_list imx355_global_setting = {
266269
};
267270

268271
static const struct imx355_reg mode_3268x2448_regs[] = {
269-
{ 0x0342, 0x0e },
270-
{ 0x0343, 0x58 },
271272
{ 0x0900, 0x00 },
272273
{ 0x0901, 0x11 },
273274
{ 0x0902, 0x00 },
@@ -276,8 +277,6 @@ static const struct imx355_reg mode_3268x2448_regs[] = {
276277
};
277278

278279
static const struct imx355_reg mode_3264x2448_regs[] = {
279-
{ 0x0342, 0x0e },
280-
{ 0x0343, 0x58 },
281280
{ 0x0900, 0x00 },
282281
{ 0x0901, 0x11 },
283282
{ 0x0902, 0x00 },
@@ -286,8 +285,6 @@ static const struct imx355_reg mode_3264x2448_regs[] = {
286285
};
287286

288287
static const struct imx355_reg mode_3280x2464_regs[] = {
289-
{ 0x0342, 0x0e },
290-
{ 0x0343, 0x58 },
291288
{ 0x0900, 0x00 },
292289
{ 0x0901, 0x11 },
293290
{ 0x0902, 0x00 },
@@ -296,8 +293,6 @@ static const struct imx355_reg mode_3280x2464_regs[] = {
296293
};
297294

298295
static const struct imx355_reg mode_1940x1096_regs[] = {
299-
{ 0x0342, 0x0e },
300-
{ 0x0343, 0x58 },
301296
{ 0x0900, 0x00 },
302297
{ 0x0901, 0x11 },
303298
{ 0x0902, 0x00 },
@@ -306,8 +301,6 @@ static const struct imx355_reg mode_1940x1096_regs[] = {
306301
};
307302

308303
static const struct imx355_reg mode_1936x1096_regs[] = {
309-
{ 0x0342, 0x0e },
310-
{ 0x0343, 0x58 },
311304
{ 0x0900, 0x00 },
312305
{ 0x0901, 0x11 },
313306
{ 0x0902, 0x00 },
@@ -316,8 +309,6 @@ static const struct imx355_reg mode_1936x1096_regs[] = {
316309
};
317310

318311
static const struct imx355_reg mode_1924x1080_regs[] = {
319-
{ 0x0342, 0x0e },
320-
{ 0x0343, 0x58 },
321312
{ 0x0900, 0x00 },
322313
{ 0x0901, 0x11 },
323314
{ 0x0902, 0x00 },
@@ -326,8 +317,6 @@ static const struct imx355_reg mode_1924x1080_regs[] = {
326317
};
327318

328319
static const struct imx355_reg mode_1920x1080_regs[] = {
329-
{ 0x0342, 0x0e },
330-
{ 0x0343, 0x58 },
331320
{ 0x0900, 0x00 },
332321
{ 0x0901, 0x11 },
333322
{ 0x0902, 0x00 },
@@ -336,8 +325,6 @@ static const struct imx355_reg mode_1920x1080_regs[] = {
336325
};
337326

338327
static const struct imx355_reg mode_1640x1232_regs[] = {
339-
{ 0x0342, 0x07 },
340-
{ 0x0343, 0x2c },
341328
{ 0x0900, 0x01 },
342329
{ 0x0901, 0x22 },
343330
{ 0x0902, 0x00 },
@@ -346,8 +333,6 @@ static const struct imx355_reg mode_1640x1232_regs[] = {
346333
};
347334

348335
static const struct imx355_reg mode_1640x922_regs[] = {
349-
{ 0x0342, 0x07 },
350-
{ 0x0343, 0x2c },
351336
{ 0x0900, 0x01 },
352337
{ 0x0901, 0x22 },
353338
{ 0x0902, 0x00 },
@@ -356,8 +341,6 @@ static const struct imx355_reg mode_1640x922_regs[] = {
356341
};
357342

358343
static const struct imx355_reg mode_1300x736_regs[] = {
359-
{ 0x0342, 0x07 },
360-
{ 0x0343, 0x2c },
361344
{ 0x0900, 0x01 },
362345
{ 0x0901, 0x22 },
363346
{ 0x0902, 0x00 },
@@ -366,8 +349,6 @@ static const struct imx355_reg mode_1300x736_regs[] = {
366349
};
367350

368351
static const struct imx355_reg mode_1296x736_regs[] = {
369-
{ 0x0342, 0x07 },
370-
{ 0x0343, 0x2c },
371352
{ 0x0900, 0x01 },
372353
{ 0x0901, 0x22 },
373354
{ 0x0902, 0x00 },
@@ -376,8 +357,6 @@ static const struct imx355_reg mode_1296x736_regs[] = {
376357
};
377358

378359
static const struct imx355_reg mode_1284x720_regs[] = {
379-
{ 0x0342, 0x07 },
380-
{ 0x0343, 0x2c },
381360
{ 0x0900, 0x01 },
382361
{ 0x0901, 0x22 },
383362
{ 0x0902, 0x00 },
@@ -386,8 +365,6 @@ static const struct imx355_reg mode_1284x720_regs[] = {
386365
};
387366

388367
static const struct imx355_reg mode_1280x720_regs[] = {
389-
{ 0x0342, 0x07 },
390-
{ 0x0343, 0x2c },
391368
{ 0x0900, 0x01 },
392369
{ 0x0901, 0x22 },
393370
{ 0x0902, 0x00 },
@@ -396,8 +373,6 @@ static const struct imx355_reg mode_1280x720_regs[] = {
396373
};
397374

398375
static const struct imx355_reg mode_820x616_regs[] = {
399-
{ 0x0342, 0x0e },
400-
{ 0x0343, 0x58 },
401376
{ 0x0900, 0x01 },
402377
{ 0x0901, 0x44 },
403378
{ 0x0902, 0x00 },
@@ -1041,6 +1016,13 @@ static int imx355_start_streaming(struct imx355 *imx355)
10411016
if (ret)
10421017
return ret;
10431018

1019+
/* set line length */
1020+
ret = imx355_write_reg(imx355, IMX355_REG_LLP,
1021+
imx355->hblank->val + imx355->cur_mode->width,
1022+
2);
1023+
if (ret)
1024+
return ret;
1025+
10441026
/* Apply customized values from user */
10451027
ret = __v4l2_ctrl_handler_setup(imx355->sd.ctrl_handler);
10461028
if (ret)

0 commit comments

Comments
 (0)