Skip to content

Commit d5272d3

Browse files
flavio-suligoilag-linaro
authored andcommitted
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 <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 40da473 commit d5272d3

File tree

3 files changed

+25
-31
lines changed

3 files changed

+25
-31
lines changed

Documentation/devicetree/bindings/leds/backlight/common.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,21 @@ properties:
3333
due to restrictions in a specific system, such as mounting conditions.
3434
$ref: /schemas/types.yaml#/definitions/uint32
3535

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+
3653
additionalProperties: true

Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ description:
1616
can also be used to describe a backlight device controlled by the output of
1717
a LED driver.
1818

19+
allOf:
20+
- $ref: common.yaml#
21+
1922
properties:
2023
compatible:
2124
const: led-backlight
@@ -26,25 +29,11 @@ properties:
2629
items:
2730
maxItems: 1
2831

29-
brightness-levels:
30-
description:
31-
Array of distinct brightness levels. The levels must be in the range
32-
accepted by the underlying LED devices. This is used to translate a
33-
backlight brightness level into a LED brightness level. If it is not
34-
provided, the identity mapping is used.
35-
$ref: /schemas/types.yaml#/definitions/uint32-array
36-
37-
default-brightness-level:
38-
description:
39-
The default brightness level (index into the array defined by the
40-
"brightness-levels" property).
41-
$ref: /schemas/types.yaml#/definitions/uint32
42-
4332
required:
4433
- compatible
4534
- leds
4635

47-
additionalProperties: false
36+
unevaluatedProperties: false
4837

4938
examples:
5039
- |

Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ maintainers:
1111
- Daniel Thompson <[email protected]>
1212
- Jingoo Han <[email protected]>
1313

14+
allOf:
15+
- $ref: common.yaml#
16+
1417
properties:
1518
compatible:
1619
const: pwm-backlight
@@ -39,21 +42,6 @@ properties:
3942
Delay in ms between disabling the backlight using GPIO and setting PWM
4043
value to 0.
4144

42-
brightness-levels:
43-
description:
44-
Array of distinct brightness levels. Typically these are in the range
45-
from 0 to 255, but any range starting at 0 will do. The actual brightness
46-
level (PWM duty cycle) will be interpolated from these values. 0 means a
47-
0% duty cycle (darkest/off), while the last value in the array represents
48-
a 100% duty cycle (brightest).
49-
$ref: /schemas/types.yaml#/definitions/uint32-array
50-
51-
default-brightness-level:
52-
description:
53-
The default brightness level (index into the array defined by the
54-
"brightness-levels" property).
55-
$ref: /schemas/types.yaml#/definitions/uint32
56-
5745
num-interpolated-steps:
5846
description:
5947
Number of interpolated steps between each value of brightness-levels
@@ -69,7 +57,7 @@ required:
6957
- compatible
7058
- pwms
7159

72-
additionalProperties: false
60+
unevaluatedProperties: false
7361

7462
examples:
7563
- |

0 commit comments

Comments
 (0)