Re: [PATCH v3 4/7] drm: rcar-du: lvds: Fix stop sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomi,

On Mon, Jan 23, 2023 at 11:48 AM Tomi Valkeinen
<tomi.valkeinen+renesas@xxxxxxxxxxxxxxxx> wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@xxxxxxxxxxx>
>
> According to hardware manual, LVDCR0 register must be cleared bit by bit
> when disabling LVDS.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@xxxxxxxxxxx>
> Signed-off-by: LUU HOAI <hoai.luu.ub@xxxxxxxxxxx>
> [tomi.valkeinen: simplified the code a bit]
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@xxxxxxxxxxxxxxxx>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

Thanks for your patch!

> @@ -544,6 +549,27 @@ static void rcar_lvds_atomic_disable(struct drm_bridge *bridge,
>                                      struct drm_bridge_state *old_bridge_state)
>  {
>         struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
> +       u32 lvdcr0;
> +
> +       lvdcr0 = rcar_lvds_read(lvds, LVDCR0);
> +
> +       lvdcr0 &= ~LVDCR0_LVRES;
> +       rcar_lvds_write(lvds, LVDCR0, lvdcr0);
> +
> +       if (lvds->info->quirks & RCAR_LVDS_QUIRK_GEN3_LVEN) {
> +               lvdcr0 &= ~LVDCR0_LVEN;
> +               rcar_lvds_write(lvds, LVDCR0, lvdcr0);
> +       }
> +
> +       if (lvds->info->quirks & RCAR_LVDS_QUIRK_PWD) {
> +               lvdcr0 &= ~LVDCR0_PWD;
> +               rcar_lvds_write(lvds, LVDCR0, lvdcr0);
> +       }
> +
> +       if (!(lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL)) {
> +               lvdcr0 &= ~LVDCR0_PLLON;
> +               rcar_lvds_write(lvds, LVDCR0, lvdcr0);
> +       }

Please add a comment explaining why there are multiple register writes,
to avoid an over-zealous janitor "optimizing" the code later.

>
>         rcar_lvds_write(lvds, LVDCR0, 0);
>         rcar_lvds_write(lvds, LVDCR1, 0);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux