]> git.baikalelectronics.ru Git - kernel.git/commit
drm/bridge: analogix-anx6345: fix set of link bandwidth
authorIcenowy Zheng <icenowy@aosc.io>
Fri, 21 Feb 2020 16:51:27 +0000 (00:51 +0800)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 27 Feb 2020 10:55:46 +0000 (11:55 +0100)
commitaf6aed583fb56895d1a457d7f94067428d775090
treef0c78479ddda30e143433d92222cc0b9e94a423b
parentd8a4f3b95e22a9f0dde6c3e4b28b262d1e3c63a1
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: a108149924cd ("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
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c