summaryrefslogtreecommitdiff
path: root/board/delbin
diff options
context:
space:
mode:
authorMichael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>2020-06-17 14:00:39 +0800
committerCommit Bot <commit-bot@chromium.org>2020-06-19 07:00:11 +0000
commit46b89211e0480f7acf8d1cb832aac2e20827a48e (patch)
treeb906b11021b05929e6794a85394f559d3129a84c /board/delbin
parentb96bad8e0de4c89bd498e3d3acf9f56ded847e0e (diff)
downloadchrome-ec-46b89211e0480f7acf8d1cb832aac2e20827a48e.tar.gz
delbin: Modify GPIO table and remove ALS sensor dependent on schematic.
1. Modity GPIO table. 2. Remove ALS sensor. BUG=b:158797761 BRANCH=master TEST=make buildall Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Idcedfe73784807256f04bbf40ef71cc9c44a150d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2247971 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/delbin')
-rw-r--r--board/delbin/board.c12
-rw-r--r--board/delbin/board.h15
-rw-r--r--board/delbin/gpio.inc13
-rw-r--r--board/delbin/sensors.c101
4 files changed, 5 insertions, 136 deletions
diff --git a/board/delbin/board.c b/board/delbin/board.c
index 2bd8652fb2..06f4797e8b 100644
--- a/board/delbin/board.c
+++ b/board/delbin/board.c
@@ -10,9 +10,7 @@
#include "accelgyro.h"
#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_bmi260.h"
-#include "driver/als_tcs3400.h"
#include "driver/retimer/bb_retimer.h"
-#include "driver/sync.h"
#include "extpower.h"
#include "fan.h"
#include "fan_chip.h"
@@ -41,16 +39,6 @@
*/
__override void config_volteer_gpios(void)
{
- /* Legacy support for the first board build */
- if (get_board_id() == 0) {
- CPRINTS("Configuring GPIOs for board ID 0");
- CPRINTS("VOLUME_UP button disabled");
-
- /* Reassign USB_C1_RT_RST_ODL */
- bb_controls[USBC_PORT_C1].retimer_rst_gpio =
- GPIO_USB_C1_RT_RST_ODL_BOARDID_0;
- ps8xxx_rst_odl = GPIO_USB_C1_RT_RST_ODL_BOARDID_0;
- }
}
static void board_init(void)
diff --git a/board/delbin/board.h b/board/delbin/board.h
index e37689b787..0c81052f58 100644
--- a/board/delbin/board.h
+++ b/board/delbin/board.h
@@ -40,16 +40,8 @@
#define CONFIG_ACCELGYRO_BMI260_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
-/* TCS3400 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)
-
/* Sensors without hardware FIFO are in forced mode */
-#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_UPDATE
@@ -156,14 +148,9 @@ enum sensor_id {
LID_ACCEL = 0,
BASE_ACCEL,
BASE_GYRO,
- CLEAR_ALS,
- RGB_ALS,
SENSOR_COUNT,
};
-/* TODO: b/143375057 - Remove this code after power on. */
-void c10_gate_change(enum gpio_signal signal);
-
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/delbin/gpio.inc b/board/delbin/gpio.inc
index 4958d1a6da..7f476b36c9 100644
--- a/board/delbin/gpio.inc
+++ b/board/delbin/gpio.inc
@@ -31,7 +31,6 @@ GPIO_INT(PG_EC_ALL_SYS_PWRGD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt
/* Sensor Interrupts */
GPIO_INT(EC_IMU_INT_L, PIN(5, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi260_interrupt)
-GPIO_INT(EC_ALS_RGB_INT_L, PIN(D, 4), GPIO_INT_FALLING, tcs3400_interrupt)
GPIO_INT(TABLET_MODE_L, PIN(9, 5), GPIO_INT_BOTH, gmr_tablet_switch_isr)
/* USB-C interrupts */
@@ -97,20 +96,16 @@ GPIO(EC_PCH_INT_ODL, PIN(B, 0), GPIO_ODR_HIGH)
GPIO(EN_PP5000_USBA, PIN(C, 6), GPIO_OUT_LOW) /* Enable USB-A charging - all ports */
GPIO(USB_A_LOW_PWR_OD, PIN(6, 6), GPIO_ODR_LOW) /* Don't limit USB-A charging by default - all ports */
-/*
- * USB_C1 moved from GPIO32 to GPIO83 on boards with board ID >=1.
- * GPIO83/EN_PP1800_A is DNS on board ID 0 and GPIO32 is N/C on board ID >=1
- * so it's safe to define GPIOs compatible with both designs.
- * TODO (b/149858568): remove board ID=0 support.
- */
-GPIO(USB_C1_RT_RST_ODL_BOARDID_0, PIN(3, 2), GPIO_ODR_LOW) /* USB_C1 Reset on boards without board ID */
-GPIO(USB_C1_RT_RST_ODL, PIN(8, 3), GPIO_ODR_LOW) /* USB_C1 Reset on boards board ID >=1 */
+GPIO(USB_C0_RT_RST_ODL, PIN(D, 4), GPIO_ODR_LOW)
+GPIO(USB_C1_RT_RST_ODL, PIN(8, 3), GPIO_ODR_LOW)
GPIO(USB_C0_OC_ODL, PIN(B, 1), GPIO_ODR_HIGH)
GPIO(USB_C1_OC_ODL, PIN(5, 0), GPIO_ODR_HIGH)
/* Don't have a load switch for retimer */
+UNIMPLEMENTED(USB_C0_LS_EN)
UNIMPLEMENTED(USB_C1_LS_EN)
/* Retimer Force Power enable is connected to AP */
+UNIMPLEMENTED(USB_C0_RT_FORCE_PWR)
UNIMPLEMENTED(USB_C1_RT_FORCE_PWR)
/* Misc Signals */
diff --git a/board/delbin/sensors.c b/board/delbin/sensors.c
index 9e34812131..03f8f2ffab 100644
--- a/board/delbin/sensors.c
+++ b/board/delbin/sensors.c
@@ -9,8 +9,6 @@
#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_bmi_common.h"
#include "driver/accelgyro_bmi260.h"
-#include "driver/als_tcs3400.h"
-#include "driver/sync.h"
#include "keyboard_scan.h"
#include "hooks.h"
#include "i2c.h"
@@ -29,60 +27,6 @@ static struct accelgyro_saved_data_t g_bma253_data;
/* BMI260 private data */
static struct bmi_drv_data_t g_bmi260_data;
-/* TCS3400 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 from VPD */
- .cover_scale = ALS_CHANNEL_SCALE(1.0), /* CT */
- },
-};
-
-/*
- * TODO: b/146166425 need to calibrate ALS/RGB sensor. At default settings,
- * shining phone flashlight on sensor pegs all readings at 0xFFFF.
- */
-static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = {
- .calibration.rgb_cal[X] = {
- .offset = 0,
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(0),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kr */
- .cover_scale = ALS_CHANNEL_SCALE(1.0)
- }
- },
- .calibration.rgb_cal[Y] = {
- .offset = 0,
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(0),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kg */
- .cover_scale = ALS_CHANNEL_SCALE(1.0)
- },
- },
- .calibration.rgb_cal[Z] = {
- .offset = 0,
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(0),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kb */
- .cover_scale = ALS_CHANNEL_SCALE(1.0)
- }
- },
- .calibration.irt = INT_TO_FP(1),
- .saturation.again = TCS_DEFAULT_AGAIN,
- .saturation.atime = TCS_DEFAULT_ATIME,
-};
-
/* Rotation matrix for the lid accelerometer */
static const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(1), 0, 0},
@@ -168,58 +112,13 @@ struct motion_sensor_t motion_sensors[] = {
.min_frequency = BMI_GYRO_MIN_FREQ,
.max_frequency = BMI_GYRO_MAX_FREQ,
},
- [CLEAR_ALS] = {
- .name = "Clear Light",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_TCS3400,
- .type = MOTIONSENSE_TYPE_LIGHT,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &tcs3400_drv,
- .drv_data = &g_tcs3400_data,
- .port = I2C_PORT_SENSOR,
- .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_BASE,
- .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);
-
static void baseboard_sensors_init(void)
{
/* Note - BMA253 interrupt unused by EC */
- /* Enable interrupt for the TCS3400 color light sensor */
- gpio_enable_interrupt(GPIO_EC_ALS_RGB_INT_L);
/* Enable interrupt for the BMI260 accel/gyro sensor */
gpio_enable_interrupt(GPIO_EC_IMU_INT_L);
}