diff options
author | Scott Collyer <scollyer@google.com> | 2019-04-18 17:16:29 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-22 12:28:15 -0700 |
commit | caf50b250ef7cc08def300aaa6034af9de182139 (patch) | |
tree | c21a4d6f25709852b49e14526c137d41fa56e802 /board/kohaku/board.c | |
parent | 1aa9ec883ab4cb00e28611e6ad0441858ca18879 (diff) | |
download | chrome-ec-caf50b250ef7cc08def300aaa6034af9de182139.tar.gz |
kohaku: Add support for Rohm BH1733FVC ALS
Kohaku is not using the Rohm BH1733FVC ALS. This CL removes support
for the OPT3001 and adds support for the BH1733FVC.
BUG=b:130835790
BRANCH=none
TEST=make -j BOARD=kohaku
Change-Id: Ifc8d5f247b338057e4ec7f66f56f119fd5058613
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1574660
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'board/kohaku/board.c')
-rw-r--r-- | board/kohaku/board.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/board/kohaku/board.c b/board/kohaku/board.c index 69fce0a932..ba9ef38e62 100644 --- a/board/kohaku/board.c +++ b/board/kohaku/board.c @@ -12,7 +12,7 @@ #include "cros_board_info.h" #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi160.h" -#include "driver/als_opt3001.h" +#include "driver/als_bh1730.h" #include "driver/ppc/sn5s330.h" #include "driver/bc12/max14637.h" #include "driver/tcpm/ps8xxx.h" @@ -162,11 +162,8 @@ static struct bmi160_drv_data_t g_bmi160_data; /* BMA255 private data */ static struct accelgyro_saved_data_t g_bma255_data; -static struct opt3001_drv_data_t g_opt3001_data = { - .scale = 1, - .uscale = 0, - .offset = 0, -}; +/* BH1730 private data */ +struct bh1730_drv_data_t g_bh1730_data; /* Matrix to rotate accelrator into standard reference frame */ static const mat33_fp_t base_standard_ref = { @@ -259,22 +256,22 @@ struct motion_sensor_t motion_sensors[] = { [LID_ALS] = { .name = "Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_OPT3001, + .active_mask = SENSOR_ACTIVE_S0, + .chip = MOTIONSENSE_CHIP_BH1730, .type = MOTIONSENSE_TYPE_LIGHT, .location = MOTIONSENSE_LOC_LID, - .drv = &opt3001_drv, - .drv_data = &g_opt3001_data, + .drv = &bh1730_drv, + .drv_data = &g_bh1730_data, .port = I2C_PORT_ACCEL, - .addr = OPT3001_I2C_ADDR, + .addr = BH1730_I2C_ADDR, .rot_standard_ref = NULL, - .default_range = 0x2b11a1, - .min_frequency = OPT3001_LIGHT_MIN_FREQ, - .max_frequency = OPT3001_LIGHT_MAX_FREQ, + .default_range = 65535, + .min_frequency = 10, + .max_frequency = 10, .config = { - /* Run ALS sensor in S0 */ [SENSOR_CONFIG_EC_S0] = { - .odr = 1000, + .odr = 100000, + .ec_rate = 0, }, }, }, |