Skip to content

Commit ae1547c

Browse files
drivers: media: imx708: Adjust broken line correction parameter
In full-resolution mode, the LPF_INTENSITY_EN and LPF_INTENSITY registers control Quad Bayer Re-mosaic broken line correction. Expose this as a module parameter "qbc_adjust": the value zero sets LPF_INTENSTY_EN=1, disabling the correction. Other values are written to LPF_INTENSITY; the legal range is 2 to 5. There is a trade-off between coloured and monochrome patterns. The previous fixed value 4 could produce ladder/spots artefacts in coloured textures. The new default value 2 may suit a wider range of scenes. Signed-off-by: Nick Hollinghurst <[email protected]>
1 parent 686fe77 commit ae1547c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/media/i2c/imx708.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
#include <media/v4l2-fwnode.h>
2121
#include <media/v4l2-mediabus.h>
2222

23+
/*
24+
* Parameter to adjust Quad Bayer re-mosaic broken line correction strength
25+
* (LPF_INTENSITY), used in full-resolution mode only. Set zero to disable.
26+
*/
27+
static int qbc_adjust = 2;
28+
module_param(qbc_adjust, int, 0644);
29+
MODULE_PARM_DESC(qbc_adjust, "Quad Bayer broken line correction strength [0,2-5]");
30+
2331
#define IMX708_REG_VALUE_08BIT 1
2432
#define IMX708_REG_VALUE_16BIT 2
2533

@@ -363,8 +371,6 @@ static const struct imx708_reg mode_4608x2592_regs[] = {
363371
{0x341f, 0x20},
364372
{0x3420, 0x00},
365373
{0x3421, 0xd8},
366-
{0xC428, 0x00},
367-
{0xC429, 0x04},
368374
{0x3366, 0x00},
369375
{0x3367, 0x00},
370376
{0x3368, 0x00},
@@ -1515,6 +1521,10 @@ static int imx708_start_streaming(struct imx708 *imx708)
15151521
return ret;
15161522
}
15171523

1524+
/* Quad Bayer re-mosaic adjustments (for full-resolution mode only) */
1525+
imx708_write_reg(imx708, 0xC428, IMX708_REG_VALUE_08BIT, !qbc_adjust);
1526+
imx708_write_reg(imx708, 0xC429, IMX708_REG_VALUE_08BIT, qbc_adjust);
1527+
15181528
/* Apply customized values from user */
15191529
ret = __v4l2_ctrl_handler_setup(imx708->sd.ctrl_handler);
15201530
if (ret)

0 commit comments

Comments
 (0)