Skip to content

Commit 3e4c31e

Browse files
achrisanmlankhorst
authored andcommitted
drm/kmb: Work around for higher system clock
Use a different value for system clock offset in the ppl/llp ratio calculations for clocks higher than 500 Mhz. Fixes: 98521f4 ("drm/kmb: Mipi DSI part of the display driver") Signed-off-by: Anitha Chrisanthus <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent 7729706 commit 3e4c31e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/gpu/drm/kmb/kmb_dsi.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ static u32 mipi_tx_fg_section_cfg(struct kmb_dsi *kmb_dsi,
482482
return 0;
483483
}
484484

485+
#define CLK_DIFF_LOW 50
486+
#define CLK_DIFF_HI 60
487+
#define SYSCLK_500 500
488+
485489
static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen,
486490
struct mipi_tx_frame_timing_cfg *fg_cfg)
487491
{
@@ -492,7 +496,12 @@ static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen,
492496
/* 500 Mhz system clock minus 50 to account for the difference in
493497
* MIPI clock speed in RTL tests
494498
*/
495-
sysclk = kmb_dsi->sys_clk_mhz - 50;
499+
if (kmb_dsi->sys_clk_mhz == SYSCLK_500) {
500+
sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_LOW;
501+
} else {
502+
/* 700 Mhz clk*/
503+
sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_HI;
504+
}
496505

497506
/* PPL-Pixel Packing Layer, LLP-Low Level Protocol
498507
* Frame genartor timing parameters are clocked on the system clock,

0 commit comments

Comments
 (0)