[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190611221147.GG137143@google.com>
Date: Tue, 11 Jun 2019 15:11:47 -0700
From: Matthias Kaehlcke <mka@...omium.org>
To: Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc: Lee Jones <lee.jones@...aro.org>,
Daniel Thompson <daniel.thompson@...aro.org>,
Jingoo Han <jingoohan1@...il.com>, Pavel Machek <pavel@....cz>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Thierry Reding <thierry.reding@...il.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
dri-devel@...ts.freedesktop.org, linux-leds@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org, linux-fbdev@...r.kernel.org,
Douglas Anderson <dianders@...omium.org>,
Brian Norris <briannorris@...omium.org>
Subject: Re: [PATCH 1/2] dt-bindings: pwm-backlight: Add 'max-brightness'
property
Hi Jacek,
On Tue, Jun 11, 2019 at 10:02:23PM +0200, Jacek Anaszewski wrote:
> Hi Matthias,
>
> On 6/11/19 1:37 AM, Matthias Kaehlcke wrote:
> > Add an optional 'max-brightness' property, which is used to specify
> > the number of brightness levels (max-brightness + 1) when the node
> > has no 'brightness-levels' table.
> >
> > Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> > ---
> > .../devicetree/bindings/leds/backlight/pwm-backlight.txt | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> > index 64fa2fbd98c9..98f4ba626054 100644
> > --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> > +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> > @@ -27,6 +27,9 @@ Optional properties:
> > resolution pwm duty cycle can be used without
> > having to list out every possible value in the
> > brightness-level array.
> > + - max-brightness: Maximum brightness value. Used to specify the number of
> > + brightness levels (max-brightness + 1) when the node
> > + has no 'brightness-levels' table.
>
> In the LED subsystem we have led-max-microamp property which seems to
> better describe hardware capabilities. It says just: this is the current
> level the LED can withstand. max-brightness does not implicitly convey
> this kind of information.
>
> Why the need for the property at all? If for the reasons other than
> hardware capabilities than it should be more likely handled
> by userspace.
The driver needs to know how many brightness levels to expose to
userspace. It currently uses a heuristic for that which is broken:
https://elixir.bootlin.com/linux/v5.1.9/source/drivers/video/backlight/pwm_bl.c#L234
https://lore.kernel.org/patchwork/patch/1086777/#1282610
In any case it seems the discussion is going into the direction of
fixing the heuristic (apparently using the period as an indicator of
the PWM resolution has more merit than I was initially aware of), if
that moves forward the property wouldn't be needed.
Powered by blists - more mailing lists