summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings/leds/cros-ec,led-colors.yaml
blob: f99804cb9412bcb209ea4ae87a8c3da810acd9f3 (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
# 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: LED colors parent node

compatible: "cros-ec,led-colors"

child-binding:
    description: LED Color nodes to describe the policy combination a node
                 depends on, and the color to set to for that combination.
                 e.g. If Blue color needs to be set for charge state discharge
                 in S0, a node looks like
                 power-state-discharge-s0 {
                    charge-state = "PWR_STATE_DISCHARGE";
                    chipset-state = "POWER_S0";
                    color-0 {
                      led-color = "LED_BLUE";
                    };
                 };

    properties:
        charge-state:
            description: If the LED color depends on charge state, this
                         property is used to describe it.
            type: string
            required: false
            enum:
                - PWR_STATE_CHARGE
                - PWR_STATE_DISCHARGE
                - PWR_STATE_ERROR
                - PWR_STATE_IDLE
                - PWR_STATE_CHARGE_NEAR_FULL

        charge-port:
            description: If the LED color depends on the charging port (left or right)
            type: int
            required: false

        chipset-state:
            description: If the LED color depends on chipset state, this
                         property is used to describe it.
            type: string
            required: false
            enum:
                - POWER_S0
                - POWER_S3
                - POWER_S5

        extra-flag:
            description: If the LED color depends on additional factors
            type: string
            required: false
            enum:
                - NONE
                - LED_CHFLAG_FORCE_IDLE
                - LED_CHFLAG_DEFAULT
                - LED_BATT_BELOW_10_PCT
                - LED_BATT_ABOVE_10_PCT

    child-binding:
        description: Color enum
        properties:
            led-color:
                type: string
                required: true
                enum:
                    - LED_OFF
                    - LED_RED
                    - LED_GREEN
                    - LED_BLUE
                    - LED_YELLOW
                    - LED_WHITE
                    - LED_AMBER
            led-id:
                description: Used to link the color nodes with the pin nodes in
                             case of multiple LEDs.
                type: string
                required: true
                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
            period-ms:
                description: In case of blinking LEDs, amount of time in msecs
                             the LED color is active. This value must be a
                             multiple of HOOK_TICK_INTERVAL_MS
                             e.g.
                             power-state-error {
                                charge-state = "PWR_STATE_ERROR";
                                /* One sec Amber, one sec Off */
                                color-0 {
                                  led-color = "LED_AMBER";
                                  period-ms = <1000>;
                                };
                                color-1 {
                                  led-color = "LED_OFF";
                                  period-ms = <1000>;
                                };
                             };
                type: int
                required: false