Re: [PATCH v3 07/17] media: i2c: os05b10: Add test pattern options

From: Mehdi Djait

Date: Tue Jul 21 2026 - 14:30:25 EST


Hi Tarang,

On Sun, Jul 19, 2026 at 01:38:58AM +0530, Tarang Raval wrote:
> Add V4L2_CID_TEST_PATTERN support with multiple sensor test-pattern modes
> and program them via register 0x5080. Drop the fixed 0x5080 setting from
> the common register sequence so the pattern is selected only through the
> control.
>
> Removing the default write of 0x04 to register 0x5080 does not change the
> sensor's default behaviour. The value 0x04 leaves the test pattern enable
> bit (bit 7) cleared, so the sensor remains in normal streaming mode. It
> only programs the color bar style field, which is ignored unless a test
> pattern is enabled.
>

Reviewed-by: Mehdi Djait <mehdi.djait@xxxxxxxxxxxxxxx>

> Signed-off-by: Tarang Raval <tarang.raval@xxxxxxxxxxxxxxxxx>
> ---
> drivers/media/i2c/os05b10.c | 55 +++++++++++++++++++++++++++++++++++--
> 1 file changed, 53 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c
> index 61c51844a91e..4e177eacc815 100644
> --- a/drivers/media/i2c/os05b10.c
> +++ b/drivers/media/i2c/os05b10.c
> @@ -102,6 +102,17 @@
>
> #define OS05B10_REG_FORMAT2 CCI_REG8(0x3821)
>
> +#define OS05B10_REG_PRE_ISP_20_0 CCI_REG8(0x5080)
> +#define OS05B10_DISABLED 0x00
> +#define OS05B10_COLOR_BAR_1 0x80
> +#define OS05B10_COLOR_BAR_2 0x84
> +#define OS05B10_COLOR_BAR_3 0x88
> +#define OS05B10_COLOR_BAR_4 0x8c
> +#define OS05B10_COLOR_SQUARE 0x82
> +#define OS05B10_BW_SQUARE 0x92
> +#define OS05B10_TRANSPARENT_EFFECT 0xa0
> +#define OS05B10_ROLLING_BAR_EFFECT 0xc0
> +
> #define OS05B10_LINK_FREQ_600MHZ (600 * HZ_PER_MHZ)
>
> static const struct v4l2_rect os05b10_native_area = {
> @@ -395,7 +406,6 @@ static const struct cci_reg_sequence os05b10_common_regs[] = {
> { CCI_REG8(0x5004), 0x00 },
> { CCI_REG8(0x5005), 0x0e },
> { CCI_REG8(0x5036), 0x00 },
> - { CCI_REG8(0x5080), 0x04 },
> { CCI_REG8(0x5082), 0x00 },
> { CCI_REG8(0x5180), 0x00 },
> { CCI_REG8(0x5181), 0x10 },
> @@ -513,6 +523,30 @@ static const u32 os05b10_mbus_codes[] = {
> MEDIA_BUS_FMT_SBGGR10_1X10,
> };
>
> +static const char * const os05b10_test_pattern_menu[] = {
> + "Disabled",
> + "Colour bar type 1",

nit: make it color to be consistent with the rest of the driver ?

> + "Colour bar type 2",
> + "Colour bar type 3",
> + "Colour bar type 4",
> + "Colour square",
> + "Black-white square",
> + "Transparent effect",
> + "Rolling bar effect",
> +};

--
Kind Regards
Mehdi Djait