summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml
blob: 1db1a027d8f475429723c651016f0622eaa85e89 (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
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

description: PWM LED pins parent node

compatible: "cros-ec,pwm-led-pins"

child-binding:
  description: |
    Each child node describes all the PWM pins that need to be altered to set
    the color of a specific LED.
    e.g. For a battery LED, a node looks like this.
    battery_led: battery-led {
                 led-id = "EC_LED_ID_BATTERY_LED";
                 led-pwms = <&pwm_led_y &pwm_led_b>;
                };
  properties:
    led-id:
      type: string
      required: true
      description: |
        This property is required by the EC_CMD_LED_CONTROL host command.
        It must match the enum names defined in ec_commands.h.
      enum:
        - EC_LED_ID_BATTERY_LED
        - EC_LED_ID_POWER_LED
        - EC_LED_ID_ADAPTER_LED
        - EC_LED_ID_LEFT_LED
        - EC_LED_ID_RIGHT_LED
        - EC_LED_ID_RECOVERY_HW_REINIT_LED
        - EC_LED_ID_SYSRQ_DEBUG_LED
    led-pwms:
      type: phandles
      required: true
      description: |
        This property is used to specify an array of pwms to set a
        particular color.

  child-binding:
    description: |
      Each grandchild node describes all the colors supported by the child LED.
      e.g. For blue and amber PWM channels, in order to set color amber, a node
      looks like this where 100 is PWM duty cycle in percentage.
      color-amber {
                   led-color = "LED_AMBER";
                   led-values = <100 0>;
                  };
    properties:
      led-color:
        type: string
        required: true
        description: |
          This property is used to identify pin nodes based on color enum.
          It is required by the EC_CMD_LED_CONTROL host command.
        enum:
          - LED_OFF
          - LED_RED
          - LED_GREEN
          - LED_BLUE
          - LED_YELLOW
          - LED_WHITE
          - LED_AMBER
      br-color:
        type: string
        required: false
        description: |
          This is used in the ectool brightness range APIs. It must match
          the enum names defined in ec_commands.h.
        enum:
          - EC_LED_COLOR_RED
          - EC_LED_COLOR_GREEN
          - EC_LED_COLOR_BLUE
          - EC_LED_COLOR_YELLOW
          - EC_LED_COLOR_WHITE
          - EC_LED_COLOR_AMBER
      led-values:
        type: array
        required: true
        description: |
          This property is used to specify an array of values to set on the
          corresponding pwm-pins to set a particular color.