]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/bridge: ti-sn65dsi86: Config number of DP lanes Mo' Betta
authorDouglas Anderson <dianders@chromium.org>
Wed, 18 Dec 2019 22:35:25 +0000 (14:35 -0800)
committerNeil Armstrong <narmstrong@baylibre.com>
Thu, 13 Feb 2020 09:21:09 +0000 (10:21 +0100)
The driver used to say that the value to program into bridge register
0x93 was dp_lanes - 1.  Looking at the datasheet for the bridge, this
is wrong.  The data sheet says:
* 1 = 1 lane
* 2 = 2 lanes
* 3 = 4 lanes

A more proper way to express this encoding is min(dp_lanes, 3).

At the moment this change has zero effect because we've hardcoded the
number of DP lanes to 4.  ...and (4 - 1) == min(4, 3).  How fortunate!
...but soon we'll stop hardcoding the number of lanes.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191218143416.v3.4.If3e2d0493e7b6e8b510ea90d8724ff760379b3ba@changeid
drivers/gpu/drm/bridge/ti-sn65dsi86.c

index 0cb40fa6c0a51167196030ea488f75747ae09ae9..9cc0b2bb36ee89fb33c52d89eee183a7b4093a5f 100644 (file)
@@ -523,7 +523,7 @@ static void ti_sn_bridge_enable(struct drm_bridge *bridge)
                           CHA_DSI_LANES_MASK, val);
 
        /* DP lane config */
-       val = DP_NUM_LANES(pdata->dp_lanes - 1);
+       val = DP_NUM_LANES(min(pdata->dp_lanes, 3));
        regmap_update_bits(pdata->regmap, SN_SSC_CONFIG_REG, DP_NUM_LANES_MASK,
                           val);