summaryrefslogtreecommitdiff
path: root/board/ezkinil/board.c
diff options
context:
space:
mode:
authorZick Wei <zick.wei@quanta.corp-partner.google.com>2020-02-04 14:19:40 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-11 19:47:47 +0000
commit6ba747b88f10499dd558e1b606895cf82ed7ba3d (patch)
tree0b62c71779b03a1a8ea744d539d649c395b472f7 /board/ezkinil/board.c
parent9473c61ff528ce45bda479027f5011297faaa5da (diff)
downloadchrome-ec-6ba747b88f10499dd558e1b606895cf82ed7ba3d.tar.gz
morphius: add PWM CH0 for LED control
This patch add PWM channel 0 for LED control. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I513856dd7c223b5ee1f6f12fa9a1846f5f616e01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2035440 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/ezkinil/board.c')
-rw-r--r--board/ezkinil/board.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c
index a519a0010e..a177b5bc1f 100644
--- a/board/ezkinil/board.c
+++ b/board/ezkinil/board.c
@@ -8,10 +8,14 @@
#include "button.h"
#include "driver/accelgyro_bmi160.h"
#include "extpower.h"
+#include "fan.h"
+#include "fan_chip.h"
#include "gpio.h"
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
+#include "pwm.h"
+#include "pwm_chip.h"
#include "switch.h"
#include "system.h"
#include "usb_charge.h"
@@ -41,3 +45,27 @@ void board_update_sensor_config_from_sku(void)
/* Enable Gyro interrupts */
gpio_enable_interrupt(GPIO_6AXIS_INT_L);
}
+
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_KBLIGHT] = {
+ .channel = 3,
+ .flags = PWM_CONFIG_DSLEEP,
+ .freq = 100,
+ },
+ [PWM_CH_FAN] = {
+ .channel = 2,
+ .flags = PWM_CONFIG_OPEN_DRAIN,
+ .freq = 25000,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
+/* MFT channels. These are logically separate from pwm_channels. */
+const struct mft_t mft_channels[] = {
+ [MFT_CH_0] = {
+ .module = NPCX_MFT_MODULE_1,
+ .clk_src = TCKC_LFCLK,
+ .pwm_id = PWM_CH_FAN,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT);