summaryrefslogtreecommitdiff
path: root/board/flapjack
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2019-05-07 12:48:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-09 16:05:59 -0700
commit2d38e7cd712834d763ff59704cd04af2a95b8367 (patch)
tree25b44b030408b514217b9c91e08fd1fe9696ae88 /board/flapjack
parentd600316362ef86d893d0f65db73e962184d8c3ce (diff)
downloadchrome-ec-2d38e7cd712834d763ff59704cd04af2a95b8367.tar.gz
tcs3400: rename tcs3400_drv_data_t to als_drv_data_t
- rename tsc3400_drv_data_t to als_drv_data_t - change tcs3400 driver to use common als_drv_data_t - change flapjack config to use common als_drv_data_t - rename TSC3400_SCALE() macro to ALS_CHANNEL_SCALE() - create and use new I2C_PORT_ALS definition - fix a couple nits BUG=b:124512628 BRANCH=master TEST=build and flash to flapjack, verify ALS and RGB still work. Change-Id: I9a45d255ff77794ef34026406c9b702a04e09c11 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/1601052 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/flapjack')
-rw-r--r--board/flapjack/board.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/board/flapjack/board.c b/board/flapjack/board.c
index b80530c41c..dd157680a6 100644
--- a/board/flapjack/board.c
+++ b/board/flapjack/board.c
@@ -417,7 +417,7 @@ static struct mutex g_lid_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
-static struct tcs3400_drv_data_t g_tcs3400_data = {
+static struct als_drv_data_t g_tcs3400_data = {
.als_cal.scale = 1,
.als_cal.uscale = 0,
.als_cal.offset = 0,
@@ -427,15 +427,15 @@ static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = {
.device_scale = 1,
.device_uscale = 0,
.rgb_cal[X] = {
- .scale = TCS3400_SCALE(1),
+ .scale = ALS_CHANNEL_SCALE(1),
.offset = 0,
},
.rgb_cal[Y] = {
- .scale = TCS3400_SCALE(1),
+ .scale = ALS_CHANNEL_SCALE(1),
.offset = 0,
},
.rgb_cal[Z] = {
- .scale = TCS3400_SCALE(1),
+ .scale = ALS_CHANNEL_SCALE(1),
.offset = 0,
},
};
@@ -500,7 +500,7 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_LID,
.drv = &tcs3400_drv,
.drv_data = &g_tcs3400_data,
- .port = I2C_PORT_ACCEL,
+ .port = I2C_PORT_ALS,
.addr = TCS3400_I2C_ADDR,
.rot_standard_ref = NULL,
.default_range = 0x10000, /* scale = 1x, uscale = 0 */
@@ -521,8 +521,7 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_LID,
.drv = &tcs3400_rgb_drv,
.drv_data = &g_tcs3400_rgb_data,
- .port = 0, /* set to 0 to generate an error if access by itself */
- .addr = TCS3400_I2C_ADDR,
+ /*.port=I2C_PORT_ALS,*/ /* Unused. RGB channels read by CLEAR_ALS. */
.rot_standard_ref = NULL,
.default_range = 0x10000, /* scale = 1x, uscale = 0 */
.min_frequency = 0, /* 0 indicates we should not use sensor directly */