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

Alexandre Mergnat amergnat at baylibre.com
Tue Feb 6 07:09:37 PST 2024


Reviewed-by: Alexandre Mergnat <amergnat at baylibre.com>

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



More information about the Linux-mediatek mailing list