media: ov08x40: Add Signal Integration Adjustments for specific project
PATCH v2 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/media/i2c/ov08x40.c +15 -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},
@@ -2913,6 +2925,9 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ +ov08x40_write_reg_list (ov08x, &si_regs); +/* 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
Sakari Ailus
maintainerHi Jason,
Quoted 17 lines · Jason Z
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.
Signed-off-by Jason Chen <[email protected]>--- drivers/media/i2c/ov08x40.c | 15 +++++++++++++++ 1 file changed, 15 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 */
We need a better say to control these: if you need to change this to make it work on one board, another board may well need different settings.
Probably the easiest way would be to figure out canonical, hardware independent configuration parameters and define them in DT bindings (Documentation/devicetree/bindings/media/video-interfaces.yaml), and add support for those in this driver.
DMI as such could be how you figure out which settings you need, but it should not be the task of a the sensor driver to do that.
Cc Laurent.
Quoted 20 lines
drivers/media/i2c/ov08x40.c +10
-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 },@@ -2913,6 +2925,9 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ +ov08x40_write_reg_list (ov08x, &si_regs); +/* 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, Sakari Ailus
Quoted 35 lines · Sakari Ailus
Quoted 17 lines · Jason Z
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.
Signed-off-by Jason Chen <[email protected]>--- drivers/media/i2c/ov08x40.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/media/i2c/ov08x40.c +0
-0drivers/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 */We need a better say to control these: if you need to change this to make it work on one board, another board may well need different settings.
Probably the easiest way would be to figure out canonical, hardware independent configuration parameters and define them in DT bindings (
Documentation/devicetree/bindings/media/video-interfaces.yaml), and add support for those in this driver.
Quoted 4 lines
DMI as such could be how you figure out which settings you need, but it should not be the task of a the sensor driver to do that.
Cc Laurent.
Agreed.
Quoted 20 lines
Quoted 20 lines
drivers/media/i2c/ov08x40.c +10
-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 },@@ -2913,6 +2925,9 @@ static int ov08x40_start_streaming(struct ov08x40 *ov08x)return ret; } +/* Apply SI change to current project */ +ov08x40_write_reg_list (ov08x, &si_regs); +/* 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