Re: [PATCH v5 3/9] drm/bridge: fsl-ldb: Add support for i.MX94

From: Laurentiu Palcu

Date: Fri Oct 31 2025 - 08:15:31 EST


Hi Luca,

On Fri, Oct 31, 2025 at 09:27:29AM +0100, Luca Ceresoli wrote:
> 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 <laurentiu.palcu@xxxxxxxxxxx>
> > Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
>
> [...]
>
> > @@ -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.

I'm ok with your proposal. I will include it in v6.

Thanks,
Laurentiu

> The patch looks good anyway, so with or without those changes:
>
> Reviewed-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

--
Thanks,
Laurentiu