summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2016-03-30 16:42:40 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-03-31 21:35:56 -0700
commit6711629163f23a98099d8c6d37f6cdb1ef56ca52 (patch)
tree9529c236985d9ad64d23c4d0b1b8328d1be81b8f /board
parent59c03bc4c644b0f0bbf3c6807a97755b7509b319 (diff)
downloadchrome-ec-6711629163f23a98099d8c6d37f6cdb1ef56ca52.tar.gz
sensor: update sensor driver to use I2C port from motion_sensor_t
this allow motion sensor devices to be locate on different I2C port BUG=none BRANCH=none TEST=make buildall Change-Id: Ia7ba2f5729ebb19561768ec87fdb267e79aafb6a Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/334269 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/glados/board.c3
-rw-r--r--board/kunimitsu/board.c3
-rw-r--r--board/lars/board.c2
-rw-r--r--board/oak/board.c3
-rw-r--r--board/ryu/board.c4
-rw-r--r--board/samus/board.c3
-rw-r--r--board/strago/board.c2
-rw-r--r--board/wheatley/board.c3
8 files changed, 23 insertions, 0 deletions
diff --git a/board/glados/board.c b/board/glados/board.c
index 37e00dbc06..892d5ed425 100644
--- a/board/glados/board.c
+++ b/board/glados/board.c
@@ -502,6 +502,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.rot_standard_ref = NULL, /* Identity matrix. */
.default_range = 2, /* g, enough for laptop. */
@@ -537,6 +538,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.default_range = 1000, /* dps */
.rot_standard_ref = NULL, /* Identity Matrix. */
@@ -572,6 +574,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_kx022_data,
+ .port = I2C_PORT_ACCEL,
.addr = KX022_ADDR1,
.rot_standard_ref = NULL, /* Identity matrix. */
.default_range = 2, /* g, enough for laptop. */
diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c
index f092b86b63..1a1072c909 100644
--- a/board/kunimitsu/board.c
+++ b/board/kunimitsu/board.c
@@ -233,6 +233,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[0],
.drv_data = &g_kxcj9_data[0],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR1,
.rot_standard_ref = &base_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -267,6 +268,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[1],
.drv_data = &g_kxcj9_data[1],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR0,
.rot_standard_ref = &lid_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -302,6 +304,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &l3gd20h_drv,
.mutex = &g_l3gd20h_mutex,
.drv_data = &g_l3gd20h_data,
+ .port = I2C_PORT_GYRO,
.addr = L3GD20_ADDR1,
.rot_standard_ref = NULL,
.default_range = 2000, /* DPS */
diff --git a/board/lars/board.c b/board/lars/board.c
index 45ff877a7d..ec06604c56 100644
--- a/board/lars/board.c
+++ b/board/lars/board.c
@@ -203,6 +203,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[0],
.drv_data = &g_kxcj9_data[0],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR1,
.rot_standard_ref = &base_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -237,6 +238,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[1],
.drv_data = &g_kxcj9_data[1],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR0,
.rot_standard_ref = &lid_standard_ref,
.default_range = 2, /* g, enough for laptop. */
diff --git a/board/oak/board.c b/board/oak/board.c
index 420f423aec..4ab2c5c217 100644
--- a/board/oak/board.c
+++ b/board/oak/board.c
@@ -675,6 +675,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = 1,
.rot_standard_ref = &base_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -710,6 +711,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = 1,
.default_range = 1000, /* dps */
.rot_standard_ref = NULL, /* Identity Matrix. */
@@ -746,6 +748,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_kx022_data,
+ .port = I2C_PORT_ACCEL,
.addr = KX022_ADDR1,
.rot_standard_ref = NULL, /* Identity matrix. */
.default_range = 2, /* g, enough for laptop. */
diff --git a/board/ryu/board.c b/board/ryu/board.c
index a6712aa21b..aa59a6778a 100644
--- a/board/ryu/board.c
+++ b/board/ryu/board.c
@@ -298,6 +298,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.rot_standard_ref = &accelgyro_standard_ref,
.default_range = 8, /* g, use hifi requirements */
@@ -332,6 +333,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.default_range = 1000, /* dps, use hifi requirement */
.rot_standard_ref = &accelgyro_standard_ref,
@@ -366,6 +368,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.rot_standard_ref = &mag_standard_ref,
.default_range = 1 << 11, /* 16LSB / uT, fixed */
@@ -434,6 +437,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &si114x_drv,
.mutex = &g_mutex,
.drv_data = &g_si114x_data,
+ .port = I2C_PORT_ALS,
.addr = SI114X_ADDR,
.rot_standard_ref = NULL,
.default_range = 7630, /* Upon testing at desk */
diff --git a/board/samus/board.c b/board/samus/board.c
index 84cadf1042..5257899ecc 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -309,6 +309,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &lsm6ds0_drv,
.mutex = &g_base_mutex,
.drv_data = &g_saved_data[0],
+ .port = I2C_PORT_ACCEL,
.addr = LSM6DS0_ADDR1,
.rot_standard_ref = &base_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -343,6 +344,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_kxcj9_data,
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR0,
.rot_standard_ref = &lid_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -377,6 +379,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &lsm6ds0_drv,
.mutex = &g_base_mutex,
.drv_data = &g_saved_data[1],
+ .port = I2C_PORT_ACCEL,
.addr = LSM6DS0_ADDR1,
.rot_standard_ref = NULL,
.default_range = 2000, /* g, enough for laptop. */
diff --git a/board/strago/board.c b/board/strago/board.c
index 6f49040a9f..fb40fb9a18 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -220,6 +220,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[0],
.drv_data = &g_kxcj9_data[0],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR1,
.rot_standard_ref = &base_standard_ref,
.default_range = 2, /* g, enough for laptop. */
@@ -254,6 +255,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_kxcj9_mutex[1],
.drv_data = &g_kxcj9_data[1],
+ .port = I2C_PORT_ACCEL,
.addr = KXCJ9_ADDR0,
.rot_standard_ref = &lid_standard_ref,
.default_range = 2, /* g, enough for laptop. */
diff --git a/board/wheatley/board.c b/board/wheatley/board.c
index 987bc6db6d..a276d4344d 100644
--- a/board/wheatley/board.c
+++ b/board/wheatley/board.c
@@ -476,6 +476,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL
.addr = BMI160_ADDR0,
.rot_standard_ref = NULL, /* Identity matrix. */
.default_range = 2, /* g, enough for laptop. */
@@ -511,6 +512,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &bmi160_drv,
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
+ .port = I2C_PORT_ACCEL,
.addr = BMI160_ADDR0,
.default_range = 1000, /* dps */
.rot_standard_ref = NULL, /* Identity Matrix. */
@@ -546,6 +548,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &kionix_accel_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_kx022_data,
+ .port = I2C_PORT_ACCEL,
.addr = KX022_ADDR1,
.rot_standard_ref = NULL, /* Identity matrix. */
.default_range = 2, /* g, enough for laptop. */