Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1182305

Re: [PATCH v2] backlight: lp855x: use private data for regulator control

From "Jingoo Han" <jingoohan1@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] backlight: lp855x: use private data for regulator control
Date 2015-07-12 12:40 +0200
Message-ID <pLmPT-78L-11@gated-at.bofh.it> (permalink)
References (1 earlier) <pKI66-7Ca-41@gated-at.bofh.it> <pKNp8-2e9-13@gated-at.bofh.it> <pKNp8-2e9-15@gated-at.bofh.it> <pKNyP-2hl-15@gated-at.bofh.it> <pKNS9-2E5-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Saturday, July 11, 2015 6:11 AM, Kim, Milo wrote:
> On 7/11/2015 5:52 AM, Kim, Milo wrote:
> > Hi Paul,
> >
> > On 7/11/2015 5:49 AM, Sean Paul wrote:
> >> On Fri, Jul 10, 2015 at 4:43 PM, Kim, Milo <milo.kim@ti.com> wrote:
> >>> Hi Paul,
> >>>
> >>>
> >>> On 7/11/2015 12:01 AM, Sean Paul wrote:
> >>>>
> >>>> On Fri, Jul 10, 2015 at 4:26 AM, Milo Kim <milo.kim@ti.com> wrote:
> >>>>>
> >>>>> LP855x backlight device can be enabled by external VDD input.
> >>>>> The 'supply' data is used for this purpose.
> >>>>> It's kind of private data which runs internally, so there is no reason to
> >>>>> expose to the platform data.
> >>>>>
> >>>>> And devm_regulator_get() is moved from _parse_dt() to _probe().
> >>>>> Regulator consumer(lp855x) can control regulator not only from DT but
> >>>>> also
> >>>>> from platform data configuration in a source file such like board-*.c.
> >>>>>
> >>>>> If 'power' regulator driver is not ready, lp855x should continue to work
> >>>>> because the power supply control is optional. So -EPROBE_DEFER return
> >>>>> code
> >>>>> is removed.
> >>>>>
> >>>>> v1->v2:
> >>>>>      Keeps optional property '<name>-supply' in LP855x DT binding.
> >>>>>
> >>>>> Cc: Sean Paul <seanpaul@chromium.org>
> >>>>> Cc: Jingoo Han <jingoohan1@gmail.com>
> >>>>> Cc: Lee Jones <lee.jones@linaro.org>
> >>>>> Cc: linux-kernel@vger.kernel.org
> >>>>> Signed-off-by: Milo Kim <milo.kim@ti.com>
> >>>>> ---
> >>>>>     drivers/video/backlight/lp855x_bl.c  | 20 +++++++++-----------
> >>>>>     include/linux/platform_data/lp855x.h |  2 --
> >>>>>     2 files changed, 9 insertions(+), 13 deletions(-)
> >>>>>

[.....]

> >>>>
> >>>>
> >>>> Hi Milo,
> >>>> You removed the probe deferral handling on the regulator and broke
> >>>> probe deferral in cases where the regulator isn't ready.
> >>>
> >>>
> >>> This power supply is optional. Even if lp855x can not get regulator driver,
> >>> it should work. (And I saw same comment in the DT. The 'power-supply'
> >>> property is optional). So -EPORBE_DEFER is not necessary in _probe().
> >>>
> >>
> >> I respectfully disagree. devm_regulator_get can return EPROBE_DEFER if
> >> the regulator is valid (and specified in the dt), but not ready to be
> >> used yet. In this case, your patch will assume it doesn't exist and
> >> will never use it. This Is Bad.
> >
> > So do you think this power supply should be mandatory in this driver?
> 
> The devm_regulator_get_optinonal() seems the right API for this case.
> Let me take a look at and get back to you.

The devm_regulator_get_optinonal() looks better. But, I am not sure.
Please review devm_regulator_get_optinonal() carefully, before sending
the V3 patch.

Best regards,
Jingoo Han

> 
> Best regards,
> Milo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] backlight: lp855x: use private data for regulator control Milo Kim <milo.kim@ti.com> - 2015-07-10 10:30 +0200
  Re: [PATCH v2] backlight: lp855x: use private data for regulator control "Jingoo Han" <jingoohan1@gmail.com> - 2015-07-12 12:40 +0200

csiph-web