summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-10-26 16:40:54 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-29 19:03:26 +0000
commitda8a1e7d22f99698581c32ea08a6c3d0ffab6c57 (patch)
tree95b3f753e7b68b22d260b4c9054d8ce59babae33
parent4a7dc909701766084690d6e1a6dc25d1627ace13 (diff)
downloadchrome-ec-da8a1e7d22f99698581c32ea08a6c3d0ffab6c57.tar.gz
zephyr: shim: set PWM displight channel from the device tree
This drops the PWM_CH_DISPLIGHT define from the individual board pwm_map, and replaces with a single reference to a named pwm labeled displight. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I17ca620097a4b0fd6907672e340415d1963740a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3245507 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/Kconfig6
-rw-r--r--zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts2
-rw-r--r--zephyr/boards/arm/trogdor/trogdor.dts2
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h2
-rw-r--r--zephyr/projects/trogdor/lazor/include/pwm_map.h2
-rw-r--r--zephyr/projects/trogdor/trogdor/include/pwm_map.h2
-rw-r--r--zephyr/shim/include/config_chip.h1
7 files changed, 6 insertions, 11 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 07f09ae46e..8647c1bfac 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -630,9 +630,9 @@ config PLATFORM_EC_PWM_DISPLIGHT
depends on PLATFORM_EC_PWM
help
Enables display backlight controlled by a PWM signal connected
- directly to the EC chipset. The board files must define the C
- reference PWM_CH_DISPLIGHT to the PWM channel used for the
- display backlight control.
+ directly to the EC chipset. The board devicetree file must define the
+ PWM channel used for the display backlight control and assign the
+ "displight" node label to it.
config PLATFORM_EC_RTC
bool "Real-time clock (RTC)"
diff --git a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
index a3d3767063..cdf998c13f 100644
--- a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
+++ b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
@@ -55,7 +55,7 @@
label = "KBLIGHT";
frequency = <10000>;
};
- displight {
+ displight: displight {
pwms = <&pwm5 0 0>;
label = "DISPLIGHT";
frequency = <4800>;
diff --git a/zephyr/boards/arm/trogdor/trogdor.dts b/zephyr/boards/arm/trogdor/trogdor.dts
index 29381bf7ce..a13861ad09 100644
--- a/zephyr/boards/arm/trogdor/trogdor.dts
+++ b/zephyr/boards/arm/trogdor/trogdor.dts
@@ -116,7 +116,7 @@
label = "KBLIGHT";
frequency = <10000>;
};
- displight {
+ displight: displight {
pwms = <&pwm5 0 0>;
label = "DISPLIGHT";
frequency = <4800>;
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h b/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
index a3e5c81010..fa2cd1b651 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
+++ b/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
@@ -10,6 +10,4 @@
#include "pwm/pwm.h"
-#define PWM_CH_DISPLIGHT NAMED_PWM(displight)
-
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/trogdor/lazor/include/pwm_map.h b/zephyr/projects/trogdor/lazor/include/pwm_map.h
index a3e5c81010..fa2cd1b651 100644
--- a/zephyr/projects/trogdor/lazor/include/pwm_map.h
+++ b/zephyr/projects/trogdor/lazor/include/pwm_map.h
@@ -10,6 +10,4 @@
#include "pwm/pwm.h"
-#define PWM_CH_DISPLIGHT NAMED_PWM(displight)
-
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/trogdor/trogdor/include/pwm_map.h b/zephyr/projects/trogdor/trogdor/include/pwm_map.h
index a3e5c81010..fa2cd1b651 100644
--- a/zephyr/projects/trogdor/trogdor/include/pwm_map.h
+++ b/zephyr/projects/trogdor/trogdor/include/pwm_map.h
@@ -10,6 +10,4 @@
#include "pwm/pwm.h"
-#define PWM_CH_DISPLIGHT NAMED_PWM(displight)
-
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 74821e55bf..279b255712 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -581,6 +581,7 @@
#undef CONFIG_PWM_DISPLIGHT
#ifdef CONFIG_PLATFORM_EC_PWM_DISPLIGHT
#define CONFIG_PWM_DISPLIGHT
+#define PWM_CH_DISPLIGHT PWM_CHANNEL(DT_NODELABEL(displight))
#endif
#undef CONFIG_CPU_PROCHOT_ACTIVE_LOW