Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: backlight: Add brightness-levels related common properties

Both files pwm-backlight.yaml and led-backlight.yaml contain properties
in common with each other, regarding the brightness levels:

- brightness-levels
- default-brightness-level

These properties can then be moved to backlight/common.yaml.

Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231016150554.27144-1-f.suligoi@asem.it
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Flavio Suligoi and committed by
Lee Jones
d5272d39 40da4737

+25 -31
+17
Documentation/devicetree/bindings/leds/backlight/common.yaml
··· 33 33 due to restrictions in a specific system, such as mounting conditions. 34 34 $ref: /schemas/types.yaml#/definitions/uint32 35 35 36 + brightness-levels: 37 + description: 38 + Array of distinct brightness levels. The levels must be in the range 39 + accepted by the underlying LED device. Typically these are in the range 40 + from 0 to 255, but any range starting at 0 will do, as long as they are 41 + accepted by the LED. 42 + The 0 value means a 0% of brightness (darkest/off), while the last value 43 + in the array represents a full 100% brightness (brightest). 44 + If this array is not provided, the driver default mapping is used. 45 + $ref: /schemas/types.yaml#/definitions/uint32-array 46 + 47 + default-brightness-level: 48 + description: 49 + The default brightness level (index into the array defined by the 50 + "brightness-levels" property). 51 + $ref: /schemas/types.yaml#/definitions/uint32 52 + 36 53 additionalProperties: true
+4 -15
Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml
··· 16 16 can also be used to describe a backlight device controlled by the output of 17 17 a LED driver. 18 18 19 + allOf: 20 + - $ref: common.yaml# 21 + 19 22 properties: 20 23 compatible: 21 24 const: led-backlight ··· 29 26 items: 30 27 maxItems: 1 31 28 32 - brightness-levels: 33 - description: 34 - Array of distinct brightness levels. The levels must be in the range 35 - accepted by the underlying LED devices. This is used to translate a 36 - backlight brightness level into a LED brightness level. If it is not 37 - provided, the identity mapping is used. 38 - $ref: /schemas/types.yaml#/definitions/uint32-array 39 - 40 - default-brightness-level: 41 - description: 42 - The default brightness level (index into the array defined by the 43 - "brightness-levels" property). 44 - $ref: /schemas/types.yaml#/definitions/uint32 45 - 46 29 required: 47 30 - compatible 48 31 - leds 49 32 50 - additionalProperties: false 33 + unevaluatedProperties: false 51 34 52 35 examples: 53 36 - |
+4 -16
Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
··· 11 11 - Daniel Thompson <daniel.thompson@linaro.org> 12 12 - Jingoo Han <jingoohan1@gmail.com> 13 13 14 + allOf: 15 + - $ref: common.yaml# 16 + 14 17 properties: 15 18 compatible: 16 19 const: pwm-backlight ··· 42 39 Delay in ms between disabling the backlight using GPIO and setting PWM 43 40 value to 0. 44 41 45 - brightness-levels: 46 - description: 47 - Array of distinct brightness levels. Typically these are in the range 48 - from 0 to 255, but any range starting at 0 will do. The actual brightness 49 - level (PWM duty cycle) will be interpolated from these values. 0 means a 50 - 0% duty cycle (darkest/off), while the last value in the array represents 51 - a 100% duty cycle (brightest). 52 - $ref: /schemas/types.yaml#/definitions/uint32-array 53 - 54 - default-brightness-level: 55 - description: 56 - The default brightness level (index into the array defined by the 57 - "brightness-levels" property). 58 - $ref: /schemas/types.yaml#/definitions/uint32 59 - 60 42 num-interpolated-steps: 61 43 description: 62 44 Number of interpolated steps between each value of brightness-levels ··· 57 69 - compatible 58 70 - pwms 59 71 60 - additionalProperties: false 72 + unevaluatedProperties: false 61 73 62 74 examples: 63 75 - |