All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Rob Herring <robh@kernel.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
	devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema
Date: Mon, 29 Jun 2020 21:18:47 +0200	[thread overview]
Message-ID: <20200629191847.GA318506@ravnborg.org> (raw)
In-Reply-To: <CAL_JsqK1yJ09k6tKak==TjRN17VzueVkcf-WOLw2ETL2ZJv9sg@mail.gmail.com>

On Mon, Jun 29, 2020 at 11:57:37AM -0600, Rob Herring wrote:
> On Mon, Jun 22, 2020 at 10:57 AM Daniel Thompson
> <daniel.thompson@linaro.org> wrote:
> >
> > On Fri, Jun 19, 2020 at 11:53:41PM +0200, Sam Ravnborg wrote:
> > > > diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
> > > > new file mode 100644
> > > > index 000000000000..7e1f109a38a4
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
> > > > @@ -0,0 +1,98 @@
> > > > +# SPDX-License-Identifier: GPL-2.0-only
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: pwm-backlight bindings
> > > > +
> > > > +maintainers:
> > > > +  - Lee Jones <lee.jones@linaro.org>
> > > > +  - Daniel Thompson <daniel.thompson@linaro.org>
> > > > +  - Jingoo Han <jingoohan1@gmail.com>
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: pwm-backlight
> > > > +
> > > > +  pwms:
> > > > +    maxItems: 1
> > > > +
> > > > +  pwm-names: true
> > > > +
> > > > +  power-supply:
> > > > +    description: regulator for supply voltage
> > > > +
> > > > +  enable-gpios:
> > > > +    description: Contains a single GPIO specifier for the GPIO which enables
> > > > +      and disables the backlight
> > > > +    maxItems: 1
> > > > +
> > > > +  post-pwm-on-delay-ms:
> > > > +    description: Delay in ms between setting an initial (non-zero) PWM and
> > > > +      enabling the backlight using GPIO.
> > > > +
> > > > +  pwm-off-delay-ms:
> > > > +    description: Delay in ms between disabling the backlight using GPIO
> > > > +      and setting PWM value to 0.
> > > > +
> > > > +  brightness-levels:
> > > > +    description: Array of distinct brightness levels. Typically these are
> > > > +      in the range from 0 to 255, but any range starting at 0 will do. The
> > > > +      actual brightness level (PWM duty cycle) will be interpolated from
> > > > +      these values. 0 means a 0% duty cycle (darkest/off), while the last
> > > > +      value in the array represents a 100% duty cycle (brightest).
> > > > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > > > +
> > > > +  default-brightness-level:
> > > > +    description: The default brightness level (index into the array defined
> > > > +      by the "brightness-levels" property).
> > > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > Same comment as before...
> >
> > Sorry the "ditto" meant I didn't thing about PWM as much as I should
> > have.
> >
> > The situation for PWM is a little different to LED. That's mostly
> > because we decided not to clutter the LED code with
> > "num-interpolated-steps".
> >
> > The PWM code implements the default-brightness-level as an index into
> > the brightness array *after* it has been expanded using interpolation.
> > In other words today Linux treats the default-brightness-level more
> > like[1].
> >
> >     description: The default brightness level. When
> >       num-interpolated-steps is not set this is simply an index into
> >       the array defined by the "brightness-levels" property. If
> >       num-interpolated-steps is set the brightness array will be
> >       expanded by interpolation before we index to get a default
> >       level.
> >
> > This is the best I have come up with so far... but I concede it still
> > lacks elegance.
> 
> Happy to add this or whatever folks want if there's agreement, but I
> don't want to get bogged down on re-reviewing and re-writing the
> binding on what is just a conversion. There's a mountain of bindings
> to convert.
The original explanation is ok, as pointed out by Daniel.
So I suggest moving forward with that and then others can improve the
descriptions later as necessary.

	Sam

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema
Date: Mon, 29 Jun 2020 21:18:47 +0200	[thread overview]
Message-ID: <20200629191847.GA318506@ravnborg.org> (raw)
In-Reply-To: <CAL_JsqK1yJ09k6tKak==TjRN17VzueVkcf-WOLw2ETL2ZJv9sg@mail.gmail.com>

On Mon, Jun 29, 2020 at 11:57:37AM -0600, Rob Herring wrote:
> On Mon, Jun 22, 2020 at 10:57 AM Daniel Thompson
> <daniel.thompson@linaro.org> wrote:
> >
> > On Fri, Jun 19, 2020 at 11:53:41PM +0200, Sam Ravnborg wrote:
> > > > diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
> > > > new file mode 100644
> > > > index 000000000000..7e1f109a38a4
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
> > > > @@ -0,0 +1,98 @@
> > > > +# SPDX-License-Identifier: GPL-2.0-only
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: pwm-backlight bindings
> > > > +
> > > > +maintainers:
> > > > +  - Lee Jones <lee.jones@linaro.org>
> > > > +  - Daniel Thompson <daniel.thompson@linaro.org>
> > > > +  - Jingoo Han <jingoohan1@gmail.com>
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: pwm-backlight
> > > > +
> > > > +  pwms:
> > > > +    maxItems: 1
> > > > +
> > > > +  pwm-names: true
> > > > +
> > > > +  power-supply:
> > > > +    description: regulator for supply voltage
> > > > +
> > > > +  enable-gpios:
> > > > +    description: Contains a single GPIO specifier for the GPIO which enables
> > > > +      and disables the backlight
> > > > +    maxItems: 1
> > > > +
> > > > +  post-pwm-on-delay-ms:
> > > > +    description: Delay in ms between setting an initial (non-zero) PWM and
> > > > +      enabling the backlight using GPIO.
> > > > +
> > > > +  pwm-off-delay-ms:
> > > > +    description: Delay in ms between disabling the backlight using GPIO
> > > > +      and setting PWM value to 0.
> > > > +
> > > > +  brightness-levels:
> > > > +    description: Array of distinct brightness levels. Typically these are
> > > > +      in the range from 0 to 255, but any range starting at 0 will do. The
> > > > +      actual brightness level (PWM duty cycle) will be interpolated from
> > > > +      these values. 0 means a 0% duty cycle (darkest/off), while the last
> > > > +      value in the array represents a 100% duty cycle (brightest).
> > > > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > > > +
> > > > +  default-brightness-level:
> > > > +    description: The default brightness level (index into the array defined
> > > > +      by the "brightness-levels" property).
> > > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > Same comment as before...
> >
> > Sorry the "ditto" meant I didn't thing about PWM as much as I should
> > have.
> >
> > The situation for PWM is a little different to LED. That's mostly
> > because we decided not to clutter the LED code with
> > "num-interpolated-steps".
> >
> > The PWM code implements the default-brightness-level as an index into
> > the brightness array *after* it has been expanded using interpolation.
> > In other words today Linux treats the default-brightness-level more
> > like[1].
> >
> >     description: The default brightness level. When
> >       num-interpolated-steps is not set this is simply an index into
> >       the array defined by the "brightness-levels" property. If
> >       num-interpolated-steps is set the brightness array will be
> >       expanded by interpolation before we index to get a default
> >       level.
> >
> > This is the best I have come up with so far... but I concede it still
> > lacks elegance.
> 
> Happy to add this or whatever folks want if there's agreement, but I
> don't want to get bogged down on re-reviewing and re-writing the
> binding on what is just a conversion. There's a mountain of bindings
> to convert.
The original explanation is ok, as pointed out by Daniel.
So I suggest moving forward with that and then others can improve the
descriptions later as necessary.

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-06-29 20:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 22:44 [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema Rob Herring
2020-06-18 22:44 ` Rob Herring
2020-06-19 21:53 ` Sam Ravnborg
2020-06-19 21:53   ` Sam Ravnborg
2020-06-22 10:39   ` Daniel Thompson
2020-06-22 10:39     ` Daniel Thompson
2020-06-22 16:57   ` Daniel Thompson
2020-06-22 16:57     ` Daniel Thompson
2020-06-29 17:57     ` Rob Herring
2020-06-29 17:57       ` Rob Herring
2020-06-29 19:18       ` Sam Ravnborg [this message]
2020-06-29 19:18         ` Sam Ravnborg
2020-06-30 16:35         ` Daniel Thompson
2020-06-30 16:35           ` Daniel Thompson
2020-06-29 19:37   ` Rob Herring
2020-06-29 19:37     ` Rob Herring
2020-06-22 14:22 ` Daniel Thompson
2020-06-22 14:22   ` Daniel Thompson

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=20200629191847.GA318506@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.