Hello Laurentiu,
On Thu Sep 11, 2025 at 1:37 PM CEST, Laurentiu Palcu wrote:
> i.MX94 series LDB controller shares the same LDB and LVDS control
> registers as i.MX8MP and i.MX93 but supports a higher maximum clock
> frequency.
>
> Add a 'max_clk_khz' member to the fsl_ldb_devdata structure in order to
> be able to set different max frequencies for other platforms.
>
> Signed-off-by: Laurentiu Palcu <[email protected]>
> Reviewed-by: Frank Li <[email protected]>
[...]
> @@ -270,8 +281,9 @@ fsl_ldb_mode_valid(struct drm_bridge *bridge,
> const struct drm_display_mode *mode)
I'd suggest a couple possible code style improvements here:
> {
> struct fsl_ldb *fsl_ldb = to_fsl_ldb(bridge);
> + u32 ch_max_clk_khz = fsl_ldb->devdata->max_clk_khz;
You don't need a variable to use it only once.
>
> - if (mode->clock > (fsl_ldb_is_dual(fsl_ldb) ? 160000 : 80000))
> + if (mode->clock > (fsl_ldb_is_dual(fsl_ldb) ? 2 * ch_max_clk_khz :
> ch_max_clk_khz))
And here you can use the ternary operator to compute the multiplier only:
if (mode->clock > (fsl_ldb_is_dual(fsl_ldb) ? 2 : 1) *
fsl_ldb->devdata->max_clk_khz)
Up to you whether you want to take my proposals above. The patch looks good
anyway, so with or without those changes:
Reviewed-by: Luca Ceresoli <[email protected]>
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com