diff options
-rw-r--r-- | board/eve/board.h | 1 | ||||
-rw-r--r-- | board/glados/board.h | 1 | ||||
-rw-r--r-- | board/kevin/board.h | 1 | ||||
-rw-r--r-- | board/oak/board.c | 10 | ||||
-rw-r--r-- | board/oak/board.h | 9 | ||||
-rw-r--r-- | board/oak/ec.tasklist | 22 | ||||
-rw-r--r-- | board/oak/gpio.inc | 6 | ||||
-rw-r--r-- | board/pyro/board.h | 1 | ||||
-rw-r--r-- | board/reef/board.h | 1 | ||||
-rw-r--r-- | board/samus/board.h | 1 | ||||
-rw-r--r-- | board/snappy/board.h | 1 | ||||
-rw-r--r-- | board/strago/board.h | 1 | ||||
-rw-r--r-- | board/wheatley/board.h | 1 | ||||
-rw-r--r-- | common/build.mk | 2 | ||||
-rw-r--r-- | include/config.h | 4 |
15 files changed, 35 insertions, 27 deletions
diff --git a/board/eve/board.h b/board/eve/board.h index 7fd184f182..e266a29bdc 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -93,7 +93,6 @@ /* Sensor */ #define CONFIG_ACCEL_KXCJ9 -#define CONFIG_ALS #define CONFIG_ALS_ISL29035 #define CONFIG_TEMP_SENSOR #define CONFIG_TEMP_SENSOR_BD99992GW diff --git a/board/glados/board.h b/board/glados/board.h index 51f91a8443..58d6fcbd8c 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -18,7 +18,6 @@ #define CONFIG_ACCELGYRO_BMI160 #define CONFIG_ACCEL_KX022 #define CONFIG_ADC -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L diff --git a/board/kevin/board.h b/board/kevin/board.h index 676a7c4af3..92fb0102d0 100644 --- a/board/kevin/board.h +++ b/board/kevin/board.h @@ -92,7 +92,6 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #ifdef BOARD_GRU -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1 #define CONFIG_BARO_BMP280 diff --git a/board/oak/board.c b/board/oak/board.c index 99b4e9ba6b..f22e016622 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -152,7 +152,7 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -#ifdef CONFIG_ALS +#ifdef HAS_TASK_ALS /* ALS instances. Must be in same order as enum als_id. */ struct als_t als[] = { {"TI", opt3001_init, opt3001_read_lux, 5}, @@ -550,14 +550,6 @@ void vbus_task(void) } #endif /* BOARD_REV < OAK_REV4 */ -#ifndef CONFIG_ALS -void als_task(void) -{ - while (1) - task_wait_event(-1); -} -#endif - #ifdef CONFIG_TEMP_SENSOR_TMP432 static void tmp432_set_power_deferred(void) { diff --git a/board/oak/board.h b/board/oak/board.h index 84afcd42f0..bc4c03ee52 100644 --- a/board/oak/board.h +++ b/board/oak/board.h @@ -23,7 +23,6 @@ #if BOARD_REV >= OAK_REV5 /* Add for Ambient Light Sensor */ -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define CONFIG_CMD_ALS #endif @@ -69,6 +68,10 @@ #define CONFIG_HIBERNATE_WAKEUP_PINS (STM32_PWR_CSR_EWUP6) #else #define CONFIG_HIBERNATE_WAKEUP_PINS (STM32_PWR_CSR_EWUP1) +#define CONFIG_LID_ANGLE +#define CONFIG_LID_ANGLE_SENSOR_BASE 0 +#define CONFIG_LID_ANGLE_SENSOR_LID 2 +#define CONFIG_LID_ANGLE_UPDATE #endif /* BOARD_REV */ #define CONFIG_HOST_COMMAND_STATUS #define CONFIG_HOSTCMD_PD @@ -78,10 +81,6 @@ #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_PROTOCOL_MKBP #define CONFIG_LED_COMMON -#define CONFIG_LID_ANGLE -#define CONFIG_LID_ANGLE_SENSOR_BASE 0 -#define CONFIG_LID_ANGLE_SENSOR_LID 2 -#define CONFIG_LID_ANGLE_UPDATE #define CONFIG_LID_SWITCH #define CONFIG_LOW_POWER_IDLE #define CONFIG_MKBP_EVENT diff --git a/board/oak/ec.tasklist b/board/oak/ec.tasklist index 40a9f91bf6..e55a2cb854 100644 --- a/board/oak/ec.tasklist +++ b/board/oak/ec.tasklist @@ -16,6 +16,10 @@ * 'd' in an opaque parameter passed to the routine at startup * 's' is the stack size in bytes; must be a multiple of 8 */ +#include "board_revs.h" + + +#if BOARD_REV >= OAK_REV5 #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ @@ -32,3 +36,21 @@ TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) + +#else /* BOARD_REV >= OAK_REV5 */ + +#define CONFIG_TASK_LIST \ + TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(VBUS, vbus_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(PDCMD, pd_command_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) + +#endif /* BOARD_REV >= OAK_REV5 */ diff --git a/board/oak/gpio.inc b/board/oak/gpio.inc index 6b204095b1..70bb3a7bba 100644 --- a/board/oak/gpio.inc +++ b/board/oak/gpio.inc @@ -174,6 +174,9 @@ GPIO(USB_C0_DEVMODE_L, PIN(E, 4), GPIO_OUT_HIGH) /* set HSD2 (host mode) pat GPIO(USB_C1_DEVMODE, PIN(E, 2), GPIO_OUT_LOW) /* set HSD1 (host mode) path as default */ #else /* >= OAK_REV5 */ GPIO(LEVEL_SHIFT_EN_L, PIN(F, 10), GPIO_OUT_LOW) /* LID/AC level shift */ +/* SPI MASTER. For SPI sensor */ +GPIO(SPI2_NSS, PIN(D, 0), GPIO_OUT_LOW) + #endif GPIO(USB_PD_RST_L, PIN(A, 15), GPIO_OUT_HIGH) /* PD reset */ GPIO(USB_C0_5V_EN, PIN(D, 8), GPIO_OUT_LOW) /* USBC port 0 5V */ @@ -202,9 +205,6 @@ GPIO(I2C0_SDA, PIN(B, 7), GPIO_INPUT) GPIO(I2C1_SCL, PIN(B, 13), GPIO_INPUT) /* PD I2C */ GPIO(I2C1_SDA, PIN(B, 14), GPIO_INPUT) -/* SPI MASTER. For SPI sensor */ -GPIO(SPI2_NSS, PIN(D, 0), GPIO_OUT_LOW) - ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, 0) /* USART1: PA9/PA10 */ ALTERNATE(PIN_MASK(B, 0x00c0), 1, MODULE_I2C, 0) /* I2C MASTER:PB6/7 */ ALTERNATE(PIN_MASK(B, 0x6000), 5, MODULE_I2C, 0) /* I2C MASTER:PB13/14 */ diff --git a/board/pyro/board.h b/board/pyro/board.h index b7c77a2ce2..b88a7ba39a 100644 --- a/board/pyro/board.h +++ b/board/pyro/board.h @@ -191,7 +191,6 @@ #define BMM150_I2C_ADDRESS BMM150_ADDR0 /* 8-bit address */ #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_KX022 -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1 #define CONFIG_BARO_BMP280 diff --git a/board/reef/board.h b/board/reef/board.h index a21a9883ca..1a26a887f0 100644 --- a/board/reef/board.h +++ b/board/reef/board.h @@ -192,7 +192,6 @@ #define BMM150_I2C_ADDRESS BMM150_ADDR0 /* 8-bit address */ #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_KX022 -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1 #define CONFIG_BARO_BMP280 diff --git a/board/samus/board.h b/board/samus/board.h index 9ed424b894..59455e7822 100644 --- a/board/samus/board.h +++ b/board/samus/board.h @@ -18,7 +18,6 @@ #define CONFIG_ACCELGYRO_LSM6DS0 #define CONFIG_ACCEL_KXCJ9 #define CONFIG_ACCEL_STD_REF_FRAME_OLD -#define CONFIG_ALS #define CONFIG_ALS_ISL29035 #define CONFIG_BOARD_VERSION #define CONFIG_CMD_ACCELS diff --git a/board/snappy/board.h b/board/snappy/board.h index 29a044a44b..f4afcb9ca4 100644 --- a/board/snappy/board.h +++ b/board/snappy/board.h @@ -190,7 +190,6 @@ #define BMM150_I2C_ADDRESS BMM150_ADDR0 /* 8-bit address */ #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_KX022 -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR OPT3001_I2C_ADDR1 #define CONFIG_BARO_BMP280 diff --git a/board/strago/board.h b/board/strago/board.h index a7ab0d864d..158329c4ad 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -64,7 +64,6 @@ #define CONFIG_PMIC -#define CONFIG_ALS #define CONFIG_ALS_ISL29035 #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_SMART diff --git a/board/wheatley/board.h b/board/wheatley/board.h index 71cbb9ddaf..3a2abae07b 100644 --- a/board/wheatley/board.h +++ b/board/wheatley/board.h @@ -12,7 +12,6 @@ #define CONFIG_ACCELGYRO_BMI160 #define CONFIG_ACCEL_KX022 #define CONFIG_ADC -#define CONFIG_ALS #define CONFIG_ALS_OPT3001 #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L diff --git a/common/build.mk b/common/build.mk index 401a607c20..329324d848 100644 --- a/common/build.mk +++ b/common/build.mk @@ -16,7 +16,7 @@ common-$(CONFIG_ACCELGYRO_LSM6DSM)+=math_util.o common-$(CONFIG_ACCEL_KXCJ9)+=math_util.o common-$(CONFIG_ACCEL_KX022)+=math_util.o common-$(CONFIG_ADC)+=adc.o -common-$(CONFIG_ALS)+=als.o +common-$(HAS_TASK_ALS)+=als.o common-$(CONFIG_AP_HANG_DETECT)+=ap_hang_detect.o common-$(CONFIG_BACKLIGHT_LID)+=backlight_lid.o # TODO(crosbug.com/p/23821): Why do these include battery_common but diff --git a/include/config.h b/include/config.h index 3ab6765b99..5d48812c27 100644 --- a/include/config.h +++ b/include/config.h @@ -114,7 +114,11 @@ * Some ALS modules may be connected to the EC. We need the command, and * specific drivers for each module. */ +#ifdef HAS_TASK_ALS +#define CONFIG_ALS +#else #undef CONFIG_ALS +#endif #undef CONFIG_ALS_AL3010 #undef CONFIG_ALS_ISL29035 #undef CONFIG_ALS_OPT3001 |