On 17/03/2020 14:40, Tomi Valkeinen wrote: > Looking at the git log, these values seem to have been there from the start. Initially in the raw > register sequences, then moved from there to ov5640_mode_info. But the numbers have been the same. > > I wonder where they came originally, and whether they have ever been correct. > > Perhaps I'll cook up a patch where I'll update the values to what the sensor sheet suggests, and > other people can try and see if the driver still works for them. Here's an RFC patch which makes everything work for me. The numbers are from the datasheet, "DVP timing specifications" table. I have to say it's not quite clear to me how all those numbers should be used, and how they match to the registers. The htot value (4) seems quite obvious, though. But then, how to come up with the vtot, I don't know. The current vtot values work for me, but where they come from, or how to calculate them, I have no idea. So, this is obviously a bit of a hack. But if the change works for everyone else, and fixes issues on my setup, I wish it could be merged. >From a5d6caf1369396a82e9b4f9bf731194ca4907dbd Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen <tomi.valkeinen@xxxxxx> Date: Fri, 13 Mar 2020 10:30:02 +0200 Subject: [PATCH] media: ov5640: adjust htot 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@xxxxxx> --- 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 2fe4a7ac0592..736b286ebb4b 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -551,42 +551,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}, -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki