lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DU2PR01MB803498DFD93E82DD3947D72DF9D8A@DU2PR01MB8034.eurprd01.prod.exchangelabs.com>
Date:   Mon, 23 Oct 2023 09:28:03 +0000
From:   Flavio Suligoi <f.suligoi@...m.it>
To:     Conor Dooley <conor@...nel.org>
CC:     Lee Jones <lee@...nel.org>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        Jingoo Han <jingoohan1@...il.com>,
        Helge Deller <deller@....de>, Pavel Machek <pavel@....cz>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/1] dt-bindings: backlight: mp3309c: remove two required
 properties

Hi Conor,

...

> On Fri, Oct 20, 2023 at 03:54:33PM +0200, Flavio Suligoi wrote:
> > The two properties:
> >
> > - max-brightness
> > - default brightness
> >
> > are not really required, so they can be removed from the "required"
> > section.
> 
> Why are they not required? You need to provide an explanation.

The "max-brightness" is not more used now in the driver (I used it in the first version
of the driver).
The "default-brightness", if omitted in the DT, is managed by the device driver,
using a default value. This depends on the dimming mode used:

- for the "analog mode", via I2C commands, this value is fixed by hardware (=31)
- while in case of pwm mode the default used is the last value of the 
  brightness-levels array.

Also the brightness-levels array is not required; if it is omitted, the driver uses 
a default array of 0..255 and the "default-brightness" is the last one, which is "255".

> > Other changes:
> >
> > - improve the backlight working mode description, in the "description"
> >   section
> 
> > - update the example, removing the "max-brightness" and introducing the
> >   "brightess-levels" property
> 
> Why is this more useful?

I introduced the "brightness-levels" instead of "max-brightness" for homogeneity,
since the "analog mode" dimming has a brightness-levels array fixed by hardware (0..31).
In this way also the "pwm" mode can use the same concepts of array of levels.

> 
> Cheers,
> Conor.

Thanks for your help.
Flavio.

> 
> >
> > Signed-off-by: Flavio Suligoi <f.suligoi@...m.it>
> > ---
> >  .../bindings/leds/backlight/mps,mp3309c.yaml           | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git
> a/Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
> b/Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
> > index 4191e33626f5..527a37368ed7 100644
> > ---
> a/Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
> > +++
> b/Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
> > @@ -14,8 +14,8 @@ description: |
> >    programmable switching frequency to optimize efficiency.
> >    It supports two different dimming modes:
> >
> > -  - analog mode, via I2C commands (default)
> > -  - PWM controlled mode.
> > +  - analog mode, via I2C commands, as default mode (32 dimming levels)
> > +  - PWM controlled mode (optional)
> >
> >    The datasheet is available at:
> >    https://www.monolithicpower.com/en/mp3309c.html
> > @@ -50,8 +50,6 @@ properties:
> >  required:
> >    - compatible
> >    - reg
> > -  - max-brightness
> > -  - default-brightness
> >
> >  unevaluatedProperties: false
> >
> > @@ -66,8 +64,8 @@ examples:
> >              compatible = "mps,mp3309c";
> >              reg = <0x17>;
> >              pwms = <&pwm1 0 3333333 0>; /* 300 Hz --> (1/f) * 1*10^9 */
> > -            max-brightness = <100>;
> > -            default-brightness = <80>;
> > +            brightness-levels = <0 4 8 16 32 64 128 255>;
> > +            default-brightness = <6>;
> >              mps,overvoltage-protection-microvolt = <24000000>;
> >          };
> >      };
> > --
> > 2.34.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ