On Mon, Dec 16, 2024 at 09:54:09AM +0100, Andrej Picej wrote: > Add a optional properties to change LVDS output voltage. This should not > be static as this depends mainly on the connected display voltage > requirement. We have three properties: > - "ti,lvds-termination-ohms", which sets near end termination, > - "ti,lvds-vod-swing-data-microvolt" and > - "ti,lvds-vod-swing-clock-microvolt" which both set LVDS differential > output voltage for data and clock lanes. They are defined as an array > with min and max values. The appropriate bitfield will be set if > selected constraints can be met. > > If "ti,lvds-termination-ohms" is not defined the default of 200 Ohm near > end termination will be used. Selecting only one: > "ti,lvds-vod-swing-data-microvolt" or > "ti,lvds-vod-swing-clock-microvolt" can be done, but the output voltage > constraint for only data/clock lanes will be met. Setting both is > recommended. > > Signed-off-by: Andrej Picej <andrej.picej@xxxxxxxxx> > --- > Changes in v7: > - decrement refcount of the endpoint in all error cases, > - add spaces to improve the readability of the long if statement conditions in > sn65dsi83_select_lvds_vod_swing. > Changes in v6: > - rework termination resistor logic, default is now set by resistor value, not > reg value, > - move setting lvds_vod_swing_conf to default value of 0x1 inside if statement > which checks if both properties are not set > Changes in v5: > - specify default values in sn65dsi83_parse_lvds_endpoint, > - move sn65dsi83_parse_lvds_endpoint for channel B up, outside if, > Changes in v4: > - fix typo in commit message bitfiled -> bitfield > - use arrays (lvds_vod_swing_conf and lvds_term_conf) in private data, instead > of separate variables for channel A/B > - add more checks on return value of "of_property_read_u32_array" > Changes in v3: > - use microvolts for default array values 1000 mV -> 1000000 uV. > Changes in v2: > - use datasheet tables to get the proper configuration > - since major change was done change the authorship to myself > --- > drivers/gpu/drm/bridge/ti-sn65dsi83.c | 145 +++++++++++++++++++++++++- > 1 file changed, 142 insertions(+), 3 deletions(-) > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> -- With best wishes Dmitry