Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Johannes Pointner <johannes.pointner@gmail.com>
Cc: linux-pwm@vger.kernel.org, Jingoo Han <jg1.han@samsung.com>,
	Bryan Wu <cooloney@gmail.com>, Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH] Added possibility to use pwm_bl.c with percentage instead of levels
Date: Fri, 27 Jun 2014 09:09:03 +0200	[thread overview]
Message-ID: <20140627070902.GA10703@ulmo> (raw)
In-Reply-To: <CAJKbBDDS1Dfpsv8C4W_2uBEgYpO2FmYyMHrZ9vAy_k_jTdV5MA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2849 bytes --]

On Fri, Jun 27, 2014 at 08:58:21AM +0200, Johannes Pointner wrote:
> I know what you mean because I have here for example a panel that only
> supports a duty cycle between 20 and 100 percent. But wouldn't I be a
> possibility to add optional nodes with minimal/maximal brightness or
> something like that?

We have something like that (lth_brightness) for non-DT and which was
supported in the first DT proposals. But again the equivalent using the
brightness-levels would be:

	brightness-levels = <0 20 21 ... 100>;

So the continuous range and low threshold are really just special cases
of what brightness-levels provides. Granted, it's somewhat tedious to
have to list ~100 values in a DT property like this, but I haven't
really heard any arguments why the range really needs to be that
fine-grained. Most of the devices that I've used have somewhere between
8 and 20 brightness levels. An exception to this are Android devices,
which do indeed seem to support truly continuous ranges.

Thierry

> 
> Hannes
> 
> 
> 2014-06-27 8:12 GMT+02:00 Thierry Reding <thierry.reding@gmail.com>:
> 
> > On Fri, Jun 27, 2014 at 07:32:20AM +0200, Johannes Pointner wrote:
> > > Hello,
> > >
> > > I'm new working on the linux device drivers, so if I made something wrong
> > > please point me into the right direction.
> > >
> > > I'd like to use the pwm_bl driver for a sitara based terminal and for
> > this
> > > I would need the possibility to set the backlight within a percentage
> > > range. The following patch should add this possibility to the pwm_bl
> > > driver. The idea is to keep backward compatibility by moving the required
> > > option brightness levels to optional. Therefore if there is no node with
> > > brightness levels the percentage levels are used.
> > >
> > > Signed-off-by: Johannes Pointner <johannes.pointner@gmail.com>
> > > ---
> > >  .../bindings/video/backlight/
> > > pwm-backlight.txt     | 11 +++---
> > >  drivers/video/backlight/pwm_bl.c                   | 46
> > > ++++++++++++----------
> > >  2 files changed, 31 insertions(+), 26 deletions(-)
> >
> > Also adding the backlight maintainers on Cc.
> >
> > This has been discussed a few times before. In fact the original device
> > tree binding had support for a continuous range of levels but that was
> > rejected during review. The reason was, as far as I remember, that the
> > number of levels and the corresponding duty cycle values is something
> > that's usually determined at system design time. Often backlights can't
> > properly light the whole surface of the panel at every level.
> >
> > That said, there's always the possibility to fake this by adding a DT
> > property with a continuous range, such as this:
> >
> >         brightness-levels = <0 1 2 ... 100>;
> >
> > Thierry
> >

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-06-27  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27  5:32 [PATCH] Added possibility to use pwm_bl.c with percentage instead of levels Johannes Pointner
2014-06-27  6:12 ` Thierry Reding
2014-06-27  6:58   ` Johannes Pointner
2014-06-27  7:09     ` Thierry Reding [this message]
2014-06-27  8:17       ` Johannes Pointner

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=20140627070902.GA10703@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=cooloney@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=johannes.pointner@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    /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