On Sun, Nov 15, 2026 at 10:26 PM Chen-Yu Tsai <[email protected]> wrote:
>
> On Sun, Nov 15, 2026 at 2:11 PM Jernej Skrabec <[email protected]> 
> wrote:
> >
> > The shared plane driver and split register resources are now in place.
> > Switch DE33 mixer discovery to the new bindings and remove the legacy
> > per-mixer plane setup. Mixer register space now covers only display
> > blending control, so limit its regmap accordingly.
> >
> > The old DE33 binding is not supported anymore, since it can't describe
> > shared planes and was never used by any device tree. If it's detected,
> > print an error asking the user to update the device tree, instead of
> > failing silently or misusing the plane register space as blender
> > registers.
> >
> > Signed-off-by: Jernej Skrabec <[email protected]>
> > ---
> >  drivers/gpu/drm/sun4i/sun8i_mixer.c | 195 ++++++++++++++++++++--------
> >  drivers/gpu/drm/sun4i/sun8i_mixer.h |  10 +-
> >  2 files changed, 140 insertions(+), 65 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c 
> > b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > index dbde80b32080..0970be6aa035 100644
> > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> > @@ -13,6 +13,7 @@
> >  #include <linux/of.h>
> >  #include <linux/of_device.h>
> >  #include <linux/of_graph.h>
> > +#include <linux/of_platform.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/reset.h>
> >
> > @@ -25,6 +26,7 @@
> >  #include <drm/drm_probe_helper.h>
> >
> >  #include "sun4i_drv.h"
> > +#include "sun50i_planes.h"
>
> Nit: doesn't seem to follow the order we use elsewhere. I think we normally
> would do:
>
>     sun4i_drv.h
>     sun8i_*
>     sun50i_planes.h
>
> >  #include "sun8i_mixer.h"
> >  #include "sun8i_ui_layer.h"
> >  #include "sun8i_vi_layer.h"
>
> [...]
>
> > @@ -566,12 +582,34 @@ static int sun8i_mixer_bind(struct device *dev, 
> > struct device *master,
> >         if (!mixer->cfg)
> >                 return -EINVAL;
> >
> > +       if (mixer->cfg->de_type == SUN8I_MIXER_DE33) {
> > +               /*
> > +                * The original DE33 binding described planes as part of
> > +                * the mixer, which can't work with more than one mixer.
> > +                * It was never used by any device tree, so it's not
> > +                * supported.
> > +                */
> > +               if (of_property_match_string(dev->of_node, "reg-names",
> > +                                            "layers") >= 0 ||
>
> No need to wrap this bit.
>
> > +                   !of_property_present(dev->of_node, "allwinner,planes"))
> > +                       return dev_err_probe(dev, -EINVAL,
> > +                                            "Unsupported DE33 mixer 
> > binding, please update the device tree\n");
> > +
> > +               mixer->engine.ops = &sun50i_engine_ops;
> > +       } else {
> > +               mixer->engine.ops = &sun8i_engine_ops;
> > +       }
> > +
> >         regs = devm_platform_ioremap_resource(pdev, 0);
> >         if (IS_ERR(regs))
> >                 return PTR_ERR(regs);
> >
> > -       mixer->engine.regs = devm_regmap_init_mmio(dev, regs,
> > -                                                  
> > &sun8i_mixer_regmap_config);
> > +       if (mixer->cfg->de_type == SUN8I_MIXER_DE33)
> > +               mixer->engine.regs = devm_regmap_init_mmio(dev, regs,
> > +                                                          
> > &sun50i_mixer33_regmap_config);
> > +       else
> > +               mixer->engine.regs = devm_regmap_init_mmio(dev, regs,
> > +                                                          
> > &sun8i_mixer_regmap_config);
>
> At some point we need to move most of the bind function to the probe function.
> None of the devm_* stuff gets released if the bind function fails.

It seems I was wrong. Though it probably still makes sense to move anything
that could return -EPROBE_DEFER to the probe function to make it fail / retry
early.


ChenYu

Reply via email to