summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--baseboard/dedede/baseboard.h4
-rw-r--r--baseboard/dedede/variant_ec_npcx796fc.c23
-rw-r--r--board/boten/board.h3
-rw-r--r--board/drawcia/board.h3
-rw-r--r--board/madoo/board.c24
-rw-r--r--board/madoo/board.h4
-rw-r--r--board/magolor/board.c24
-rw-r--r--board/magolor/board.h4
-rw-r--r--board/waddledee/board.h3
-rw-r--r--board/waddledoo/board.c24
-rw-r--r--board/waddledoo/board.h4
-rw-r--r--board/wheelie/board.h3
12 files changed, 96 insertions, 27 deletions
diff --git a/baseboard/dedede/baseboard.h b/baseboard/dedede/baseboard.h
index 98e864467f..aa6b63417e 100644
--- a/baseboard/dedede/baseboard.h
+++ b/baseboard/dedede/baseboard.h
@@ -26,7 +26,6 @@
/* NPCX7 config */
#define NPCX_UART_MODULE2 1 /* GPIO64/65 are used as UART pins. */
#define NPCX_TACH_SEL2 0 /* No tach. */
- #define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
/* Internal SPI flash on NPCX7 */
#define CONFIG_FLASH_SIZE (512 * 1024)
@@ -142,9 +141,6 @@
/* LED */
#define CONFIG_LED_COMMON
-/* PWM */
-#define CONFIG_PWM
-
/* SoC */
#define CONFIG_BOARD_HAS_RTC_RESET
#define CONFIG_CHIPSET_JASPERLAKE
diff --git a/baseboard/dedede/variant_ec_npcx796fc.c b/baseboard/dedede/variant_ec_npcx796fc.c
index ef8f5a79b2..bd896449db 100644
--- a/baseboard/dedede/variant_ec_npcx796fc.c
+++ b/baseboard/dedede/variant_ec_npcx796fc.c
@@ -16,8 +16,6 @@
#include "i2c.h"
#include "lid_switch.h"
#include "power.h"
-#include "pwm.h"
-#include "pwm_chip.h"
#include "registers.h"
#include "task.h"
#include "timer.h"
@@ -190,24 +188,3 @@ const struct i2c_port_t i2c_ports[] = {
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-/* 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);
diff --git a/board/boten/board.h b/board/boten/board.h
index 1d4524f155..b2c5460248 100644
--- a/board/boten/board.h
+++ b/board/boten/board.h
@@ -33,6 +33,9 @@
#define CONFIG_LED_POWER_LED
#define CONFIG_LED_ONOFF_STATES
+/* PWM */
+#define CONFIG_PWM
+
/* Sensors */
#define CONFIG_ACCEL_LIS2DWL /* Lid accel */
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */
diff --git a/board/drawcia/board.h b/board/drawcia/board.h
index 94eb81c6ab..2633df9cb7 100644
--- a/board/drawcia/board.h
+++ b/board/drawcia/board.h
@@ -33,6 +33,9 @@
#define CONFIG_OCPC
#define CONFIG_OCPC_DEF_RBATT_MOHMS 5 /* R_DS(on) 5.3mOhm */
+/* PWM */
+#define CONFIG_PWM
+
/* Sensors */
#define CONFIG_ACCEL_BMA255 /* Lid accel */
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */
diff --git a/board/madoo/board.c b/board/madoo/board.c
index d39e6de7dd..8a798788ad 100644
--- a/board/madoo/board.c
+++ b/board/madoo/board.c
@@ -33,6 +33,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"
@@ -510,6 +512,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,
diff --git a/board/madoo/board.h b/board/madoo/board.h
index 7eb7e0af30..f9185e3825 100644
--- a/board/madoo/board.h
+++ b/board/madoo/board.h
@@ -45,6 +45,10 @@
#define CONFIG_LED_PWM_SOC_SUSPEND_COLOR EC_LED_COLOR_WHITE
#define CONFIG_LED_PWM_LOW_BATT_COLOR EC_LED_COLOR_AMBER
+/* PWM */
+#define CONFIG_PWM
+#define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
+
/* USB */
#define CONFIG_BC12_DETECT_PI3USB9201
#define CONFIG_USBC_RETIMER_NB7V904M
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,
diff --git a/board/magolor/board.h b/board/magolor/board.h
index 138489239d..3dddd2f2bc 100644
--- a/board/magolor/board.h
+++ b/board/magolor/board.h
@@ -45,6 +45,10 @@
#define CONFIG_LED_PWM_SOC_SUSPEND_COLOR EC_LED_COLOR_WHITE
#define CONFIG_LED_PWM_LOW_BATT_COLOR EC_LED_COLOR_AMBER
+/* PWM */
+#define CONFIG_PWM
+#define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
+
/* USB */
#define CONFIG_BC12_DETECT_PI3USB9201
#define CONFIG_USBC_RETIMER_NB7V904M
diff --git a/board/waddledee/board.h b/board/waddledee/board.h
index c45385d9ff..d43ce1d44b 100644
--- a/board/waddledee/board.h
+++ b/board/waddledee/board.h
@@ -36,6 +36,9 @@
#define CONFIG_LED_PWM
#define CONFIG_LED_PWM_COUNT 1
+/* PWM */
+#define CONFIG_PWM
+
/* Sensors */
#define CONFIG_ACCEL_LIS2DE /* Lid accel */
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */
diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c
index 8df0c93c88..9cc417ce92 100644
--- a/board/waddledoo/board.c
+++ b/board/waddledoo/board.c
@@ -34,6 +34,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"
@@ -519,6 +521,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,
diff --git a/board/waddledoo/board.h b/board/waddledoo/board.h
index e008c89814..0ef1244f2a 100644
--- a/board/waddledoo/board.h
+++ b/board/waddledoo/board.h
@@ -45,6 +45,10 @@
#define CONFIG_LED_PWM_SOC_SUSPEND_COLOR EC_LED_COLOR_WHITE
#define CONFIG_LED_PWM_LOW_BATT_COLOR EC_LED_COLOR_AMBER
+/* PWM */
+#define CONFIG_PWM
+#define NPCX7_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */
+
/* USB */
#define CONFIG_BC12_DETECT_PI3USB9201
#define CONFIG_USBC_RETIMER_NB7V904M
diff --git a/board/wheelie/board.h b/board/wheelie/board.h
index a4509bb625..7c680545c0 100644
--- a/board/wheelie/board.h
+++ b/board/wheelie/board.h
@@ -33,6 +33,9 @@
#define CONFIG_LED_PWM
#define CONFIG_LED_PWM_COUNT 1
+/* PWM */
+#define CONFIG_PWM
+
/* Sensors */
#define CONFIG_ACCEL_LIS2DE /* Lid accel */
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */