summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml
blob: f854f84d506e04d96ecd28875e52c924abcae5c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

description: PWM LED configuration

compatible: "cros-ec,pwm-leds"

include: base.yaml

properties:
  leds:
    type: phandles
    required: true
    description: |
      List of pwm-leds nodes. These are expected to have a pwms property
      pointing to the relevant PWMs, up to three PWM devices. The order is
      matched against the array order of the color-map- properties.

      For example
        pwmleds {
                compatible = "pwm-leds";
                pwm_led0: pwm_led_0 {
                        pwms = <&pwm1 0 PWM_HZ(4800) PWM_POLARITY_INVERTED
                                &pwm0 0 PWM_HZ(4800) PWM_POLARITY_INVERTED
                                &pwm2 0 PWM_HZ(4800) PWM_POLARITY_INVERTED>;
                };
        };
        cros-pwmleds {
                compatible = "cros-ec,pwm-leds";
                leds = <&pwm_led0>;
        };

  sidesel:
    type: phandle
    required: false
    description: |
      A pwm-leds node for the SIDESEL line, if present.

      For example
        pwmleds {
                compatible = "pwm-leds";
                pwm_sidesel: pwm_sidesel {
                        pwms = <&pwm7 0 PWM_HZ(4800) PWM_POLARITY_INVERTED>;
                };
        };
        cros-pwmleds {
                compatible = "cros-ec,pwm-leds";
                sidesel = <&pwm_sidesel>;
        };

  frequency:
    type: int
    required: true
    description: |
      PWM frequency in Hz for LEDs. SIDESEL, if present, uses half the
      frequency.

  color-map-red:
    type: array
    required: false
    description: |
      A map of PWM duty cycles per color, up to three channels. Unset values
      default to zero.

      For example
        color-map-red    = <100   0   0>;
        color-map-green  = <  0 100   0>;
        color-map-blue   = <  0   0 100>;
        color-map-yellow = <100  70   0>;
        color-map-white  = <100  70 100>;
        color-map-amber  = <100  20   0>;

  color-map-green:
    type: array
    required: false

  color-map-blue:
    type: array
    required: false

  color-map-yellow:
    type: array
    required: false

  color-map-white:
    type: array
    required: false

  color-map-amber:
    type: array
    required: false

  brightness-range:
    type: array
    required: false
    description: |
      A list of brigthness range value for all supported channels in order,
      Red, Green, Blue, Yellow, White, Amber (0 to 255).

child-binding:
  description: |
    LED child binding node for mapping a PWM_LED to a EC_LED_ID.

    For example

    pwm_led_0@0 {
                reg = <0>;
                ec-led-name = "EC_LED_ID_LEFT_LED";
    };
    pwm_led_1@1 {
                reg = <1>;
                ec-led-name = "EC_LED_ID_RIGHT_LED";
    };

  properties:
    reg:
      type: int
      required: true
      description: LED ID, can be either 0 or 1 for PWM_LED0 and PWM_LED1
      enum:
        - 0 # PWM_LED0
        - 1 # PWM_LED1

    ec-led-name:
      type: string
      required: true
      description: The EC_LED_ID value to map the LED to.