diff options
author | Paul Ma <magf@bitland.corp-partner.google.com> | 2019-08-22 11:05:06 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-23 13:08:24 +0000 |
commit | 309cd5931414a82b3b885332c44b25114ca39bba (patch) | |
tree | ba63563ffaeaa4af270ea58fd8da8cfaa4db25ed | |
parent | f36cb65c9a2477eef3009142fef49a64cc8d2d9b (diff) | |
download | chrome-ec-309cd5931414a82b3b885332c44b25114ca39bba.tar.gz |
akemi: remove unsupported functions
Akemi do not support ALS sensor and MST, this patch will remove
what we do not need.
BUG=b:139839740
BRANCH=none
TEST=flash ec code to akemi board, the board boot successfully.
Change-Id: I2811c26d5ecfcddc6cf906e445dd3c11069c93bc
Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763898
Reviewed-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r-- | board/akemi/board.c | 90 | ||||
-rw-r--r-- | board/akemi/board.h | 19 | ||||
-rw-r--r-- | board/akemi/gpio.inc | 6 |
3 files changed, 1 insertions, 114 deletions
diff --git a/board/akemi/board.c b/board/akemi/board.c index 20070d3e73..7dd2dad30b 100644 --- a/board/akemi/board.c +++ b/board/akemi/board.c @@ -12,7 +12,6 @@ #include "cros_board_info.h" #include "driver/accel_lis2dw12.h" #include "driver/accelgyro_lsm6dsm.h" -#include "driver/als_tcs3400.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/anx7447.h" @@ -85,11 +84,6 @@ static void tcpc_alert_event(enum gpio_signal signal) schedule_deferred_pd_interrupt(port); } -static void hdmi_hpd_interrupt(enum gpio_signal signal) -{ - baseboard_mst_enable_control(MST_HDMI, gpio_get_level(signal)); -} - static void bc12_interrupt(enum gpio_signal signal) { switch (signal) { @@ -179,43 +173,6 @@ static struct stprivate_data g_lis2dwl_data; /* Base accel private data */ static struct lsm6dsm_data lsm6dsm_data; -/* ALS private data */ -static struct als_drv_data_t g_tcs3400_data = { - .als_cal.scale = 1, - .als_cal.uscale = 0, - .als_cal.offset = 0, - .als_cal.channel_scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kc */ - .cover_scale = ALS_CHANNEL_SCALE(1.0), - }, -}; - -static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = { - .rgb_cal[X] = { - .offset = 0, - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kr */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - }, - }, - .rgb_cal[Y] = { - .offset = 0, - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kg */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - }, - }, - .rgb_cal[Z] = { - .offset = 0, - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kb */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - }, - }, - .saturation.again = TCS_DEFAULT_AGAIN, - .saturation.atime = TCS_DEFAULT_ATIME, -}; - /* Matrix to rotate accelrator into standard reference frame */ static const mat33_fp_t base_standard_ref = { { 0, FLOAT_TO_FP(1), 0}, @@ -313,52 +270,9 @@ struct motion_sensor_t motion_sensors[] = { .min_frequency = LSM6DSM_ODR_MIN_VAL, .max_frequency = LSM6DSM_ODR_MAX_VAL, }, - - [CLEAR_ALS] = { - .name = "Clear Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_TCS3400, - .type = MOTIONSENSE_TYPE_LIGHT, - .location = MOTIONSENSE_LOC_LID, - .drv = &tcs3400_drv, - .drv_data = &g_tcs3400_data, - .port = I2C_PORT_ALS, - .i2c_spi_addr_flags = TCS3400_I2C_ADDR_FLAGS, - .rot_standard_ref = NULL, - .default_range = 0x10000, /* scale = 1x, uscale = 0 */ - .min_frequency = TCS3400_LIGHT_MIN_FREQ, - .max_frequency = TCS3400_LIGHT_MAX_FREQ, - .config = { - /* Run ALS sensor in S0 */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 1000, - }, - }, - }, - - [RGB_ALS] = { - /* - * RGB channels read by CLEAR_ALS and so the i2c port and - * address do not need to be defined for RGB_ALS. - */ - .name = "RGB Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_TCS3400, - .type = MOTIONSENSE_TYPE_LIGHT_RGB, - .location = MOTIONSENSE_LOC_LID, - .drv = &tcs3400_rgb_drv, - .drv_data = &g_tcs3400_rgb_data, - .rot_standard_ref = NULL, - .default_range = 0x10000, /* scale = 1x, uscale = 0 */ - }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); -/* ALS instances when LPC mapping is needed. Each entry directs to a sensor. */ -const struct motion_sensor_t *motion_als_sensors[] = { - &motion_sensors[CLEAR_ALS], -}; -BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); /******************************************************************************/ /* Physical fans. These are logically separate from pwm_channels. */ @@ -481,10 +395,6 @@ static void board_init(void) setup_fans(); /* Enable gpio interrupt for base accelgyro sensor */ gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L); - /* Enable interrupt for the TCS3400 color light sensor */ - gpio_enable_interrupt(GPIO_TCS3400_INT_ODL); - /* Enable HDMI HPD interrupt. */ - gpio_enable_interrupt(GPIO_HDMI_CONN_HPD); /* Select correct gpio signal for PP5000_A control */ board_gpio_set_pp5000(); } diff --git a/board/akemi/board.h b/board/akemi/board.h index 5a55320d60..5f60bc41ab 100644 --- a/board/akemi/board.h +++ b/board/akemi/board.h @@ -36,18 +36,11 @@ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) /* LIS2DWL Lid accel */ #define CONFIG_ACCEL_LIS2DWL -#define CONFIG_ACCEL_FORCE_MODE_MASK (BIT(LID_ACCEL)|BIT(CLEAR_ALS)) +#define CONFIG_ACCEL_FORCE_MODE_MASK (BIT(LID_ACCEL)) #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE -/* TC3400 ALS */ -#define CONFIG_ALS -#define ALS_COUNT 1 -#define CONFIG_ALS_TCS3400 -#define CONFIG_ALS_TCS3400_INT_EVENT \ - TASK_EVENT_MOTION_SENSOR_INTERRUPT(CLEAR_ALS) -#define I2C_PORT_ALS I2C_PORT_SENSOR /* USB Type C and USB PD defines */ #define CONFIG_USB_PD_TCPM_ANX7447 @@ -94,14 +87,6 @@ #define CONFIG_THROTTLE_AP #define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B -/* MST */ -/* - * TDOD (b/124068003): This inherently assumes the MST chip is connected to only - * one Type C port. This will need to be chagned to support 2 Type C ports - * connected to the same MST chip. - */ -#define USB_PD_PORT_TCPC_MST USB_PD_PORT_TCPC_1 - /* * Macros for GPIO signals used in common code that don't match the * schematic names. Signal names in gpio.inc match the schematic and are @@ -136,8 +121,6 @@ enum sensor_id { LID_ACCEL = 0, BASE_ACCEL, BASE_GYRO, - CLEAR_ALS, - RGB_ALS, SENSOR_COUNT, }; diff --git a/board/akemi/gpio.inc b/board/akemi/gpio.inc index 5c570afc51..c356ec1041 100644 --- a/board/akemi/gpio.inc +++ b/board/akemi/gpio.inc @@ -26,7 +26,6 @@ GPIO_INT(PP5000_A_PG_OD, PIN(D, 7), GPIO_INT_BOTH, power_signal_interrupt) /* Sensor Interrupts */ GPIO_INT(BASE_SIXAXIS_INT_L, PIN(5, 6), GPIO_INT_FALLING, lsm6dsm_interrupt) -GPIO_INT(TCS3400_INT_ODL, PIN(F, 1), GPIO_INT_FALLING, tcs3400_interrupt) /* USB-C interrupts */ GPIO_INT(USB_C0_PPC_INT_ODL, PIN(E, 0), GPIO_INT_FALLING, ppc_interrupt) @@ -36,8 +35,6 @@ GPIO_INT(USB_C1_TCPC_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event) GPIO_INT(USB_C0_BC12_INT_ODL, PIN(9, 5), GPIO_INT_FALLING, bc12_interrupt) GPIO_INT(USB_C1_BC12_INT_ODL, PIN(E, 4), GPIO_INT_FALLING, bc12_interrupt) -GPIO_INT(HDMI_CONN_HPD, PIN(7, 2), GPIO_INT_BOTH, hdmi_hpd_interrupt) - /* Volume button interrupts */ GPIO_INT(EC_VOLDN_BTN_ODL, PIN(9, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(EC_VOLUP_BTN_ODL, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) @@ -71,12 +68,9 @@ GPIO(EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT) GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH) /* Yellow (hatch) */ GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch) */ GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH) -GPIO(LED_4_L, PIN(6, 0), GPIO_OUT_HIGH) GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */ GPIO(EDP_BKLTEN_OD, PIN(D, 3), GPIO_ODR_HIGH) /* Display backlight */ GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW) -GPIO(EN_MST, PIN(9, 6), GPIO_OUT_LOW) - /* I2C pins - Alternate function below configures I2C module on these pins */ GPIO(I2C0_SCL, PIN(B, 5), GPIO_INPUT | |