Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: rcar-du: lvds: Adjust operating frequency for D3 and E3

The D3 and E3 SoCs have different pixel clock frequency limits for the
LVDS encoder than the other SoCs in the Gen3 family. Adjust the mode
fixup implementation accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

+7 -2
+7 -2
drivers/gpu/drm/rcar-du/rcar_lvds.c
··· 531 531 const struct drm_display_mode *mode, 532 532 struct drm_display_mode *adjusted_mode) 533 533 { 534 + struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge); 535 + int min_freq; 536 + 534 537 /* 535 538 * The internal LVDS encoder has a restricted clock frequency operating 536 - * range (31MHz to 148.5MHz). Clamp the clock accordingly. 539 + * range, from 5MHz to 148.5MHz on D3 and E3, and from 31MHz to 540 + * 148.5MHz on all other platforms. Clamp the clock accordingly. 537 541 */ 538 - adjusted_mode->clock = clamp(adjusted_mode->clock, 31000, 148500); 542 + min_freq = lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL ? 5000 : 31000; 543 + adjusted_mode->clock = clamp(adjusted_mode->clock, min_freq, 148500); 539 544 540 545 return true; 541 546 }