summaryrefslogtreecommitdiff
path: root/board/cherry/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/cherry/board.c')
-rw-r--r--board/cherry/board.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/board/cherry/board.c b/board/cherry/board.c
index 565c68e976..53e31e5640 100644
--- a/board/cherry/board.c
+++ b/board/cherry/board.c
@@ -159,6 +159,42 @@ static void board_update_motion_sensor_config(void)
}
}
+/* PWM */
+
+/*
+ * PWM channels. Must be in the exactly same order as in enum pwm_channel.
+ * There total three 16 bits clock prescaler registers for all pwm channels,
+ * so use the same frequency and prescaler register setting is required if
+ * number of pwm channel greater than three.
+ */
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_LED1] = {
+ .channel = 0,
+ .flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
+ .freq_hz = 324, /* maximum supported frequency */
+ .pcfsr_sel = PWM_PRESCALER_C4,
+ },
+ [PWM_CH_LED2] = {
+ .channel = 1,
+ .flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
+ .freq_hz = 324, /* maximum supported frequency */
+ .pcfsr_sel = PWM_PRESCALER_C4,
+ },
+ [PWM_CH_LED3] = {
+ .channel = 2,
+ .flags = PWM_CONFIG_DSLEEP | PWM_CONFIG_ACTIVE_LOW,
+ .freq_hz = 324, /* maximum supported frequency */
+ .pcfsr_sel = PWM_PRESCALER_C4,
+ },
+ [PWM_CH_KBLIGHT] = {
+ .channel = 3,
+ .flags = PWM_CONFIG_DSLEEP,
+ .freq_hz = 10000, /* SYV226 supports 10~100kHz */
+ .pcfsr_sel = PWM_PRESCALER_C6,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
/* Initialize board. */
static void board_init(void)
{