diff options
-rw-r--r-- | board/beadrix/board.c | 87 | ||||
-rw-r--r-- | board/beadrix/board.h | 22 | ||||
-rw-r--r-- | board/beadrix/ec.tasklist | 1 | ||||
-rw-r--r-- | board/beadrix/gpio.inc | 6 |
4 files changed, 3 insertions, 113 deletions
diff --git a/board/beadrix/board.c b/board/beadrix/board.c index ea268e6af6..0fb2f9773b 100644 --- a/board/beadrix/board.c +++ b/board/beadrix/board.c @@ -10,8 +10,6 @@ #include "charge_manager.h" #include "charge_state_v2.h" #include "charger.h" -#include "driver/accel_kionix.h" -#include "driver/accelgyro_lsm6dsm.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" #include "driver/retimer/nb7v904m.h" @@ -358,8 +356,6 @@ void board_init(void) check_c1_line(); gpio_enable_interrupt(GPIO_USB_C0_CCSBU_OVP_ODL); - /* Enable Base Accel interrupt */ - gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L); /* Turn on 5V if the system is on, otherwise turn it off. */ on = chipset_in_state(CHIPSET_STATE_ON | CHIPSET_STATE_ANY_SUSPEND | @@ -563,89 +559,6 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); -/* Sensor Mutexes */ -static struct mutex g_lid_mutex; -static struct mutex g_base_mutex; - -/* Sensor Data */ -static struct kionix_accel_data g_kx022_data; -static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA; - -/* Drivers */ -struct motion_sensor_t motion_sensors[] = { - [LID_ACCEL] = { - .name = "Lid Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_KX022, - .type = MOTIONSENSE_TYPE_ACCEL, - .location = MOTIONSENSE_LOC_LID, - .drv = &kionix_accel_drv, - .mutex = &g_lid_mutex, - .drv_data = &g_kx022_data, - .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, - .rot_standard_ref = NULL, - .default_range = 2, /* g */ - /* We only use 2g because its resolution is only 8-bits */ - .min_frequency = KX022_ACCEL_MIN_FREQ, - .max_frequency = KX022_ACCEL_MAX_FREQ, - .config = { - [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, - }, - [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, - }, - }, - }, - [BASE_ACCEL] = { - .name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_LSM6DSM, - .type = MOTIONSENSE_TYPE_ACCEL, - .location = MOTIONSENSE_LOC_BASE, - .drv = &lsm6dsm_drv, - .mutex = &g_base_mutex, - .drv_data = LSM6DSM_ST_DATA(lsm6dsm_data, - MOTIONSENSE_TYPE_ACCEL), - .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS, - .rot_standard_ref = NULL, - .default_range = 4, /* g */ - .min_frequency = LSM6DSM_ODR_MIN_VAL, - .max_frequency = LSM6DSM_ODR_MAX_VAL, - .config = { - [SENSOR_CONFIG_EC_S0] = { - .odr = 13000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, - }, - [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, - }, - }, - }, - [BASE_GYRO] = { - .name = "Base Gyro", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_LSM6DSM, - .type = MOTIONSENSE_TYPE_GYRO, - .location = MOTIONSENSE_LOC_BASE, - .drv = &lsm6dsm_drv, - .mutex = &g_base_mutex, - .drv_data = LSM6DSM_ST_DATA(lsm6dsm_data, - MOTIONSENSE_TYPE_GYRO), - .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = LSM6DSM_ADDR0_FLAGS, - .default_range = 1000 | ROUND_UP_FLAG, /* dps */ - .rot_standard_ref = NULL, - .min_frequency = LSM6DSM_ODR_MIN_VAL, - .max_frequency = LSM6DSM_ODR_MAX_VAL, - }, -}; - -const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - /* Thermistors */ const struct temp_sensor_t temp_sensors[] = { [TEMP_SENSOR_1] = {.name = "Memory", diff --git a/board/beadrix/board.h b/board/beadrix/board.h index 2b0a85a0ee..6e7975fd14 100644 --- a/board/beadrix/board.h +++ b/board/beadrix/board.h @@ -44,20 +44,6 @@ /* PWM */ #define CONFIG_PWM -/* Sensors */ -#define CONFIG_ACCEL_KX022 /* Lid accel */ -#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ -#define CONFIG_ACCEL_LSM6DSM_INT_EVENT \ - TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) -/* Sensors without hardware FIFO are in forced mode */ -#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) - -/* Enable sensor fifo, must also define the _SIZE and _THRES */ -#define CONFIG_ACCEL_FIFO -/* Power of 2 - Too large of a fifo causes too much timestamp jitter */ -#define CONFIG_ACCEL_FIFO_SIZE 256 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) - /* TCPC */ #define CONFIG_USB_PD_TCPM_ANX7447 /* C1: MUX only*/ #define CONFIG_USB_PD_TCPM_MUX @@ -115,14 +101,6 @@ enum pwm_channel { PWM_CH_COUNT, }; -/* Motion sensors */ -enum sensor_id { - LID_ACCEL, - BASE_ACCEL, - BASE_GYRO, - SENSOR_COUNT -}; - /* ADC channels */ enum adc_channel { ADC_VSNS_PP3300_A, /* ADC0 */ diff --git a/board/beadrix/ec.tasklist b/board/beadrix/ec.tasklist index e201fb0b1c..74b7663d69 100644 --- a/board/beadrix/ec.tasklist +++ b/board/beadrix/ec.tasklist @@ -9,7 +9,6 @@ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, VENTI_TASK_STACK_SIZE) \ - TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P0, usb_charger_task, 0, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P1, usb_charger_task, 1, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(CHARGER, charger_task, NULL, TRENTA_TASK_STACK_SIZE) \ diff --git a/board/beadrix/gpio.inc b/board/beadrix/gpio.inc index a7ca521e4b..b5e557f01f 100644 --- a/board/beadrix/gpio.inc +++ b/board/beadrix/gpio.inc @@ -37,7 +37,6 @@ GPIO_INT(USB_C0_CCSBU_OVP_ODL, PIN(K, 6), GPIO_INT_FALLING | GPIO_PULL_UP, c0_cc GPIO_INT(LID_OPEN, PIN(F, 3), GPIO_INT_BOTH, lid_interrupt) GPIO_INT(VOLDN_BTN_ODL, PIN(I, 6), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(VOLUP_BTN_ODL, PIN(I, 7), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) -GPIO_INT(BASE_SIXAXIS_INT_L, PIN(J, 0), GPIO_INT_FALLING | GPIO_SEL_1P8V, lsm6dsm_interrupt) GPIO_INT(EC_WP_OD, PIN(A, 6), GPIO_INT_BOTH, switch_interrupt) /* Power sequence GPIOs */ @@ -98,8 +97,7 @@ GPIO(EC_ENTERING_RW, PIN(G, 0), GPIO_OUT_LOW) GPIO(EC_ENTERING_RW2, PIN(C, 7), GPIO_OUT_LOW) GPIO(CCD_MODE_ODL, PIN(H, 5), GPIO_ODR_HIGH) GPIO(EC_BATTERY_PRES_ODL, PIN(I, 4), GPIO_INPUT) -GPIO(PEN_DET_ODL, PIN(J, 1), GPIO_INPUT | GPIO_PULL_UP) -GPIO(EN_KB_BL, PIN(J, 3), GPIO_OUT_LOW) /* Currently unused */ +GPIO(IMVP9_PE, PIN(J, 3), GPIO_OUT_LOW) GPIO(ECH1_PACKET_MODE, PIN(H, 1), GPIO_OUT_LOW) /* LEDs */ @@ -122,6 +120,8 @@ GPIO(GPIOG6_NC, PIN(G, 6), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOG7_NC, PIN(G, 7), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOH4_NC, PIN(H, 4), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOH6_NC, PIN(H, 6), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOJ0_NC, PIN(J, 0), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(GPIOJ1_NC, PIN(J, 1), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOJ4_NC, PIN(J, 4), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOJ5_NC, PIN(J, 5), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(GPIOJ6_NC, PIN(J, 6), GPIO_INPUT | GPIO_PULL_DOWN) |