[PATCH] media: i2c: imx334: add support for additional test patterns

shravan kumar posted 1 patch 3 months, 2 weeks ago
drivers/media/i2c/imx334.c | 9 +++++++++
1 file changed, 9 insertions(+)
[PATCH] media: i2c: imx334: add support for additional test patterns
Posted by shravan kumar 3 months, 2 weeks ago
From: Shravan Chippa <shravan.chippa@microchip.com>

Added support for three additional test patterns in the
IMX334 driver: Black and Grey Bars, Black Color, and White Color.

Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
---
 drivers/media/i2c/imx334.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
index 846b9928d4e8..43dd7edb48c8 100644
--- a/drivers/media/i2c/imx334.c
+++ b/drivers/media/i2c/imx334.c
@@ -118,6 +118,9 @@
 #define IMX334_REG_TP			CCI_REG8(0x329e)
 #define IMX334_TP_COLOR_HBARS		0xa
 #define IMX334_TP_COLOR_VBARS		0xb
+#define IMX334_TP_BLACK			0x0
+#define IMX334_TP_WHITE			0x1
+#define IMX334_TP_BLACK_GREY		0xC
 
 #define IMX334_TPG_EN_DOUT		CCI_REG8(0x329c)
 #define IMX334_TP_ENABLE		0x1
@@ -398,12 +401,18 @@ static const char * const imx334_test_pattern_menu[] = {
 	"Disabled",
 	"Vertical Color Bars",
 	"Horizontal Color Bars",
+	"Black and Grey Bars",
+	"Black Color",
+	"White Color",
 };
 
 static const int imx334_test_pattern_val[] = {
 	IMX334_TP_DISABLE,
 	IMX334_TP_COLOR_HBARS,
 	IMX334_TP_COLOR_VBARS,
+	IMX334_TP_BLACK_GREY,
+	IMX334_TP_BLACK,
+	IMX334_TP_WHITE,
 };
 
 static const struct cci_reg_sequence raw10_framefmt_regs[] = {
-- 
2.34.1
Re: [PATCH] media: i2c: imx334: add support for additional test patterns
Posted by Kieran Bingham 3 months, 2 weeks ago
Hi Shravan

Quoting shravan kumar (2025-06-24 07:54:38)
> From: Shravan Chippa <shravan.chippa@microchip.com>
> 
> Added support for three additional test patterns in the
> IMX334 driver: Black and Grey Bars, Black Color, and White Color.
> 
> Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
> ---
>  drivers/media/i2c/imx334.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
> index 846b9928d4e8..43dd7edb48c8 100644
> --- a/drivers/media/i2c/imx334.c
> +++ b/drivers/media/i2c/imx334.c
> @@ -118,6 +118,9 @@
>  #define IMX334_REG_TP                  CCI_REG8(0x329e)
>  #define IMX334_TP_COLOR_HBARS          0xa
>  #define IMX334_TP_COLOR_VBARS          0xb
> +#define IMX334_TP_BLACK                        0x0
> +#define IMX334_TP_WHITE                        0x1
> +#define IMX334_TP_BLACK_GREY           0xC

This should be lower case to match the other hex constants (0xc)

I also wonder if this list should be in register address order ... but
then it won't match the menu items ...

>  
>  #define IMX334_TPG_EN_DOUT             CCI_REG8(0x329c)
>  #define IMX334_TP_ENABLE               0x1
> @@ -398,12 +401,18 @@ static const char * const imx334_test_pattern_menu[] = {
>         "Disabled",
>         "Vertical Color Bars",
>         "Horizontal Color Bars",
> +       "Black and Grey Bars",
> +       "Black Color",
> +       "White Color",
>  };
>  
>  static const int imx334_test_pattern_val[] = {
>         IMX334_TP_DISABLE,
>         IMX334_TP_COLOR_HBARS,
>         IMX334_TP_COLOR_VBARS,
> +       IMX334_TP_BLACK_GREY,
> +       IMX334_TP_BLACK,
> +       IMX334_TP_WHITE,
>  };
>  
>  static const struct cci_reg_sequence raw10_framefmt_regs[] = {
> -- 
> 2.34.1
>