summaryrefslogtreecommitdiff
path: root/board
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
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')
-rw-r--r--board/dalboz/board.c28
-rw-r--r--board/dalboz/board.h12
-rw-r--r--board/ezkinil/board.c28
-rw-r--r--board/ezkinil/board.h12
-rw-r--r--board/morphius/board.c33
-rw-r--r--board/morphius/board.h13
-rw-r--r--board/trembyle/board.c28
-rw-r--r--board/trembyle/board.h12
8 files changed, 166 insertions, 0 deletions
diff --git a/board/dalboz/board.c b/board/dalboz/board.c
index 7014b4d9e1..883f493101 100644
--- a/board/dalboz/board.c
+++ b/board/dalboz/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);
diff --git a/board/dalboz/board.h b/board/dalboz/board.h
index 5feefee1ba..b316ab7d72 100644
--- a/board/dalboz/board.h
+++ b/board/dalboz/board.h
@@ -65,6 +65,18 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
+enum mft_channel {
+ MFT_CH_0 = 0,
+ /* Number of MFT channels */
+ MFT_CH_COUNT,
+};
+
+enum pwm_channel {
+ PWM_CH_KBLIGHT = 0,
+ PWM_CH_FAN,
+ PWM_CH_COUNT
+};
+
#endif /* !__ASSEMBLER__ */
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);
diff --git a/board/ezkinil/board.h b/board/ezkinil/board.h
index 45e4f61e89..8c35753c0b 100644
--- a/board/ezkinil/board.h
+++ b/board/ezkinil/board.h
@@ -64,6 +64,18 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
+enum mft_channel {
+ MFT_CH_0 = 0,
+ /* Number of MFT channels */
+ MFT_CH_COUNT,
+};
+
+enum pwm_channel {
+ PWM_CH_KBLIGHT = 0,
+ PWM_CH_FAN,
+ PWM_CH_COUNT
+};
+
#endif /* !__ASSEMBLER__ */
diff --git a/board/morphius/board.c b/board/morphius/board.c
index 536ce29b57..0f8add5d1a 100644
--- a/board/morphius/board.c
+++ b/board/morphius/board.c
@@ -9,10 +9,14 @@
#include "driver/accelgyro_bmi160.h"
#include "extpower.h"
#include "gpio.h"
+#include "fan.h"
+#include "fan_chip.h"
#include "hooks.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"
@@ -62,3 +66,32 @@ void ps2_pwr_en_interrupt(enum gpio_signal signal)
{
hook_call_deferred(&trackpoint_reset_deferred_data, MSEC);
}
+
+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,
+ },
+ [PWM_CH_POWER_LED] = {
+ .channel = 0,
+ .flags = PWM_CONFIG_DSLEEP,
+ .freq = 100,
+ },
+};
+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);
diff --git a/board/morphius/board.h b/board/morphius/board.h
index 3ed4a5730d..1ae86a4999 100644
--- a/board/morphius/board.h
+++ b/board/morphius/board.h
@@ -68,6 +68,19 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
+enum mft_channel {
+ MFT_CH_0 = 0,
+ /* Number of MFT channels */
+ MFT_CH_COUNT,
+};
+
+enum pwm_channel {
+ PWM_CH_KBLIGHT = 0,
+ PWM_CH_FAN,
+ PWM_CH_POWER_LED,
+ PWM_CH_COUNT
+};
+
#endif /* !__ASSEMBLER__ */
diff --git a/board/trembyle/board.c b/board/trembyle/board.c
index 7014b4d9e1..883f493101 100644
--- a/board/trembyle/board.c
+++ b/board/trembyle/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);
diff --git a/board/trembyle/board.h b/board/trembyle/board.h
index 45e1437390..884b2461df 100644
--- a/board/trembyle/board.h
+++ b/board/trembyle/board.h
@@ -64,6 +64,18 @@ enum battery_type {
BATTERY_TYPE_COUNT,
};
+enum mft_channel {
+ MFT_CH_0 = 0,
+ /* Number of MFT channels */
+ MFT_CH_COUNT,
+};
+
+enum pwm_channel {
+ PWM_CH_KBLIGHT = 0,
+ PWM_CH_FAN,
+ PWM_CH_COUNT
+};
+
#endif /* !__ASSEMBLER__ */