summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-10-26 16:17:28 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-29 19:03:25 +0000
commit4a7dc909701766084690d6e1a6dc25d1627ace13 (patch)
treecd625aa6a4bc45f1eb6a0039228cc804866db594
parent9efd16f5e704fd5478331b79ba42d970b18d749b (diff)
downloadchrome-ec-4a7dc909701766084690d6e1a6dc25d1627ace13.tar.gz
zephyr: shim: set PWM kblight channel from the device tree
This drops the PWM_CH_KBLIGHT define from the individual board pwm_map, and replaces with a single reference to a named pwm labeled kblight. BRANCH=none BUG=b:177452529 TEST=zmake testall TEST=build and run volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ie474267b8f5d16cad7b8db2d202a5e971e417c1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3245506 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/Kconfig.keyboard6
-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.h1
-rw-r--r--zephyr/projects/npcx_evb/npcx7/include/pwm_map.h2
-rw-r--r--zephyr/projects/npcx_evb/npcx7/pwm.dts2
-rw-r--r--zephyr/projects/npcx_evb/npcx9/include/pwm_map.h2
-rw-r--r--zephyr/projects/npcx_evb/npcx9/pwm.dts2
-rw-r--r--zephyr/projects/trogdor/lazor/include/pwm_map.h1
-rw-r--r--zephyr/projects/trogdor/trogdor/include/pwm_map.h1
-rw-r--r--zephyr/projects/volteer/volteer/include/pwm_map.h7
-rw-r--r--zephyr/projects/volteer/volteer/pwm.dts2
-rw-r--r--zephyr/shim/include/config_chip.h1
13 files changed, 9 insertions, 22 deletions
diff --git a/zephyr/Kconfig.keyboard b/zephyr/Kconfig.keyboard
index 9ad7fb8316..f95fa43643 100644
--- a/zephyr/Kconfig.keyboard
+++ b/zephyr/Kconfig.keyboard
@@ -168,9 +168,9 @@ config PLATFORM_EC_PWM_KBLIGHT
depends on PLATFORM_EC_PWM
help
Enables a PWM-controlled keyboard backlight controlled by a PWM signal
- connected directly to the EC chipset. The board files must define
- the C reference PWM_CH_KBLIGHT to the PWM channel used for the
- keyboard backlight control.
+ connected directly to the EC chipset. The board devicetree file must
+ define the PWM channel used for the keyboard backlight control and
+ assign the "kblight" node label to it.
endchoice # Keyboard backlight
diff --git a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
index 34884a8275..a3d3767063 100644
--- a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
+++ b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
@@ -50,7 +50,7 @@
named-pwms {
compatible = "named-pwms";
- kblight {
+ kblight: kblight {
pwms = <&pwm3 0 0>;
label = "KBLIGHT";
frequency = <10000>;
diff --git a/zephyr/boards/arm/trogdor/trogdor.dts b/zephyr/boards/arm/trogdor/trogdor.dts
index 24fb584ae1..29381bf7ce 100644
--- a/zephyr/boards/arm/trogdor/trogdor.dts
+++ b/zephyr/boards/arm/trogdor/trogdor.dts
@@ -111,7 +111,7 @@
named-pwms {
compatible = "named-pwms";
- kblight {
+ kblight: kblight {
pwms = <&pwm3 0 0>;
label = "KBLIGHT";
frequency = <10000>;
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h b/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
index e704b6d6d3..a3e5c81010 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
+++ b/zephyr/projects/herobrine/herobrine_npcx9/include/pwm_map.h
@@ -10,7 +10,6 @@
#include "pwm/pwm.h"
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
#define PWM_CH_DISPLIGHT NAMED_PWM(displight)
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/npcx_evb/npcx7/include/pwm_map.h b/zephyr/projects/npcx_evb/npcx7/include/pwm_map.h
index 62bf822099..fa2cd1b651 100644
--- a/zephyr/projects/npcx_evb/npcx7/include/pwm_map.h
+++ b/zephyr/projects/npcx_evb/npcx7/include/pwm_map.h
@@ -10,6 +10,4 @@
#include "pwm/pwm.h"
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
-
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/npcx_evb/npcx7/pwm.dts b/zephyr/projects/npcx_evb/npcx7/pwm.dts
index 144b4d96b9..73312f684c 100644
--- a/zephyr/projects/npcx_evb/npcx7/pwm.dts
+++ b/zephyr/projects/npcx_evb/npcx7/pwm.dts
@@ -12,7 +12,7 @@
label = "FAN";
frequency = <25000>;
};
- kblight {
+ kblight: kblight {
pwms = <&pwm2 0 0>;
label = "KBLIGHT";
frequency = <10000>;
diff --git a/zephyr/projects/npcx_evb/npcx9/include/pwm_map.h b/zephyr/projects/npcx_evb/npcx9/include/pwm_map.h
index 62bf822099..fa2cd1b651 100644
--- a/zephyr/projects/npcx_evb/npcx9/include/pwm_map.h
+++ b/zephyr/projects/npcx_evb/npcx9/include/pwm_map.h
@@ -10,6 +10,4 @@
#include "pwm/pwm.h"
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
-
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/npcx_evb/npcx9/pwm.dts b/zephyr/projects/npcx_evb/npcx9/pwm.dts
index 144b4d96b9..73312f684c 100644
--- a/zephyr/projects/npcx_evb/npcx9/pwm.dts
+++ b/zephyr/projects/npcx_evb/npcx9/pwm.dts
@@ -12,7 +12,7 @@
label = "FAN";
frequency = <25000>;
};
- kblight {
+ kblight: kblight {
pwms = <&pwm2 0 0>;
label = "KBLIGHT";
frequency = <10000>;
diff --git a/zephyr/projects/trogdor/lazor/include/pwm_map.h b/zephyr/projects/trogdor/lazor/include/pwm_map.h
index e704b6d6d3..a3e5c81010 100644
--- a/zephyr/projects/trogdor/lazor/include/pwm_map.h
+++ b/zephyr/projects/trogdor/lazor/include/pwm_map.h
@@ -10,7 +10,6 @@
#include "pwm/pwm.h"
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
#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 e704b6d6d3..a3e5c81010 100644
--- a/zephyr/projects/trogdor/trogdor/include/pwm_map.h
+++ b/zephyr/projects/trogdor/trogdor/include/pwm_map.h
@@ -10,7 +10,6 @@
#include "pwm/pwm.h"
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
#define PWM_CH_DISPLIGHT NAMED_PWM(displight)
#endif /* __ZEPHYR_PWM_MAP_H */
diff --git a/zephyr/projects/volteer/volteer/include/pwm_map.h b/zephyr/projects/volteer/volteer/include/pwm_map.h
index 144a4e5710..5cf7377f52 100644
--- a/zephyr/projects/volteer/volteer/include/pwm_map.h
+++ b/zephyr/projects/volteer/volteer/include/pwm_map.h
@@ -12,11 +12,4 @@
#include "pwm/pwm.h"
-/*
- * TODO(b/177452529): eliminate the dependency on enum pwm_channel
- * and configure this information directly from the device tree.
- */
-
-#define PWM_CH_KBLIGHT NAMED_PWM(kblight)
-
#endif /* __ZEPHYR_CHROME_PWM_MAP_H */
diff --git a/zephyr/projects/volteer/volteer/pwm.dts b/zephyr/projects/volteer/volteer/pwm.dts
index f8a0fef7df..ec581f2caf 100644
--- a/zephyr/projects/volteer/volteer/pwm.dts
+++ b/zephyr/projects/volteer/volteer/pwm.dts
@@ -31,7 +31,7 @@
label = "LED4_SIDESEL";
frequency = <2400>;
};
- kblight {
+ kblight: kblight {
pwms = <&pwm3 0 0>;
label = "KBLIGHT";
frequency = <2400>;
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 4672ac13f9..74821e55bf 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -544,6 +544,7 @@
#ifdef CONFIG_PLATFORM_EC_PWM_KBLIGHT
#define CONFIG_PWM_KBLIGHT
#define CONFIG_KEYBOARD_BACKLIGHT
+#define PWM_CH_KBLIGHT PWM_CHANNEL(DT_NODELABEL(kblight))
#endif
#undef CONFIG_LED_COMMON