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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68229e7f-4749-cde5-f541-793ab614084d@ti.com>
Date:   Tue, 2 Apr 2019 07:56:55 -0500
From:   Dan Murphy <dmurphy@...com>
To:     Brian Masney <masneyb@...tation.org>, <lee.jones@...aro.org>,
        <daniel.thompson@...aro.org>, <jingoohan1@...il.com>,
        <robh+dt@...nel.org>
CC:     <jacek.anaszewski@...il.com>, <pavel@....cz>,
        <mark.rutland@....com>, <b.zolnierkie@...sung.com>,
        <dri-devel@...ts.freedesktop.org>, <linux-leds@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-fbdev@...r.kernel.org>, <jonathan@...ek.ca>
Subject: Re: [PATCH v2 2/3] dt-bindings: backlight: add lm3630a bindings

Hello

On 4/1/19 5:30 AM, Brian Masney wrote:
> Add new backlight bindings for the TI LM3630A dual-string white LED.
> 
> Signed-off-by: Brian Masney <masneyb@...tation.org>
> ---
>  .../leds/backlight/lm3630a-backlight.yaml     | 112 ++++++++++++++++++
>  1 file changed, 112 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> new file mode 100644
> index 000000000000..42a8c59d237a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/backlight/lm3630a-backlight.yaml
> @@ -0,0 +1,112 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/backlight/lm3630a-backlight.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI LM3630A High-Efficiency Dual-String White LED
> +
> +maintainers:
> +  - Lee Jones <lee.jones@...aro.org>
> +  - Daniel Thompson <daniel.thompson@...aro.org>
> +  - Jingoo Han <jingoohan1@...il.com>
> +
> +description: |
> +  The LM3630A is a current-mode boost converter which supplies the power and
> +  controls the current in up to two strings of 10 LEDs per string.
> +  https://www.ti.com/product/LM3630A
> +
> +properties:
> +  compatible:
> +    const: ti,lm3630a
> +
> +  reg:
> +    maxItems: 1
> +

No description on the reg here.  Assumed to be the i2c address?

> +  ti,linear-mapping-mode:
> +    description: |
> +      Enable linear mapping mode. If disabled, then it will use exponential
> +      mapping mode in which the ramp up/down appears to have a more uniform
> +      tranisiton to the human eye.

s/tranisiton/transition

> +    type: boolean
> +
> +required:
> +  - compatible
> +  - reg
> +
> +patternProperties:
> +  "^led*$":
> +    type: object
> +    description: |
> +      Properties for a string of connected LEDs.
> +

I have written a few of these drivers that have control bank support to control.  We have
been defining the reg property as the control bank id

reg 0 - Control bank A
reg 1 - Control bank B

Then use the led-sources to define what outputs are associated with which control bank.

This way the hardware can just have CB B enabled without CB A.

something like below would allow just control bank B to be enabled.

led@1 {
	reg = <1>;
	label = "main-lcd";
	default-brightness = <200>;
	max-brightness = <255>;
};

This would connect control bank B to control bank A.  Or just use a flag to denote to connect them
and not use led-sources.  But led-sources is the property of choice.

led@0 {
	reg = <0>;
	led-sources = < 0 1 >;
	label = "main-lcd";
	default-brightness = <200>;
	max-brightness = <255>;
};

And just the presence of 2 child nodes would indicate individual bank control
led@0 {
	reg = <0>;
	label = "main-lcd";
	default-brightness = <200>;
	max-brightness = <255>;
};

led@1 {
	reg = <1>;
	label = "main-keypad";
	default-brightness = <200>;
	max-brightness = <255>;
};

> +    properties:
> +      label:
> +        description: |
> +          The label for this LED. If omitted, the label is taken from the node
> +          name (excluding the unit address). It has to uniquely identify a
> +          device, i.e. no other LED class device can be assigned the same label.
> +
> +      led-sources:
> +        description: |
> +          List of device current outputs the LED is connected to.
> +        allOf:
> +          - $ref: /schemas/types.yaml#/definitions/uint32-array
> +          - minItems: 1
> +            maxItems: 2
> +            items:
> +              minimum: 0
> +              maximum: 1
> +

label and led-sources are already defined in the common.txt no need to redefine them here.

> +      default-brightness:
> +        description: Default brightness level on boot.
> +        minimum: 0
> +        maximum: 255
> +
> +      max-brightness:
> +        description: Maximum brightness level on boot.

This is not the max brightness on boot.  This is the max brightness that is allowed during runtime.

Dan

> +        minimum: 0
> +        maximum: 255
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        lm3630a_bl@38 {
> +                compatible = "ti,lm3630a";
> +                status = "ok";
> +                reg = <0x38>;
> +
> +                led {
> +                        label = "main-lcd";
> +                        led-sources = <0 1>;
> +                        default-brightness = <200>;
> +                        max-brightness = <255>;
> +                };
> +        };
> +    };
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        lm3630a_bl@38 {
> +                compatible = "ti,lm3630a";
> +                status = "ok";
> +                reg = <0x38>;
> +
> +                led-bank-a {
> +                        led-sources = <0>;
> +                        default-brightness = <150>;
> +                        ti,linear-mapping-mode;
> +                };
> +
> +                led-bank-b {
> +                        led-sources = <1>;
> +                        default-brightness = <225>;
> +                        ti,linear-mapping-mode;
> +                };
> +        };
> +    };
> 


-- 
------------------
Dan Murphy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ