From 9a2920efeffc04953ce01489ef1a5669e8662232 Mon Sep 17 00:00:00 2001 From: Keith Short Date: Tue, 15 Dec 2020 15:13:10 -0700 Subject: zephyr: add PWM shim Adds PWM shim to connect the platform/ec PWM API to the Zephyr PWM API. BUG=b:174850923 BRANCH=none TEST=make buildall TEST=Run "pwmduty" command against Volteer LEDs Signed-off-by: Keith Short Change-Id: I49047734bc1a3fb3d4010f0040145171275c5657 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2623163 Reviewed-by: Jack Rosenthal --- .../volteer/boards/arm/volteer/volteer.dts | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'zephyr/projects/volteer/boards/arm') diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts index e35b59240c..59cc5f2cbc 100644 --- a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts +++ b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts @@ -57,6 +57,31 @@ }; }; + named-pwms { + compatible = "named-pwms"; + + led1_blue { + pwms = <&pwm2 0 PWM_POLARITY_INVERTED>; + label = "LED1_BLUE"; + frequency = <4800>; + }; + led2_green { + pwms = <&pwm0 0 PWM_POLARITY_INVERTED>; + label = "LED2_GREEN"; + frequency = <4800>; + }; + led3_red { + pwms = <&pwm1 0 PWM_POLARITY_INVERTED>; + label = "LED3_RED"; + frequency = <4800>; + }; + led3_sidesel { + pwms = <&pwm7 0 PWM_POLARITY_INVERTED>; + label = "LED4_SIDESEL"; + frequency = <2400>; + }; + }; + named-gpios { compatible = "named-gpios"; @@ -467,3 +492,23 @@ &cros_kb_raw { status = "okay"; }; + +/* Green LED */ +&pwm0 { + status = "okay"; +}; + +/* Red LED */ +&pwm1 { + status = "okay"; +}; + +/* Blue LED */ +&pwm2 { + status = "okay"; +}; + +/* Side selection LED */ +&pwm7 { + status = "okay"; +}; -- cgit v1.2.1