Re: [PATCH v4 4/9] drm/mediatek: dsi: Use bitfield macros where useful

From: Alexandre Mergnat
Date: Tue Feb 06 2024 - 10:12:53 EST


Reviewed-by: Alexandre Mergnat <amergnat@xxxxxxxxxxxx>

On 06/02/2024 13:07, AngeloGioacchino Del Regno wrote:
Instead of open coding bitshifting for various register fields,
use the bitfield macro FIELD_PREP(): this allows to enhance the
human readability, decrease likeliness of mistakes (and register
field overflowing) and also to simplify the code.
The latter is especially seen in mtk_dsi_rxtx_control(), where
it was possible to change a switch to a short for loop and to
also remove the need to check for maximum DSI lanes == 4 thanks
to the FIELD_PREP macro masking the value.

While at it, also add the missing DA_HS_SYNC bitmask, used in
mtk_dsi_phy_timconfig().

--
Regards,
Alexandre