summaryrefslogtreecommitdiff
path: root/zephyr/program/nissa/gothrax/pwm_leds.dtsi
blob: aa4a76b271b902d6bc265fd40ae594c30b27b0d1 (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
/* 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.
 */

/ {
	pwmleds {
		compatible = "pwm-leds";
		pwm_led0: pwm_led_0 {
			pwms = <&pwm1 1 PWM_HZ(1296) PWM_POLARITY_INVERTED>,
			       <&pwm2 2 PWM_HZ(1296) PWM_POLARITY_INVERTED>,
			       <&pwm3 3 PWM_HZ(1296) PWM_POLARITY_INVERTED>;
		};
	};

	cros-pwmleds {
		compatible = "cros-ec,pwm-leds";

		leds = <&pwm_led0>;

				/*<red green blue>*/
		color-map-red    = <100   0    0>;
		color-map-green  = <  0 100    0>;
		color-map-blue   = <  0   0  100>;
		color-map-yellow = <  0  50   50>;
		color-map-white  = <100 100  100>;
		color-map-amber  = <100  15    0>;

		brightness-range = <100 100 100 0 0 0>;

		#address-cells = <1>;
		#size-cells = <0>;

		pwm_led_0@0 {
			reg = <0>;
			ec-led-name = "EC_LED_ID_BATTERY_LED";
		};
	};
};

&pwm1 {
	status = "okay";
	prescaler-cx = <PWM_PRESCALER_C4>;
	pinctrl-0 = <&pwm1_gpa1_default>;
	pinctrl-names = "default";
};

&pwm2 {
	status = "okay";
	prescaler-cx = <PWM_PRESCALER_C4>;
	pinctrl-0 = <&pwm2_gpa2_default>;
	pinctrl-names = "default";
};

&pwm3 {
	status = "okay";
	prescaler-cx = <PWM_PRESCALER_C4>;
	pinctrl-0 = <&pwm3_gpa3_default>;
	pinctrl-names = "default";
};