summaryrefslogtreecommitdiff
path: root/zephyr/program/skyrim/frostflow/led_policy.dtsi
blob: 901d4f43723a076320543865dd305d9006077e8d (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/ {
	led-colors {
		compatible = "cros-ec,led-policy";

		power-state-charge {
			charge-state = "PWR_STATE_CHARGE";
			/*
			 * The EC modifies the raw battery level to a 'Display'
			 * level that is then sent to the AP.
			 * The battery percentages that the LED driver uses for
			 * comparison is the raw level, but the Display values
			 * are the ones used to determine the LED thresholds.
			 * The Display values map to raw values as:
			 * Display	Raw
			 * 10%		13%
			 * 11%		14%
			 * 94%		91%
			 * 95%		92%
			 */
			/* Battery display percent range (>= Empty, <= 94%) */
			batt-lvl = <0 91>;

			color-0 {
				led-color = <&color_amber>;
			};
		};

		power-state-charge-lvl-2 {
			charge-state = "PWR_STATE_CHARGE";
			/*
			 * Battery display percent range
			 * (>= 95%, <= Near Full)
			 */
			batt-lvl = <92 97>;

			color-0 {
				led-color = <&color_white>;
			};
		};

		power-state-near-full {
			charge-state = "PWR_STATE_CHARGE_NEAR_FULL";

			color-0 {
				led-color = <&color_white>;
			};
		};

		power-state-discharge-s0 {
			charge-state = "PWR_STATE_DISCHARGE";
			chipset-state = "POWER_S0";
			/* Battery display percent range (>= 11%, <= Full) */
			batt-lvl = <14 100>;

			color-0 {
				led-color = <&color_white>;
			};
		};

		power-state-discharge-s0-batt-low {
			charge-state = "PWR_STATE_DISCHARGE";
			chipset-state = "POWER_S0";
			/* Battery display percent range (>= Empty, <= 10%) */
			batt-lvl = <0 13>;

			/* Amber 1 sec, off 3 sec */
			color-0 {
				led-color = <&color_amber>;
				period-ms = <1000>;
			};
			color-1 {
				led-color = <&color_off>;
				period-ms = <3000>;
			};
		};

		power-state-discharge-s3 {
			charge-state = "PWR_STATE_DISCHARGE";
			chipset-state = "POWER_S3";

			/* White 1 sec, off 3 sec */
			color-0 {
				led-color = <&color_white>;
				period-ms = <1000>;
			};
			color-1 {
				led-color = <&color_off>;
				period-ms = <3000>;
			};
		};

		power-state-discharge-s5 {
			charge-state = "PWR_STATE_DISCHARGE";
			chipset-state = "POWER_S5";

			color-0 {
				led-color = <&color_off>;
			};
		};

		power-state-error-s0 {
			charge-state = "PWR_STATE_ERROR";
			chipset-state = "POWER_S0";
			/* Amber 1 sec, off 1 sec */
			color-0 {
				led-color = <&color_amber>;
				period-ms = <1000>;
			};
			color-1 {
				led-color = <&color_off>;
				period-ms = <1000>;
			};
		};

		power-state-error-s3 {
			charge-state = "PWR_STATE_ERROR";
			chipset-state = "POWER_S3";
			/* White 1 sec, off 3 sec */
			color-0 {
				led-color = <&color_white>;
				period-ms = <1000>;
			};
			color-1 {
				led-color = <&color_off>;
				period-ms = <3000>;
			};
		};

		power-state-error-s5 {
			charge-state = "PWR_STATE_ERROR";
			chipset-state = "POWER_S5";

			color-0 {
				led-color = <&color_off>;
			};
		};

		power-state-forced-idle {
			charge-state = "PWR_STATE_FORCED_IDLE";

			/* Amber 2 sec, White 2 sec */
			color-0 {
				led-color = <&color_amber>;
				period-ms = <2000>;
			};
			color-1 {
				led-color = <&color_white>;
				period-ms = <2000>;
			};
		};
	};
};