diff mbox series

[RFC,1/3] media: i2c: ov5640: Adjust htot

Message ID 20201028225706.110078-2-jacopo+renesas@jmondi.org (mailing list archive)
State New, archived
Headers show
Series media: ov5640: Adjust htot, rework clock tree, add LINK_FREQ | expand

Commit Message

Jacopo Mondi Oct. 28, 2020, 10:57 p.m. UTC
From: Tomi Valkeinen <tomi.valkeinen@ti.com>

Adjust htot for most of the modes. The numbers are from the OV5640
datasheet, and with these the driver works more reliably on DRA76 EVM +
OV5640, using 2 datalanes.

Without the patch, I see often ComplexIO (i.e. PHY) errors when
starting the streaming, and 1280x720 does not work at all without this
change.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/i2c/ov5640.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Hugues FRUCHET Nov. 3, 2020, 4:57 p.m. UTC | #1
Hi Jacopo, Tomi,

This patch is breaking 1024x768@30fps & VGA@30fps on my side which are 
slowdown to 15fps.
Tomi, perhaps could you recheck with the fixed Jacopo serie if you still 
encounter your DPHY error issues ?

On 10/28/20 11:57 PM, Jacopo Mondi wrote:
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> Adjust htot for most of the modes. The numbers are from the OV5640
> datasheet, and with these the driver works more reliably on DRA76 EVM +
> OV5640, using 2 datalanes.
> 
> Without the patch, I see often ComplexIO (i.e. PHY) errors when
> starting the streaming, and 1280x720 does not work at all without this
> change.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>   drivers/media/i2c/ov5640.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index 8d0254d0e5ea..117ac22683ad 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -553,42 +553,42 @@ static const struct ov5640_mode_info ov5640_mode_init_data = {
>   static const struct ov5640_mode_info
>   ov5640_mode_data[OV5640_NUM_MODES] = {
>   	{OV5640_MODE_QCIF_176_144, SUBSAMPLING,
> -	 176, 1896, 144, 984,
> +	 176, 2844, 144, 984,
>   	 ov5640_setting_QCIF_176_144,
>   	 ARRAY_SIZE(ov5640_setting_QCIF_176_144),
>   	 OV5640_30_FPS},
>   	{OV5640_MODE_QVGA_320_240, SUBSAMPLING,
> -	 320, 1896, 240, 984,
> +	 320, 2844, 240, 984,
>   	 ov5640_setting_QVGA_320_240,
>   	 ARRAY_SIZE(ov5640_setting_QVGA_320_240),
>   	 OV5640_30_FPS},
>   	{OV5640_MODE_VGA_640_480, SUBSAMPLING,
> -	 640, 1896, 480, 1080,
> +	 640, 2844, 480, 1080,
>   	 ov5640_setting_VGA_640_480,
>   	 ARRAY_SIZE(ov5640_setting_VGA_640_480),
>   	 OV5640_60_FPS},
>   	{OV5640_MODE_NTSC_720_480, SUBSAMPLING,
> -	 720, 1896, 480, 984,
> +	 720, 2844, 480, 984,
>   	 ov5640_setting_NTSC_720_480,
>   	 ARRAY_SIZE(ov5640_setting_NTSC_720_480),
>   	OV5640_30_FPS},
>   	{OV5640_MODE_PAL_720_576, SUBSAMPLING,
> -	 720, 1896, 576, 984,
> +	 720, 2844, 576, 984,
>   	 ov5640_setting_PAL_720_576,
>   	 ARRAY_SIZE(ov5640_setting_PAL_720_576),
>   	 OV5640_30_FPS},
>   	{OV5640_MODE_XGA_1024_768, SUBSAMPLING,
> -	 1024, 1896, 768, 1080,
> +	 1024, 2844, 768, 1080,
>   	 ov5640_setting_XGA_1024_768,
>   	 ARRAY_SIZE(ov5640_setting_XGA_1024_768),
>   	 OV5640_30_FPS},
>   	{OV5640_MODE_720P_1280_720, SUBSAMPLING,
> -	 1280, 1892, 720, 740,
> +	 1280, 2844, 720, 740,
>   	 ov5640_setting_720P_1280_720,
>   	 ARRAY_SIZE(ov5640_setting_720P_1280_720),
>   	 OV5640_30_FPS},
>   	{OV5640_MODE_1080P_1920_1080, SCALING,
> -	 1920, 2500, 1080, 1120,
> +	 1920, 2844, 1080, 1120,
>   	 ov5640_setting_1080P_1920_1080,
>   	 ARRAY_SIZE(ov5640_setting_1080P_1920_1080),
>   	 OV5640_30_FPS},
> 

BR,
Hugues.
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 8d0254d0e5ea..117ac22683ad 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -553,42 +553,42 @@  static const struct ov5640_mode_info ov5640_mode_init_data = {
 static const struct ov5640_mode_info
 ov5640_mode_data[OV5640_NUM_MODES] = {
 	{OV5640_MODE_QCIF_176_144, SUBSAMPLING,
-	 176, 1896, 144, 984,
+	 176, 2844, 144, 984,
 	 ov5640_setting_QCIF_176_144,
 	 ARRAY_SIZE(ov5640_setting_QCIF_176_144),
 	 OV5640_30_FPS},
 	{OV5640_MODE_QVGA_320_240, SUBSAMPLING,
-	 320, 1896, 240, 984,
+	 320, 2844, 240, 984,
 	 ov5640_setting_QVGA_320_240,
 	 ARRAY_SIZE(ov5640_setting_QVGA_320_240),
 	 OV5640_30_FPS},
 	{OV5640_MODE_VGA_640_480, SUBSAMPLING,
-	 640, 1896, 480, 1080,
+	 640, 2844, 480, 1080,
 	 ov5640_setting_VGA_640_480,
 	 ARRAY_SIZE(ov5640_setting_VGA_640_480),
 	 OV5640_60_FPS},
 	{OV5640_MODE_NTSC_720_480, SUBSAMPLING,
-	 720, 1896, 480, 984,
+	 720, 2844, 480, 984,
 	 ov5640_setting_NTSC_720_480,
 	 ARRAY_SIZE(ov5640_setting_NTSC_720_480),
 	OV5640_30_FPS},
 	{OV5640_MODE_PAL_720_576, SUBSAMPLING,
-	 720, 1896, 576, 984,
+	 720, 2844, 576, 984,
 	 ov5640_setting_PAL_720_576,
 	 ARRAY_SIZE(ov5640_setting_PAL_720_576),
 	 OV5640_30_FPS},
 	{OV5640_MODE_XGA_1024_768, SUBSAMPLING,
-	 1024, 1896, 768, 1080,
+	 1024, 2844, 768, 1080,
 	 ov5640_setting_XGA_1024_768,
 	 ARRAY_SIZE(ov5640_setting_XGA_1024_768),
 	 OV5640_30_FPS},
 	{OV5640_MODE_720P_1280_720, SUBSAMPLING,
-	 1280, 1892, 720, 740,
+	 1280, 2844, 720, 740,
 	 ov5640_setting_720P_1280_720,
 	 ARRAY_SIZE(ov5640_setting_720P_1280_720),
 	 OV5640_30_FPS},
 	{OV5640_MODE_1080P_1920_1080, SCALING,
-	 1920, 2500, 1080, 1120,
+	 1920, 2844, 1080, 1120,
 	 ov5640_setting_1080P_1920_1080,
 	 ARRAY_SIZE(ov5640_setting_1080P_1920_1080),
 	 OV5640_30_FPS},