Skip to content

Commit ff4e452

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: dsi: Replace open-coded instance of HZ_PER_MHZ
In mtk_dsi_phy_timconfig(), we're dividing the `data_rate` variable, expressed in Hz to retrieve a value in MHz: instead of open-coding, use the HZ_PER_MHZ definition, available in linux/units.h. Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20240215085316.56835-6-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent aaeb933 commit ff4e452

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/phy/phy.h>
1414
#include <linux/platform_device.h>
1515
#include <linux/reset.h>
16+
#include <linux/units.h>
1617

1718
#include <video/mipi_display.h>
1819
#include <video/videomode.h>
@@ -238,7 +239,7 @@ static void mtk_dsi_mask(struct mtk_dsi *dsi, u32 offset, u32 mask, u32 data)
238239
static void mtk_dsi_phy_timconfig(struct mtk_dsi *dsi)
239240
{
240241
u32 timcon0, timcon1, timcon2, timcon3;
241-
u32 data_rate_mhz = DIV_ROUND_UP(dsi->data_rate, 1000000);
242+
u32 data_rate_mhz = DIV_ROUND_UP(dsi->data_rate, HZ_PER_MHZ);
242243
struct mtk_phy_timing *timing = &dsi->phy_timing;
243244

244245
timing->lpx = (60 * data_rate_mhz / (8 * 1000)) + 1;

0 commit comments

Comments
 (0)