summaryrefslogtreecommitdiff
path: root/board/hammer/board.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-05-16 10:16:43 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-16 07:47:05 -0700
commitcb9bd66ec66ccd499ff597919806eafc1524acd2 (patch)
treed891ff6be97a5b681e24097aadb17ce9231371e7 /board/hammer/board.c
parentdee69a236f67b99e87746fee5894c915682623ee (diff)
downloadchrome-ec-cb9bd66ec66ccd499ff597919806eafc1524acd2.tar.gz
hammer: Add staff board
hammer corresponds to poppy, and staff corresponds to soraka. Current differences (hammer/staff): - USB id (5022/502b) - PWM frequency (10kHz/100Hz): - On staff, driving PWM at 10kHz leads to an actual duty cycle around 30-40%, with a PWM output at 1% (long rise/fall time). 100Hz looks better, we get ~1.45% duty with 1% PWM output. BRANCH=none BUG=b:38277869 TEST=Flash staff, boots fine. TEST=pwm 0 1 shows quite dim backlight on staff. Change-Id: I66ba2adf89fbee8578ee473afb28e3e242b4d111 Reviewed-on: https://chromium-review.googlesource.com/505855 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/hammer/board.c')
-rw-r--r--board/hammer/board.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/board/hammer/board.c b/board/hammer/board.c
index 4f157ad22c..56aefc89e4 100644
--- a/board/hammer/board.c
+++ b/board/hammer/board.c
@@ -54,9 +54,15 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+#ifdef BOARD_STAFF
+#define KBLIGHT_PWM_FREQ 100 /* Hz */
+#else
+#define KBLIGHT_PWM_FREQ 10000 /* Hz */
+#endif
+
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
const struct pwm_t pwm_channels[] = {
- {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, 10000 /* Hz */ },
+ {STM32_TIM(TIM_KBLIGHT), STM32_TIM_CH(1), 0, KBLIGHT_PWM_FREQ},
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);