drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
authorAdam Ford <aford173@gmail.com>
Sun, 19 Mar 2023 12:55:24 +0000 (07:55 -0500)
committerRobert Foss <rfoss@kernel.org>
Mon, 20 Mar 2023 09:57:22 +0000 (10:57 +0100)
commitee0285e13455fdbce5de315bdbe91b5f198a2a06
tree3cd332b05d9a8f2097e8341566cce4906f7a7c94
parent5327469ec4c07977e1d824badadd2628fcd04e85
drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535

When dynamically switching lanes was removed, the intent of the code
was to check to make sure that higher speed items used 4 lanes, but
it had the unintended consequence of removing the slower speeds for
4-lane users.

This attempts to remedy this by doing a check to see that the
max frequency doesn't exceed the chip limit, and a second
check to make sure that the max bit-rate doesn't exceed the
number of lanes * max bit rate / lane.

Fixes: 9a0cdcd6649b ("drm/bridge: adv7533: remove dynamic lane switching from adv7533 bridge")
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230319125524.58803-1-aford173@gmail.com
drivers/gpu/drm/bridge/adv7511/adv7533.c