devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Flavio Suligoi <f.suligoi@asem.it>
To: Rob Herring <robh@kernel.org>
Cc: Lee Jones <lee@kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	Pavel Machek <pavel@ucw.cz>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v4 1/2] dt-bindings: backlight: Add MPS MP3309C
Date: Wed, 11 Oct 2023 15:13:20 +0000	[thread overview]
Message-ID: <AM8PR01MB8045F549C8A65A853E214D37F9CCA@AM8PR01MB8045.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <20231010161512.GA944015-robh@kernel.org>

Hi Rob,

just a question about led-backlight.yaml and pwm-backlight.yaml
common properties.

...

> > +
> > +  brightness-levels:
> > +    description:
> > +      Array of distinct brightness levels, in PWM dimming mode.
> > +      Typically these are in the range from 0 to 255, but any range starting
> > +      at 0 will do.
> > +      The 0 value 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
> 
> This already has a type defined. Please add it to backlight/common.yaml and
> remove from led-backlight.yaml and pwm-backlight.yaml.

As well as the brightness-levels property, also the default-brightness-level is in common
between led-backlight.yaml and pwm-backlight.yaml.
What do you think about removing it from both led-backlight.yaml and pwm-backlight.yaml, and
moving it into backlight/common.yaml?

> 
> You say 0-255 here, but your example is 0-10. One of those seems wrong.
> Anyways, don't define constraints in prose, use a schema:
> 
> items:
>   maximum: 10 (or 255?)
> 
> > +
> > +  default-brightness:
> > +    description:
> > +      The default brightness (index into the levels array).
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> Already has a type. You need to reference backlight/common.yaml.
> 
> > +
> > +  mps,overvoltage-protection-microvolt:
> > +    description: Overvoltage protection (13.5V, 24V or 35.5V).
> > +    enum: [ 13500000, 24000000, 35500000 ]
> > +    default: 35500000
> > +
> > +  mps,no-sync-mode:
> > +    description: disable synchronous rectification mode
> > +    type: boolean
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        /* Backlight with PWM control */
> > +        backlight_pwm: backlight@17 {
> > +            compatible = "mps,mp3309c";
> > +            reg = <0x17>;
> > +            pwms = <&pwm1 0 3333333 0>; /* 300 Hz --> (1/f) * 1*10^9 */
> > +            brightness-levels = <0 1 2 3 4 5 6 7 8 9 10>;
> > +            default-brightness = <8>;
> > +            mps,overvoltage-protection-microvolt = <24000000>;
> > +        };
> > +    };
> > --
> > 2.34.1
> >

Regards,
Flavio

      parent reply	other threads:[~2023-10-11 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 12:16 [PATCH v4 1/2] dt-bindings: backlight: Add MPS MP3309C Flavio Suligoi
2023-10-10 16:15 ` Rob Herring
2023-10-11 11:52   ` Flavio Suligoi
2023-10-11 15:13   ` Flavio Suligoi [this message]

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=AM8PR01MB8045F549C8A65A853E214D37F9CCA@AM8PR01MB8045.eurprd01.prod.exchangelabs.com \
    --to=f.suligoi@asem.it \
    --cc=conor+dt@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).