linux/drivers/gpu/drm/bridge/analogix
Icenowy Zheng 2be30d34a3 drm/bridge: analogix-anx6345: fix set of link bandwidth
Current code tries to store the link rate (in bps, which is a big
number) in a u8, which surely overflow. Then it's converted back to
bandwidth code (which is thus 0) and written to the chip.

The code sometimes works because the chip will automatically fallback to
the lowest possible DP link rate (1.62Gbps) when get the invalid value.
However, on the eDP panel of Olimex TERES-I, which wants 2.7Gbps link,
it failed.

As we had already read the link bandwidth as bandwidth code in earlier
code (to check whether it is supported), use it when setting bandwidth,
instead of converting it to link rate and then converting back.

Fixes: e1cff82c10 ("drm/bridge: fix anx6345 compilation for v5.5")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Torsten Duwe <duwe@lst.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200221165127.813325-1-icenowy@aosc.io
2020-02-27 11:55:46 +01:00
..
analogix_dp_core.c Revert "drm/bridge: Patch atomic hooks to take a drm_bridge_state" 2020-01-08 00:34:28 +01:00
analogix_dp_core.h drm/rockchip: Use the helpers for PSR 2019-07-26 14:48:03 -04:00
analogix_dp_reg.c Linux 5.2-rc5 2019-06-19 12:07:29 +02:00
analogix_dp_reg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
analogix-anx78xx.c drm/bridge: extract some Analogix I2C DP common code 2019-11-08 10:27:37 +01:00
analogix-anx78xx.h drm/bridge: split some definitions of ANX78xx to dedicated headers 2019-11-08 10:27:32 +01:00
analogix-anx6345.c drm/bridge: analogix-anx6345: fix set of link bandwidth 2020-02-27 11:55:46 +01:00
analogix-i2c-dptx.c drm/bridge: Prepare Analogix anx6345 support 2019-11-08 10:27:53 +01:00
analogix-i2c-dptx.h drm/bridge: Prepare Analogix anx6345 support 2019-11-08 10:27:53 +01:00
analogix-i2c-txcommon.h drm/bridge: Prepare Analogix anx6345 support 2019-11-08 10:27:53 +01:00
Kconfig drm/bridge: anx6345: Fix compilation breakage on systems without CONFIG_OF 2019-11-13 09:52:44 +01:00
Makefile drm/bridge: Add Analogix anx6345 support 2019-11-08 10:28:18 +01:00