media: ov08x40: Add Signal Integration Adjustments for specific project
PATCH 1/1 media: ov08x40: Add Signal Integration Adjustments for specific project
From: Jason Chen <[email protected]>
Due to certain MIPI hardware designs using overly long cables, there is a loss of signal strength, resulting in failed signal integration. The patch includes changes to adjust the driving strength in the register settings for a specific project.
--- drivers/media/i2c/ov08x40.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/media/i2c/ov08x40.c +17 -0
@@ -160,6 +160,18 @@ static const struct ov08x40_reg mipi_data_rate_800mbps[] = { {0x6002, 0x2e}, }; +static const struct ov08x40_reg mipi_si_changed_regs[] = { + {0x481b ,0x2c },/* HS Exit: Data Tx TEOT - reducing 8ns */ + {0x4826 ,0x42 },/* HS Entry: Data Tx TREOT - raising 8ns */ + {0x4829 ,0x54 },/* HS Exit: Data Tx TREOT - reducing 8ns */ + {0x4885 ,0x1f },/* driving strength change */ +}; + +struct ov08x40_reg_list si_regs = { + .regs = mipi_si_changed_regs, + .num_of_regs =ARRAY_SIZE (mipi_si_changed_regs), +}; +static const struct ov08x40_reg mode_3856x2416_regs[] = { {0x5000 ,0x5d }, {0x5001, 0x20},
@@ -2917,6 +2929,11 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ + reg_list = &si_regs; + +ov08x40_write_reg_list (ov08x, reg_list); +/* Apply default values of current mode */ reg_list = &ov08x->cur_mode->reg_list; ret =ov08x40_write_reg_list (ov08x, reg_list);
Signature · 1 line
2.34.1
Quoting Chen, Jason Z (2023-10-20 05:09:08)
Quoted 6 lines
From: Jason Chen <[email protected]>
Due to certain MIPI hardware designs using overly long cables, there is a loss of signal strength, resulting in failed signal integration. The patch includes changes to adjust the driving strength in the register settings for a specific project.
For a specific project? Will this now affect 'all' projects using this sensor? Will that be adverse in anyway?
Do 'short' cables still function with this patch?
Quoted 11 lines
Signed-off-by Jason Chen <[email protected]>--- drivers/media/i2c/ov08x40.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/media/i2c/ov08x40.c +0
-0
drivers/media/i2c/ov08x40.c static const struct ov08x40_reg mipi_data_rate_800mbps[] = { · line 167
Quoted 8 lines
drivers/media/i2c/ov08x40.c +5
-0@@ -160,6 +160,18 @@ static const struct ov08x40_reg mipi_data_rate_800mbps[] = { {0x6002, 0x2e}, }; +static const struct ov08x40_reg mipi_si_changed_regs[] = { + {0x481b ,0x2c },/* HS Exit: Data Tx TEOT - reducing 8ns */ + {0x4826 ,0x42 },/* HS Entry: Data Tx TREOT - raising 8ns */ + {0x4829 ,0x54 },/* HS Exit: Data Tx TREOT - reducing 8ns */ + {0x4885, 0x1f}, /* driving strength change */
Are these changes 'relative' to already written values?
Quoted 11 lines
drivers/media/i2c/ov08x40.c +7
-0+}; + +struct ov08x40_reg_list si_regs = { + .regs = mipi_si_changed_regs, + .num_of_regs =ARRAY_SIZE (mipi_si_changed_regs), +}; +static const struct ov08x40_reg mode_3856x2416_regs[] = { {0x5000 ,0x5d }, {0x5001 ,0x20 },
drivers/media/i2c/ov08x40.c static int ov08x40_start_streaming(struct ov08x40 *ov08x) · line 2936
Quoted 8 lines
drivers/media/i2c/ov08x40.c +5
-0@@ -2917,6 +2929,11 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ + reg_list = &si_regs; + +ov08x40_write_reg_list (ov08x, reg_list); +
This looks odd. Why isn't this just:
ov08x40_write_reg_list(0v08x, &si_regs);
Quoted 6 lines
drivers/media/i2c/ov08x40.c +0
-0/* Apply default values of current mode */ reg_list = &ov08x->cur_mode->reg_list; ret =ov08x40_write_reg_list (ov08x, reg_list);Signature · 1 line
2.34.1
Quoted 26 lines · Kieran Bingham
Quoting Chen, Jason Z (2023-10-20 05:09:08)
Quoted 6 lines
From: Jason Chen <[email protected]>
Due to certain MIPI hardware designs using overly long cables, there is a loss of signal strength, resulting in failed signal integration. The patch includes changes to adjust the driving strength in the register settings for a specific project.
For a specific project? Will this now affect 'all' projects using this sensor? Will that be adverse in anyway?
Do 'short' cables still function with this patch?
Quoted 13 lines
Signed-off-by Jason Chen <[email protected]>--- drivers/media/i2c/ov08x40.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/media/i2c/ov08x40.c +0
-0@@ -160,6 +160,18 @@ static const struct ov08x40_reg mipi_data_rate_800mbps[] = { {0x6002, 0x2e}, };
Quoted 7 lines
drivers/media/i2c/ov08x40.c static const struct ov08x40_reg mipi_data_rate_800mbps[] = { · line 167
Quoted 5 lines
drivers/media/i2c/ov08x40.c +5
-0+static const struct ov08x40_reg mipi_si_changed_regs[] = { + {0x481b ,0x2c },/* HS Exit: Data Tx TEOT - reducing 8ns */ + {0x4826 ,0x42 },/* HS Entry: Data Tx TREOT - raising 8ns */ + {0x4829 ,0x54 },/* HS Exit: Data Tx TREOT - reducing 8ns */ + {0x4885 ,0x1f },/* driving strength change */ Are these changes 'relative' to already written values?
Looks like it's time to address MIPI PHY timings properly, by standardizing DT/ACPI device properties to convey timing information, and implementing helpers to parse those properties and calculate timing parameters for drivers.
Quoted 27 lines
Quoted 11 lines
drivers/media/i2c/ov08x40.c +7
-0+}; + +struct ov08x40_reg_list si_regs = { + .regs = mipi_si_changed_regs, + .num_of_regs =ARRAY_SIZE (mipi_si_changed_regs), +}; +static const struct ov08x40_reg mode_3856x2416_regs[] = { {0x5000 ,0x5d }, {0x5001 ,0x20 },drivers/media/i2c/ov08x40.c static int ov08x40_start_streaming(struct ov08x40 *ov08x) · line 2936
Quoted 8 lines
drivers/media/i2c/ov08x40.c +5
-0@@ -2917,6 +2929,11 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ + reg_list = &si_regs; + +ov08x40_write_reg_list (ov08x, reg_list); +This looks odd. Why isn't this just:
ov08x40_write_reg_list(0v08x, &si_regs);Quoted 3 lines
drivers/media/i2c/ov08x40.c +0
-0/* Apply default values of current mode */ reg_list = &ov08x->cur_mode->reg_list; ret =ov08x40_write_reg_list (ov08x, reg_list);
Signature · 3 lines
Regards, Laurent Pinchart
Thanks for the review, Laurent and Kieran
Quoted 2 lines
For a specific project? Will this now affect 'all' projects using this sensor? Will that be adverse in anyway?
This was my initial concern with the patch very first, so I have added the quirk infrastructure to distinguish it using dmi_check_system. However, the sensor vendor replies that if another platform uses the same clock frequency, it shouldn't pose a significant issue.
Quoted 1 line
Do 'short' cables still function with this patch?
Yes, the change only slightly modifies the HS Tx TEOT/TREOT part. The value remains within the DPHY tolerance.
Quoted 1 line
Are these changes 'relative' to already written values?
It's mostly related to DPHY timing changes, as I mentioned in the comments. Therefore, it's independent of other sensor's capabilitiles like exposure time.
Quoted 1 line
Looks like it's time to address MIPI PHY timings properly, by standardizing DT/ACPI device properties to convey timing information, and implementing helpers to parse those properties and calculate timing parameters for drivers.
This is a positive direction. However, I'd like to provide some context.
This project encountered issues like insufficient driving strength and inadequate HS preparing time. The sensor vendor only provided relative registers to assist in debugging such issues. The detail are dependent on sensor vendor willingness to share this confidential information.
So I am not sure if other sensor vendors, like Sony, will provide such information for creating an universal API to access DPHY timing.
Quoted 1 line
This looks odd. Why isn't this just:
Thank you for this. I'll make the update.
-----Original Message-----
From: Laurent Pinchart <[email protected]>
Sent: Tuesday, October 24, 2023 8:49 AM
To: Kieran Bingham <[email protected]>
Cc: Chen, Jason Z <[email protected]>; Yeh, Andy <[email protected]>; [email protected]; [email protected]; [email protected]; Zhang, Qingwu <[email protected]>
Subject: Re: [PATCH v1] media: ov08x40: Add Signal Integration Adjustments for specific project
Quoted 26 lines · Kieran Bingham
Quoting Chen, Jason Z (2023-10-20 05:09:08)
Quoted 6 lines
From: Jason Chen <[email protected]>
Due to certain MIPI hardware designs using overly long cables, there is a loss of signal strength, resulting in failed signal integration. The patch includes changes to adjust the driving strength in the register settings for a specific project.
For a specific project? Will this now affect 'all' projects using this sensor? Will that be adverse in anyway?
Do 'short' cables still function with this patch?
Quoted 13 lines
Signed-off-by Jason Chen <[email protected]>--- drivers/media/i2c/ov08x40.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)(quoted diff) +0
-0
b/drivers/media/i2c/ov08x40.cindex0b3b906ebef..4f13e23b325100644drivers/media/i2c/ov08x40.c +0
-0@@ -160,6 +160,18 @@ static const struct ov08x40_reg mipi_data_rate_800mbps[] = { {0x6002, 0x2e}, };
Quoted 7 lines
drivers/media/i2c/ov08x40.c static const struct ov08x40_reg mipi_data_rate_800mbps[] = { · line 167
Quoted 5 lines
drivers/media/i2c/ov08x40.c +5
-0+static const struct ov08x40_reg mipi_si_changed_regs[] = { + {0x481b ,0x2c },/* HS Exit: Data Tx TEOT - reducing 8ns */ + {0x4826 ,0x42 },/* HS Entry: Data Tx TREOT - raising 8ns */ + {0x4829 ,0x54 },/* HS Exit: Data Tx TREOT - reducing 8ns */ + {0x4885 ,0x1f },/* driving strength change */ Are these changes 'relative' to already written values?
Looks like it's time to address MIPI PHY timings properly, by standardizing DT/ACPI device properties to convey timing information, and implementing helpers to parse those properties and calculate timing parameters for drivers.
Quoted 21 lines
Quoted 10 lines
drivers/media/i2c/ov08x40.c +6
-0+}; + +struct ov08x40_reg_list si_regs = { + .regs = mipi_si_changed_regs, + .num_of_regs =ARRAY_SIZE (mipi_si_changed_regs), }; +static const struct ov08x40_reg mode_3856x2416_regs[] = { {0x5000 ,0x5d }, {0x5001 ,0x20 },drivers/media/i2c/ov08x40.c static int ov08x40_start_streaming(struct ov08x40 *ov08x) · line 2936
Quoted 8 lines
drivers/media/i2c/ov08x40.c +5
-0@@ -2917,6 +2929,11 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ + reg_list = &si_regs; + +ov08x40_write_reg_list (ov08x, reg_list); +This looks odd. Why isn't this just:
Quoted 5 lines
ov08x40_write_reg_list(0v08x, &si_regs);Quoted 3 lines
drivers/media/i2c/ov08x40.c +0
-0/* Apply default values of current mode */ reg_list = &ov08x->cur_mode->reg_list; ret =ov08x40_write_reg_list (ov08x, reg_list);
--
Regards,
Laurent Pinchart