summaryrefslogtreecommitdiff
path: root/board/magolor/board.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-17 11:49:49 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-21 18:27:22 +0000
commit906dea8f53aeca97488a73f5fcfc4d16106d7ea8 (patch)
tree167bb368837350f1b9aa792625af2a5ea8096ab5 /board/magolor/board.c
parentf832dc1f14ee2086d1903c5e38e927485eb067dc (diff)
downloadchrome-ec-906dea8f53aeca97488a73f5fcfc4d16106d7ea8.tar.gz
Dedede: Move PWM to board level
Move the PWM related defines and arrays into the board level, to allow customization of what PWM channels boards use (if they choose to use the PWM at all). BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Id417a7be079511c17de9f2e5d03c729467435804 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2358899 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/magolor/board.c')
-rw-r--r--board/magolor/board.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/magolor/board.c b/board/magolor/board.c
index 300e3bf427..7985a2d70a 100644
--- a/board/magolor/board.c
+++ b/board/magolor/board.c
@@ -31,6 +31,8 @@
#include "motion_sense.h"
#include "power.h"
#include "power_button.h"
+#include "pwm.h"
+#include "pwm_chip.h"
#include "stdbool.h"
#include "switch.h"
#include "system.h"
@@ -439,6 +441,28 @@ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
},
};
+/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_KBLIGHT] = {
+ .channel = 3,
+ .flags = PWM_CONFIG_DSLEEP,
+ .freq = 10000,
+ },
+
+ [PWM_CH_LED1_AMBER] = {
+ .channel = 2,
+ .flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
+ .freq = 2400,
+ },
+
+ [PWM_CH_LED2_WHITE] = {
+ .channel = 0,
+ .flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
+ .freq = 2400,
+ }
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
.bus_type = EC_BUS_TYPE_I2C,