* [PATCH v2 0/4] media: i2c: imx290: Add support for imx462
@ 2024-11-20 19:17 Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module Dave Stevenson
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Dave Stevenson @ 2024-11-20 19:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Alexander Stein
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson, Conor Dooley
imx462 is the successor to imx290 (and imx327 before that), and only
requires a few very minor register tweaks.
Whilst at it I also fixed the todo over imx327 and imx290 having very
slightly different maximum analog gains (29.4dB vs 30.0dB) and added
that to the variant structure.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
Changes in v2:
- Added patch 2 to correct register 0x3011 to 0x00 on imx290.
- Corrected title for dtbindings patch to remove duplicated "media"
- Picked up tags.
- Link to v1: https://lore.kernel.org/r/20241114-media-imx290-imx462-v1-0-c538a2e24786@raspberrypi.com
---
Dave Stevenson (4):
media: i2c: imx290: Limit analogue gain according to module
media: i2c: imx290: Register 0x3011 varies between imx327 and imx290
media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding
media: i2c: imx290: Add configuration for IMX462
.../devicetree/bindings/media/i2c/sony,imx290.yaml | 2 +
drivers/media/i2c/imx290.c | 81 ++++++++++++++++++++--
2 files changed, 76 insertions(+), 7 deletions(-)
---
base-commit: ed61c59139509f76d3592683c90dc3fdc6e23cd6
change-id: 20241114-media-imx290-imx462-b6d1c24b77b5
Best regards,
--
Dave Stevenson <dave.stevenson@raspberrypi.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module
2024-11-20 19:17 [PATCH v2 0/4] media: i2c: imx290: Add support for imx462 Dave Stevenson
@ 2024-11-20 19:17 ` Dave Stevenson
2024-12-05 15:22 ` Alexander Stein
2024-11-20 19:17 ` [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290 Dave Stevenson
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Dave Stevenson @ 2024-11-20 19:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Alexander Stein
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson
The imx327 only supports up to 29.4dB of analogue gain, vs
the imx290 going up to 30dB. Both are in 0.3dB steps.
As we now have model specific config, fix this mismatch,
and delete the comment referencing it.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/i2c/imx290.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index ee698c99001d..da654deb444a 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -176,6 +176,7 @@ struct imx290_model_info {
enum imx290_colour_variant colour_variant;
const struct cci_reg_sequence *init_regs;
size_t init_regs_num;
+ unsigned int max_analog_gain;
const char *name;
};
@@ -876,14 +877,10 @@ static int imx290_ctrl_init(struct imx290 *imx290)
* up to 72.0dB (240) add further digital gain. Limit the range to
* analog gain only, support for digital gain can be added separately
* if needed.
- *
- * The IMX327 and IMX462 are largely compatible with the IMX290, but
- * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
- * gain. When support for those sensors gets added to the driver, the
- * gain control should be adjusted accordingly.
*/
v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
- V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
+ V4L2_CID_ANALOGUE_GAIN, 0,
+ imx290->model->max_analog_gain, 1, 0);
/*
* Correct range will be determined through imx290_ctrl_update setting
@@ -1441,18 +1438,21 @@ static const struct imx290_model_info imx290_models[] = {
.colour_variant = IMX290_VARIANT_COLOUR,
.init_regs = imx290_global_init_settings_290,
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
+ .max_analog_gain = 100,
.name = "imx290",
},
[IMX290_MODEL_IMX290LLR] = {
.colour_variant = IMX290_VARIANT_MONO,
.init_regs = imx290_global_init_settings_290,
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
+ .max_analog_gain = 100,
.name = "imx290",
},
[IMX290_MODEL_IMX327LQR] = {
.colour_variant = IMX290_VARIANT_COLOUR,
.init_regs = imx290_global_init_settings_327,
.init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
+ .max_analog_gain = 98,
.name = "imx327",
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290
2024-11-20 19:17 [PATCH v2 0/4] media: i2c: imx290: Add support for imx462 Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module Dave Stevenson
@ 2024-11-20 19:17 ` Dave Stevenson
2024-11-21 3:44 ` Laurent Pinchart
2024-11-20 19:17 ` [PATCH v2 3/4] media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462 Dave Stevenson
3 siblings, 1 reply; 10+ messages in thread
From: Dave Stevenson @ 2024-11-20 19:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Alexander Stein
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson
Reviewing the datasheets, register 0x3011 is meant to be 0x02 on imx327
and 0x00 on imx290.
Move it out of the common registers, and set it appropriately in the
sensor specific sections. (Included for imx290 to be explicit, rather
than relying on the default value).
Fixes: 2d41947ec2c0 ("media: i2c: imx290: Add support for imx327 variant")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/imx290.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index da654deb444a..7d794a509670 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -268,7 +268,6 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
{ IMX290_WINWV, 1097 },
{ IMX290_XSOUTSEL, IMX290_XSOUTSEL_XVSOUTSEL_VSYNC |
IMX290_XSOUTSEL_XHSOUTSEL_HSYNC },
- { CCI_REG8(0x3011), 0x02 },
{ CCI_REG8(0x3012), 0x64 },
{ CCI_REG8(0x3013), 0x00 },
};
@@ -276,6 +275,7 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
static const struct cci_reg_sequence imx290_global_init_settings_290[] = {
{ CCI_REG8(0x300f), 0x00 },
{ CCI_REG8(0x3010), 0x21 },
+ { CCI_REG8(0x3011), 0x00 },
{ CCI_REG8(0x3016), 0x09 },
{ CCI_REG8(0x3070), 0x02 },
{ CCI_REG8(0x3071), 0x11 },
@@ -329,6 +329,7 @@ static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = {
};
static const struct cci_reg_sequence imx290_global_init_settings_327[] = {
+ { CCI_REG8(0x3011), 0x02 },
{ CCI_REG8(0x309e), 0x4A },
{ CCI_REG8(0x309f), 0x4A },
{ CCI_REG8(0x313b), 0x61 },
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/4] media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding
2024-11-20 19:17 [PATCH v2 0/4] media: i2c: imx290: Add support for imx462 Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290 Dave Stevenson
@ 2024-11-20 19:17 ` Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462 Dave Stevenson
3 siblings, 0 replies; 10+ messages in thread
From: Dave Stevenson @ 2024-11-20 19:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Alexander Stein
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson, Conor Dooley
IMX462 is the successor to IMX290, which is supportable by
the existing IMX290 driver via a new compatible string.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml
index bf05ca48601a..fa69bd21c8da 100644
--- a/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/sony,imx290.yaml
@@ -33,6 +33,8 @@ properties:
- sony,imx290lqr # Colour
- sony,imx290llr # Monochrome
- sony,imx327lqr # Colour
+ - sony,imx462lqr # Colour
+ - sony,imx462llr # Monochrome
- const: sony,imx290
deprecated: true
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462
2024-11-20 19:17 [PATCH v2 0/4] media: i2c: imx290: Add support for imx462 Dave Stevenson
` (2 preceding siblings ...)
2024-11-20 19:17 ` [PATCH v2 3/4] media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding Dave Stevenson
@ 2024-11-20 19:17 ` Dave Stevenson
2024-11-21 3:45 ` Laurent Pinchart
3 siblings, 1 reply; 10+ messages in thread
From: Dave Stevenson @ 2024-11-20 19:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Alexander Stein
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson
IMX462 is the successor to IMX290, and wants very minor
changes to the register setup.
Add the relevant configuration to support it.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/imx290.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index 7d794a509670..3bad7779d0d0 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -170,6 +170,8 @@ enum imx290_model {
IMX290_MODEL_IMX290LQR,
IMX290_MODEL_IMX290LLR,
IMX290_MODEL_IMX327LQR,
+ IMX290_MODEL_IMX462LQR,
+ IMX290_MODEL_IMX462LLR,
};
struct imx290_model_info {
@@ -316,6 +318,50 @@ static const struct cci_reg_sequence imx290_global_init_settings_290[] = {
{ CCI_REG8(0x33b3), 0x04 },
};
+static const struct cci_reg_sequence imx290_global_init_settings_462[] = {
+ { CCI_REG8(0x300f), 0x00 },
+ { CCI_REG8(0x3010), 0x21 },
+ { CCI_REG8(0x3011), 0x02 },
+ { CCI_REG8(0x3016), 0x09 },
+ { CCI_REG8(0x3070), 0x02 },
+ { CCI_REG8(0x3071), 0x11 },
+ { CCI_REG8(0x309b), 0x10 },
+ { CCI_REG8(0x309c), 0x22 },
+ { CCI_REG8(0x30a2), 0x02 },
+ { CCI_REG8(0x30a6), 0x20 },
+ { CCI_REG8(0x30a8), 0x20 },
+ { CCI_REG8(0x30aa), 0x20 },
+ { CCI_REG8(0x30ac), 0x20 },
+ { CCI_REG8(0x30b0), 0x43 },
+ { CCI_REG8(0x3119), 0x9e },
+ { CCI_REG8(0x311c), 0x1e },
+ { CCI_REG8(0x311e), 0x08 },
+ { CCI_REG8(0x3128), 0x05 },
+ { CCI_REG8(0x313d), 0x83 },
+ { CCI_REG8(0x3150), 0x03 },
+ { CCI_REG8(0x317e), 0x00 },
+ { CCI_REG8(0x32b8), 0x50 },
+ { CCI_REG8(0x32b9), 0x10 },
+ { CCI_REG8(0x32ba), 0x00 },
+ { CCI_REG8(0x32bb), 0x04 },
+ { CCI_REG8(0x32c8), 0x50 },
+ { CCI_REG8(0x32c9), 0x10 },
+ { CCI_REG8(0x32ca), 0x00 },
+ { CCI_REG8(0x32cb), 0x04 },
+ { CCI_REG8(0x332c), 0xd3 },
+ { CCI_REG8(0x332d), 0x10 },
+ { CCI_REG8(0x332e), 0x0d },
+ { CCI_REG8(0x3358), 0x06 },
+ { CCI_REG8(0x3359), 0xe1 },
+ { CCI_REG8(0x335a), 0x11 },
+ { CCI_REG8(0x3360), 0x1e },
+ { CCI_REG8(0x3361), 0x61 },
+ { CCI_REG8(0x3362), 0x10 },
+ { CCI_REG8(0x33b0), 0x50 },
+ { CCI_REG8(0x33b2), 0x1a },
+ { CCI_REG8(0x33b3), 0x04 },
+};
+
#define IMX290_NUM_CLK_REGS 2
static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = {
[IMX290_CLK_37_125] = {
@@ -1456,6 +1502,20 @@ static const struct imx290_model_info imx290_models[] = {
.max_analog_gain = 98,
.name = "imx327",
},
+ [IMX290_MODEL_IMX462LQR] = {
+ .colour_variant = IMX290_VARIANT_COLOUR,
+ .init_regs = imx290_global_init_settings_462,
+ .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462),
+ .max_analog_gain = 98,
+ .name = "imx462",
+ },
+ [IMX290_MODEL_IMX462LLR] = {
+ .colour_variant = IMX290_VARIANT_MONO,
+ .init_regs = imx290_global_init_settings_462,
+ .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462),
+ .max_analog_gain = 98,
+ .name = "imx462",
+ },
};
static int imx290_parse_dt(struct imx290 *imx290)
@@ -1654,6 +1714,12 @@ static const struct of_device_id imx290_of_match[] = {
}, {
.compatible = "sony,imx327lqr",
.data = &imx290_models[IMX290_MODEL_IMX327LQR],
+ }, {
+ .compatible = "sony,imx462lqr",
+ .data = &imx290_models[IMX290_MODEL_IMX462LQR],
+ }, {
+ .compatible = "sony,imx462llr",
+ .data = &imx290_models[IMX290_MODEL_IMX462LLR],
},
{ /* sentinel */ },
};
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290
2024-11-20 19:17 ` [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290 Dave Stevenson
@ 2024-11-21 3:44 ` Laurent Pinchart
0 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2024-11-21 3:44 UTC (permalink / raw)
To: Dave Stevenson
Cc: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Alexander Stein, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel
Hi Dave,
Thank you for the patch.
On Wed, Nov 20, 2024 at 07:17:04PM +0000, Dave Stevenson wrote:
> Reviewing the datasheets, register 0x3011 is meant to be 0x02 on imx327
> and 0x00 on imx290.
>
> Move it out of the common registers, and set it appropriately in the
> sensor specific sections. (Included for imx290 to be explicit, rather
> than relying on the default value).
>
> Fixes: 2d41947ec2c0 ("media: i2c: imx290: Add support for imx327 variant")
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/i2c/imx290.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index da654deb444a..7d794a509670 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -268,7 +268,6 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
> { IMX290_WINWV, 1097 },
> { IMX290_XSOUTSEL, IMX290_XSOUTSEL_XVSOUTSEL_VSYNC |
> IMX290_XSOUTSEL_XHSOUTSEL_HSYNC },
> - { CCI_REG8(0x3011), 0x02 },
> { CCI_REG8(0x3012), 0x64 },
> { CCI_REG8(0x3013), 0x00 },
> };
> @@ -276,6 +275,7 @@ static const struct cci_reg_sequence imx290_global_init_settings[] = {
> static const struct cci_reg_sequence imx290_global_init_settings_290[] = {
> { CCI_REG8(0x300f), 0x00 },
> { CCI_REG8(0x3010), 0x21 },
> + { CCI_REG8(0x3011), 0x00 },
> { CCI_REG8(0x3016), 0x09 },
> { CCI_REG8(0x3070), 0x02 },
> { CCI_REG8(0x3071), 0x11 },
> @@ -329,6 +329,7 @@ static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = {
> };
>
> static const struct cci_reg_sequence imx290_global_init_settings_327[] = {
> + { CCI_REG8(0x3011), 0x02 },
> { CCI_REG8(0x309e), 0x4A },
> { CCI_REG8(0x309f), 0x4A },
> { CCI_REG8(0x313b), 0x61 },
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462
2024-11-20 19:17 ` [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462 Dave Stevenson
@ 2024-11-21 3:45 ` Laurent Pinchart
0 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2024-11-21 3:45 UTC (permalink / raw)
To: Dave Stevenson
Cc: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Alexander Stein, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel
Hi Dave,
Thank you for the patch.
On Wed, Nov 20, 2024 at 07:17:06PM +0000, Dave Stevenson wrote:
> IMX462 is the successor to IMX290, and wants very minor
> changes to the register setup.
>
> Add the relevant configuration to support it.
>
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/i2c/imx290.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 66 insertions(+)
>
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index 7d794a509670..3bad7779d0d0 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -170,6 +170,8 @@ enum imx290_model {
> IMX290_MODEL_IMX290LQR,
> IMX290_MODEL_IMX290LLR,
> IMX290_MODEL_IMX327LQR,
> + IMX290_MODEL_IMX462LQR,
> + IMX290_MODEL_IMX462LLR,
> };
>
> struct imx290_model_info {
> @@ -316,6 +318,50 @@ static const struct cci_reg_sequence imx290_global_init_settings_290[] = {
> { CCI_REG8(0x33b3), 0x04 },
> };
>
> +static const struct cci_reg_sequence imx290_global_init_settings_462[] = {
> + { CCI_REG8(0x300f), 0x00 },
> + { CCI_REG8(0x3010), 0x21 },
> + { CCI_REG8(0x3011), 0x02 },
> + { CCI_REG8(0x3016), 0x09 },
> + { CCI_REG8(0x3070), 0x02 },
> + { CCI_REG8(0x3071), 0x11 },
> + { CCI_REG8(0x309b), 0x10 },
> + { CCI_REG8(0x309c), 0x22 },
> + { CCI_REG8(0x30a2), 0x02 },
> + { CCI_REG8(0x30a6), 0x20 },
> + { CCI_REG8(0x30a8), 0x20 },
> + { CCI_REG8(0x30aa), 0x20 },
> + { CCI_REG8(0x30ac), 0x20 },
> + { CCI_REG8(0x30b0), 0x43 },
> + { CCI_REG8(0x3119), 0x9e },
> + { CCI_REG8(0x311c), 0x1e },
> + { CCI_REG8(0x311e), 0x08 },
> + { CCI_REG8(0x3128), 0x05 },
> + { CCI_REG8(0x313d), 0x83 },
> + { CCI_REG8(0x3150), 0x03 },
> + { CCI_REG8(0x317e), 0x00 },
> + { CCI_REG8(0x32b8), 0x50 },
> + { CCI_REG8(0x32b9), 0x10 },
> + { CCI_REG8(0x32ba), 0x00 },
> + { CCI_REG8(0x32bb), 0x04 },
> + { CCI_REG8(0x32c8), 0x50 },
> + { CCI_REG8(0x32c9), 0x10 },
> + { CCI_REG8(0x32ca), 0x00 },
> + { CCI_REG8(0x32cb), 0x04 },
> + { CCI_REG8(0x332c), 0xd3 },
> + { CCI_REG8(0x332d), 0x10 },
> + { CCI_REG8(0x332e), 0x0d },
> + { CCI_REG8(0x3358), 0x06 },
> + { CCI_REG8(0x3359), 0xe1 },
> + { CCI_REG8(0x335a), 0x11 },
> + { CCI_REG8(0x3360), 0x1e },
> + { CCI_REG8(0x3361), 0x61 },
> + { CCI_REG8(0x3362), 0x10 },
> + { CCI_REG8(0x33b0), 0x50 },
> + { CCI_REG8(0x33b2), 0x1a },
> + { CCI_REG8(0x33b3), 0x04 },
> +};
> +
> #define IMX290_NUM_CLK_REGS 2
> static const struct cci_reg_sequence xclk_regs[][IMX290_NUM_CLK_REGS] = {
> [IMX290_CLK_37_125] = {
> @@ -1456,6 +1502,20 @@ static const struct imx290_model_info imx290_models[] = {
> .max_analog_gain = 98,
> .name = "imx327",
> },
> + [IMX290_MODEL_IMX462LQR] = {
> + .colour_variant = IMX290_VARIANT_COLOUR,
> + .init_regs = imx290_global_init_settings_462,
> + .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462),
> + .max_analog_gain = 98,
> + .name = "imx462",
> + },
> + [IMX290_MODEL_IMX462LLR] = {
> + .colour_variant = IMX290_VARIANT_MONO,
> + .init_regs = imx290_global_init_settings_462,
> + .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_462),
> + .max_analog_gain = 98,
> + .name = "imx462",
> + },
> };
>
> static int imx290_parse_dt(struct imx290 *imx290)
> @@ -1654,6 +1714,12 @@ static const struct of_device_id imx290_of_match[] = {
> }, {
> .compatible = "sony,imx327lqr",
> .data = &imx290_models[IMX290_MODEL_IMX327LQR],
> + }, {
> + .compatible = "sony,imx462lqr",
> + .data = &imx290_models[IMX290_MODEL_IMX462LQR],
> + }, {
> + .compatible = "sony,imx462llr",
> + .data = &imx290_models[IMX290_MODEL_IMX462LLR],
> },
> { /* sentinel */ },
> };
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module
2024-11-20 19:17 ` [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module Dave Stevenson
@ 2024-12-05 15:22 ` Alexander Stein
2024-12-05 15:37 ` Dave Stevenson
0 siblings, 1 reply; 10+ messages in thread
From: Alexander Stein @ 2024-12-05 15:22 UTC (permalink / raw)
To: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, Dave Stevenson
Cc: linux-media, linux-kernel, devicetree, imx, linux-arm-kernel,
Dave Stevenson
Hi Dave,
Am Mittwoch, 20. November 2024, 20:17:03 CET schrieb Dave Stevenson:
> The imx327 only supports up to 29.4dB of analogue gain, vs
> the imx290 going up to 30dB. Both are in 0.3dB steps.
While I agree for 30dB on imx290, my (maybe outdated) Rev0.2 datasheet says
up to 27dB in 0.3dB steps.
Despite that this change looks good.
Best regards,
Alexander
> As we now have model specific config, fix this mismatch,
> and delete the comment referencing it.
>
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/i2c/imx290.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> index ee698c99001d..da654deb444a 100644
> --- a/drivers/media/i2c/imx290.c
> +++ b/drivers/media/i2c/imx290.c
> @@ -176,6 +176,7 @@ struct imx290_model_info {
> enum imx290_colour_variant colour_variant;
> const struct cci_reg_sequence *init_regs;
> size_t init_regs_num;
> + unsigned int max_analog_gain;
> const char *name;
> };
>
> @@ -876,14 +877,10 @@ static int imx290_ctrl_init(struct imx290 *imx290)
> * up to 72.0dB (240) add further digital gain. Limit the range to
> * analog gain only, support for digital gain can be added separately
> * if needed.
> - *
> - * The IMX327 and IMX462 are largely compatible with the IMX290, but
> - * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
> - * gain. When support for those sensors gets added to the driver, the
> - * gain control should be adjusted accordingly.
> */
> v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
> - V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
> + V4L2_CID_ANALOGUE_GAIN, 0,
> + imx290->model->max_analog_gain, 1, 0);
>
> /*
> * Correct range will be determined through imx290_ctrl_update setting
> @@ -1441,18 +1438,21 @@ static const struct imx290_model_info imx290_models[] = {
> .colour_variant = IMX290_VARIANT_COLOUR,
> .init_regs = imx290_global_init_settings_290,
> .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> + .max_analog_gain = 100,
> .name = "imx290",
> },
> [IMX290_MODEL_IMX290LLR] = {
> .colour_variant = IMX290_VARIANT_MONO,
> .init_regs = imx290_global_init_settings_290,
> .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> + .max_analog_gain = 100,
> .name = "imx290",
> },
> [IMX290_MODEL_IMX327LQR] = {
> .colour_variant = IMX290_VARIANT_COLOUR,
> .init_regs = imx290_global_init_settings_327,
> .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
> + .max_analog_gain = 98,
> .name = "imx327",
> },
> };
>
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module
2024-12-05 15:22 ` Alexander Stein
@ 2024-12-05 15:37 ` Dave Stevenson
2024-12-05 15:39 ` Alexander Stein
0 siblings, 1 reply; 10+ messages in thread
From: Dave Stevenson @ 2024-12-05 15:37 UTC (permalink / raw)
To: Alexander Stein
Cc: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel
Hi Alexander
On Thu, 5 Dec 2024 at 15:22, Alexander Stein
<alexander.stein@ew.tq-group.com> wrote:
>
> Hi Dave,
>
> Am Mittwoch, 20. November 2024, 20:17:03 CET schrieb Dave Stevenson:
> > The imx327 only supports up to 29.4dB of analogue gain, vs
> > the imx290 going up to 30dB. Both are in 0.3dB steps.
>
> While I agree for 30dB on imx290, my (maybe outdated) Rev0.2 datasheet says
> up to 27dB in 0.3dB steps.
For IMX327, I have revision E17Z06B93 2019/03/25.
The revision control section for Rev0.3 lists
Page 1: "Correction: Max analog gain 27dB - 29.4dB"
Page 74: "Correction: Max Gain 69dB -> 71.4dB"
The graph in "Gain Adjustment Function" (page 74) also shows values
above 27dB as being purely analogue gain. Certainly 0x62 is red for
analogue, which would be a gain of 29.4dB. The next dot is 0x64 (30dB)
and blue, so we have to trust the text for 0x63 being 29.4dB analogue
and 0.3dB digital gain.
So I'm happy that the limit is 29.4dB.
Dave
> Despite that this change looks good.
>
> Best regards,
> Alexander
>
> > As we now have model specific config, fix this mismatch,
> > and delete the comment referencing it.
> >
> > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > drivers/media/i2c/imx290.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> > index ee698c99001d..da654deb444a 100644
> > --- a/drivers/media/i2c/imx290.c
> > +++ b/drivers/media/i2c/imx290.c
> > @@ -176,6 +176,7 @@ struct imx290_model_info {
> > enum imx290_colour_variant colour_variant;
> > const struct cci_reg_sequence *init_regs;
> > size_t init_regs_num;
> > + unsigned int max_analog_gain;
> > const char *name;
> > };
> >
> > @@ -876,14 +877,10 @@ static int imx290_ctrl_init(struct imx290 *imx290)
> > * up to 72.0dB (240) add further digital gain. Limit the range to
> > * analog gain only, support for digital gain can be added separately
> > * if needed.
> > - *
> > - * The IMX327 and IMX462 are largely compatible with the IMX290, but
> > - * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
> > - * gain. When support for those sensors gets added to the driver, the
> > - * gain control should be adjusted accordingly.
> > */
> > v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
> > - V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
> > + V4L2_CID_ANALOGUE_GAIN, 0,
> > + imx290->model->max_analog_gain, 1, 0);
> >
> > /*
> > * Correct range will be determined through imx290_ctrl_update setting
> > @@ -1441,18 +1438,21 @@ static const struct imx290_model_info imx290_models[] = {
> > .colour_variant = IMX290_VARIANT_COLOUR,
> > .init_regs = imx290_global_init_settings_290,
> > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> > + .max_analog_gain = 100,
> > .name = "imx290",
> > },
> > [IMX290_MODEL_IMX290LLR] = {
> > .colour_variant = IMX290_VARIANT_MONO,
> > .init_regs = imx290_global_init_settings_290,
> > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> > + .max_analog_gain = 100,
> > .name = "imx290",
> > },
> > [IMX290_MODEL_IMX327LQR] = {
> > .colour_variant = IMX290_VARIANT_COLOUR,
> > .init_regs = imx290_global_init_settings_327,
> > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
> > + .max_analog_gain = 98,
> > .name = "imx327",
> > },
> > };
> >
> >
>
>
> --
> TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> Amtsgericht München, HRB 105018
> Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> http://www.tq-group.com/
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module
2024-12-05 15:37 ` Dave Stevenson
@ 2024-12-05 15:39 ` Alexander Stein
0 siblings, 0 replies; 10+ messages in thread
From: Alexander Stein @ 2024-12-05 15:39 UTC (permalink / raw)
To: Dave Stevenson
Cc: Manivannan Sadhasivam, Sakari Ailus, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Laurent Pinchart, linux-media, linux-kernel, devicetree, imx,
linux-arm-kernel
Hi Dave,
Am Donnerstag, 5. Dezember 2024, 16:37:01 CET schrieb Dave Stevenson:
> Hi Alexander
>
> On Thu, 5 Dec 2024 at 15:22, Alexander Stein
> <alexander.stein@ew.tq-group.com> wrote:
> >
> > Hi Dave,
> >
> > Am Mittwoch, 20. November 2024, 20:17:03 CET schrieb Dave Stevenson:
> > > The imx327 only supports up to 29.4dB of analogue gain, vs
> > > the imx290 going up to 30dB. Both are in 0.3dB steps.
> >
> > While I agree for 30dB on imx290, my (maybe outdated) Rev0.2 datasheet says
> > up to 27dB in 0.3dB steps.
>
> For IMX327, I have revision E17Z06B93 2019/03/25.
>
> The revision control section for Rev0.3 lists
> Page 1: "Correction: Max analog gain 27dB - 29.4dB"
> Page 74: "Correction: Max Gain 69dB -> 71.4dB"
>
> The graph in "Gain Adjustment Function" (page 74) also shows values
> above 27dB as being purely analogue gain. Certainly 0x62 is red for
> analogue, which would be a gain of 29.4dB. The next dot is 0x64 (30dB)
> and blue, so we have to trust the text for 0x63 being 29.4dB analogue
> and 0.3dB digital gain.
>
> So I'm happy that the limit is 29.4dB.
Okay, this is a newer datasheet. So assume this is correct.
Thanks for clarification.
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Best regards,
Alexander
> Dave
>
> > Despite that this change looks good.
> >
> > Best regards,
> > Alexander
> >
> > > As we now have model specific config, fix this mismatch,
> > > and delete the comment referencing it.
> > >
> > > Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > > drivers/media/i2c/imx290.c | 12 ++++++------
> > > 1 file changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> > > index ee698c99001d..da654deb444a 100644
> > > --- a/drivers/media/i2c/imx290.c
> > > +++ b/drivers/media/i2c/imx290.c
> > > @@ -176,6 +176,7 @@ struct imx290_model_info {
> > > enum imx290_colour_variant colour_variant;
> > > const struct cci_reg_sequence *init_regs;
> > > size_t init_regs_num;
> > > + unsigned int max_analog_gain;
> > > const char *name;
> > > };
> > >
> > > @@ -876,14 +877,10 @@ static int imx290_ctrl_init(struct imx290 *imx290)
> > > * up to 72.0dB (240) add further digital gain. Limit the range to
> > > * analog gain only, support for digital gain can be added separately
> > > * if needed.
> > > - *
> > > - * The IMX327 and IMX462 are largely compatible with the IMX290, but
> > > - * have an analog gain range of 0.0dB to 29.4dB and 42dB of digital
> > > - * gain. When support for those sensors gets added to the driver, the
> > > - * gain control should be adjusted accordingly.
> > > */
> > > v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops,
> > > - V4L2_CID_ANALOGUE_GAIN, 0, 100, 1, 0);
> > > + V4L2_CID_ANALOGUE_GAIN, 0,
> > > + imx290->model->max_analog_gain, 1, 0);
> > >
> > > /*
> > > * Correct range will be determined through imx290_ctrl_update setting
> > > @@ -1441,18 +1438,21 @@ static const struct imx290_model_info imx290_models[] = {
> > > .colour_variant = IMX290_VARIANT_COLOUR,
> > > .init_regs = imx290_global_init_settings_290,
> > > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> > > + .max_analog_gain = 100,
> > > .name = "imx290",
> > > },
> > > [IMX290_MODEL_IMX290LLR] = {
> > > .colour_variant = IMX290_VARIANT_MONO,
> > > .init_regs = imx290_global_init_settings_290,
> > > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_290),
> > > + .max_analog_gain = 100,
> > > .name = "imx290",
> > > },
> > > [IMX290_MODEL_IMX327LQR] = {
> > > .colour_variant = IMX290_VARIANT_COLOUR,
> > > .init_regs = imx290_global_init_settings_327,
> > > .init_regs_num = ARRAY_SIZE(imx290_global_init_settings_327),
> > > + .max_analog_gain = 98,
> > > .name = "imx327",
> > > },
> > > };
> > >
> > >
> >
> >
> > --
> > TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> > Amtsgericht München, HRB 105018
> > Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> > http://www.tq-group.com/
> >
> >
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-12-05 15:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20 19:17 [PATCH v2 0/4] media: i2c: imx290: Add support for imx462 Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 1/4] media: i2c: imx290: Limit analogue gain according to module Dave Stevenson
2024-12-05 15:22 ` Alexander Stein
2024-12-05 15:37 ` Dave Stevenson
2024-12-05 15:39 ` Alexander Stein
2024-11-20 19:17 ` [PATCH v2 2/4] media: i2c: imx290: Register 0x3011 varies between imx327 and imx290 Dave Stevenson
2024-11-21 3:44 ` Laurent Pinchart
2024-11-20 19:17 ` [PATCH v2 3/4] media: dt-bindings: sony,imx290: Add IMX462 to the IMX290 binding Dave Stevenson
2024-11-20 19:17 ` [PATCH v2 4/4] media: i2c: imx290: Add configuration for IMX462 Dave Stevenson
2024-11-21 3:45 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).