* [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting
@ 2024-02-15 14:43 Biju Das
2024-02-15 14:51 ` Wolfram Sang
2024-02-15 16:33 ` Kieran Bingham
0 siblings, 2 replies; 3+ messages in thread
From: Biju Das @ 2024-02-15 14:43 UTC (permalink / raw)
To: Sakari Ailus, Mauro Carvalho Chehab
Cc: Biju Das, linux-media, Geert Uytterhoeven, Kieran Bingham,
Wolfram Sang, Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc
The SYSTEM_CTRL0 register in ov5645 is almost similar to ov5640. But the
hard reset control is mandatory for the ov5645 device, so there is no
need for soft reset in the driver.
Add a 1msec delay for the software power up (OV5645_SYSTEM_CTRL0_START)
register in ov5645_global_init_setting. Without this delay sometimes the
image is not captured at all when the i2c frequency is 400kHz.
The changes are fixing both the greenish issue and image capture at 400kHz
i2c frequency on Renesas RZ/G2L SMARC EVK platforms.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* Dropped patch#2
* Updated commit header and description.
* Dropped unneeded software reset from ov5645_global_init_setting
* Added 1 msec delay for software power up from ov5645_*_init_setting.
---
drivers/media/i2c/ov5645.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a26ac11c989d..df86b951b9f3 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -118,7 +118,6 @@ static inline struct ov5645 *to_ov5645(struct v4l2_subdev *sd)
static const struct reg_value ov5645_global_init_setting[] = {
{ 0x3103, 0x11 },
- { 0x3008, 0x82 },
{ 0x3008, 0x42 },
{ 0x3103, 0x03 },
{ 0x3503, 0x07 },
@@ -627,6 +626,10 @@ static int ov5645_set_register_array(struct ov5645 *ov5645,
ret = ov5645_write_reg(ov5645, settings->reg, settings->val);
if (ret < 0)
return ret;
+
+ if (settings->reg == OV5645_SYSTEM_CTRL0 &&
+ settings->val == OV5645_SYSTEM_CTRL0_START)
+ usleep_range(1000, 2000);
}
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting
2024-02-15 14:43 [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting Biju Das
@ 2024-02-15 14:51 ` Wolfram Sang
2024-02-15 16:33 ` Kieran Bingham
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2024-02-15 14:51 UTC (permalink / raw)
To: Biju Das
Cc: Sakari Ailus, Mauro Carvalho Chehab, linux-media,
Geert Uytterhoeven, Kieran Bingham, Prabhakar Mahadev Lad,
Biju Das, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
On Thu, Feb 15, 2024 at 02:43:33PM +0000, Biju Das wrote:
> The SYSTEM_CTRL0 register in ov5645 is almost similar to ov5640. But the
> hard reset control is mandatory for the ov5645 device, so there is no
> need for soft reset in the driver.
>
> Add a 1msec delay for the software power up (OV5645_SYSTEM_CTRL0_START)
> register in ov5645_global_init_setting. Without this delay sometimes the
> image is not captured at all when the i2c frequency is 400kHz.
>
> The changes are fixing both the greenish issue and image capture at 400kHz
> i2c frequency on Renesas RZ/G2L SMARC EVK platforms.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Much better IMO.
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting
2024-02-15 14:43 [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting Biju Das
2024-02-15 14:51 ` Wolfram Sang
@ 2024-02-15 16:33 ` Kieran Bingham
1 sibling, 0 replies; 3+ messages in thread
From: Kieran Bingham @ 2024-02-15 16:33 UTC (permalink / raw)
To: Biju Das, Mauro Carvalho Chehab, Sakari Ailus
Cc: Biju Das, linux-media, Geert Uytterhoeven, Wolfram Sang,
Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc
Quoting Biju Das (2024-02-15 14:43:33)
> The SYSTEM_CTRL0 register in ov5645 is almost similar to ov5640. But the
> hard reset control is mandatory for the ov5645 device, so there is no
> need for soft reset in the driver.
>
> Add a 1msec delay for the software power up (OV5645_SYSTEM_CTRL0_START)
> register in ov5645_global_init_setting. Without this delay sometimes the
> image is not captured at all when the i2c frequency is 400kHz.
>
> The changes are fixing both the greenish issue and image capture at 400kHz
> i2c frequency on Renesas RZ/G2L SMARC EVK platforms.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * Dropped patch#2
> * Updated commit header and description.
> * Dropped unneeded software reset from ov5645_global_init_setting
> * Added 1 msec delay for software power up from ov5645_*_init_setting.
As with all drivers, I'd love to see more cleanup to move the reset/init
sequences away from opaque tables. But for now this seems like a
reasonable improvement.
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> ---
> drivers/media/i2c/ov5645.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
> index a26ac11c989d..df86b951b9f3 100644
> --- a/drivers/media/i2c/ov5645.c
> +++ b/drivers/media/i2c/ov5645.c
> @@ -118,7 +118,6 @@ static inline struct ov5645 *to_ov5645(struct v4l2_subdev *sd)
>
> static const struct reg_value ov5645_global_init_setting[] = {
> { 0x3103, 0x11 },
> - { 0x3008, 0x82 },
> { 0x3008, 0x42 },
> { 0x3103, 0x03 },
> { 0x3503, 0x07 },
> @@ -627,6 +626,10 @@ static int ov5645_set_register_array(struct ov5645 *ov5645,
> ret = ov5645_write_reg(ov5645, settings->reg, settings->val);
> if (ret < 0)
> return ret;
> +
> + if (settings->reg == OV5645_SYSTEM_CTRL0 &&
> + settings->val == OV5645_SYSTEM_CTRL0_START)
> + usleep_range(1000, 2000);
> }
>
> return 0;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-15 16:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 14:43 [PATCH v2] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting Biju Das
2024-02-15 14:51 ` Wolfram Sang
2024-02-15 16:33 ` Kieran Bingham
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.