public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: dri-devel@lists.freedesktop.org
Cc: Emil Velikov <emil.l.velikov@gmail.com>,
	Lin Huang <hl@rock-chips.com>, David Airlie <airlied@linux.ie>,
	Brian Norris <briannorris@chromium.org>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH v4 1/3] drm/panel: refactor INNOLUX P079ZCA panel driver
Date: Thu, 14 Jun 2018 14:49:05 +0200	[thread overview]
Message-ID: <2358142.UaIIZZriA2@phil> (raw)
In-Reply-To: <CACvgo50UGi97RYQkYLMmVNKcfi39BSVVKkxHnLTvsEks737+-Q@mail.gmail.com>

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@rock-chips.com> wrote:
> > From: huang lin <hl@rock-chips.com>
> >
> > Refactor Innolux P079ZCA panel driver, let it support
> > multi panel.
> >
> > Change-Id: If89be5e56dba8cb498e2d50c1bbeb0e8016123a2
> > Signed-off-by: Lin Huang <hl@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.



  parent reply	other threads:[~2018-06-14 12:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  9:12 [PATCH v4 1/3] drm/panel: refactor INNOLUX P079ZCA panel driver Lin Huang
2018-03-14  9:12 ` [PATCH v4 2/3] drm/panel: support Innolux P097PFG panel Lin Huang
2018-03-14 12:16   ` Emil Velikov
2018-03-14  9:12 ` [PATCH v4 3/3] dt-bindings: Add INNOLUX P097PFG panel bindings Lin Huang
2018-03-14 12:18   ` Emil Velikov
2018-03-14 12:02 ` [PATCH v4 1/3] drm/panel: refactor INNOLUX P079ZCA panel driver Emil Velikov
2018-03-15  2:35   ` hl
2018-03-19 13:09     ` Emil Velikov
2018-03-20  6:24       ` hl
2018-03-20 10:20         ` Emil Velikov
2018-03-22  1:49           ` hl
2018-06-14 12:49   ` Heiko Stuebner [this message]
2018-04-26 14:10 ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2358142.UaIIZZriA2@phil \
    --to=heiko@sntech.de \
    --cc=airlied@linux.ie \
    --cc=briannorris@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=hl@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox