[PATCH v4 1/3] drm/panel: refactor INNOLUX P079ZCA panel driver

Heiko Stuebner heiko at sntech.de
Thu Jun 14 12:49:05 UTC 2018


Am Mittwoch, 14. März 2018, 13:02:13 CEST schrieb Emil Velikov:
> Hi Lin,
> 
> On 14 March 2018 at 09:12, Lin Huang <hl at rock-chips.com> wrote:
> > From: huang lin <hl at rock-chips.com>
> >
> > Refactor Innolux P079ZCA panel driver, let it support
> > multi panel.
> >
> > Change-Id: If89be5e56dba8cb498e2d50c1bbeb0e8016123a2
> > Signed-off-by: Lin Huang <hl at rock-chips.com>

[...]

> > @@ -207,19 +248,28 @@ static const struct drm_panel_funcs innolux_panel_funcs = {
> 
> >
> > -       innolux->supply = devm_regulator_get(dev, "power");
> > -       if (IS_ERR(innolux->supply))
> > -               return PTR_ERR(innolux->supply);
> > +       innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
> > +       if (!innolux)
> > +               return -ENOMEM;
> > +
> > +       innolux->desc = desc;
> > +       innolux->vddi = devm_regulator_get(dev, "power");
> > +       innolux->avdd = devm_regulator_get(dev, "avdd");
> > +       innolux->avee = devm_regulator_get(dev, "avee");
> >
> AFAICT devm_regulator_get returns a pointer which is unsuitable to be
> passed into regulator_{enable,disable}.
> Hence, the IS_ERR check should stay. If any of the regulators are
> optional, you want to call regulator_{enable,disable} only as
> applicable.

using the regulator_bulk APIs should help to make this far easier,
as you can just define the per-panel supplies in in the panel_desc
and then get + enable the correct ones per bound panel.




More information about the dri-devel mailing list