drm/panel/panel-sitronix-st7701: Fix RTNI calculation
authorMarek Vasut <marex@denx.de>
Wed, 12 Oct 2022 22:11:59 +0000 (00:11 +0200)
committerMarek Vasut <marex@denx.de>
Tue, 1 Nov 2022 17:34:08 +0000 (18:34 +0100)
commitc1cdee9b685a174fca849e1451c201a846a69318
treee19cc18de72e91c429d6273e01a3f6746dfc65b7
parent2215cb3be5c28a1fd43036550c00c2371aeeba95
drm/panel/panel-sitronix-st7701: Fix RTNI calculation

The RTNI field is multiplied by 16 and incremented by 512 before being
used as the minimum number of pixel clock per horizontal line, hence
it is necessary to subtract those 512 bytes from htotal and then divide
the result by 16 before writing the value into the RTNI field. Fix the
calculation.

Fixes: de2b4917843c ("drm/panel/panel-sitronix-st7701: Infer horizontal pixel count from TFT mode")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221012221159.88397-1-marex@denx.de
drivers/gpu/drm/panel/panel-sitronix-st7701.c