summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-03-13 10:37:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-03-15 21:23:30 -0700
commite0a2a98b69a06fa56b30a88e87d9720c0cd2b533 (patch)
tree2c19ceb78f228e684710e2c7d22e544eccd0cd3e /driver
parentc63bb63b5a8a23d81b3c96adbb0c361a4c1af255 (diff)
downloadchrome-ec-e0a2a98b69a06fa56b30a88e87d9720c0cd2b533.tar.gz
driver: sensor: Remove set_resolution when NOOP
set_resolution is only used for few sensors and is not exposed to the AP. Remove definition when sensors have a fixed resolution. BUG=none BRANCH=master TEST=compile, kevin has enough space for perform_calib. Change-Id: I8482387e135356467edaee44da3a0e47cf1db524 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/961222 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/accel_bma2x2.c12
-rw-r--r--driver/accel_lis2dh.c1
-rw-r--r--driver/accelgyro_bmi160.c9
-rw-r--r--driver/accelgyro_lsm6ds0.c9
-rw-r--r--driver/accelgyro_lsm6dsm.c8
-rw-r--r--driver/gyro_l3gd20h.c10
-rw-r--r--driver/stm_mems_common.c13
-rw-r--r--driver/stm_mems_common.h8
8 files changed, 0 insertions, 70 deletions
diff --git a/driver/accel_bma2x2.c b/driver/accel_bma2x2.c
index 8511cbfec5..eecae02357 100644
--- a/driver/accel_bma2x2.c
+++ b/driver/accel_bma2x2.c
@@ -93,12 +93,6 @@ static int get_range(const struct motion_sensor_t *s)
return data->sensor_range;
}
-static int set_resolution(const struct motion_sensor_t *s, int res, int rnd)
-{
- /* Only one resolution, BMA2x2_RESOLUTION, so nothing to do. */
- return EC_SUCCESS;
-}
-
static int get_resolution(const struct motion_sensor_t *s)
{
return BMA2x2_RESOLUTION;
@@ -252,11 +246,6 @@ static int init(const struct motion_sensor_t *s)
} while (1);
mutex_unlock(s->mutex);
- /* Initialize with the desired parameters. */
- ret = set_resolution(s, 12, 1);
- if (ret != EC_SUCCESS)
- return ret;
-
return sensor_init_done(s);
}
@@ -265,7 +254,6 @@ const struct accelgyro_drv bma2x2_accel_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = set_resolution,
.get_resolution = get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = get_data_rate,
diff --git a/driver/accel_lis2dh.c b/driver/accel_lis2dh.c
index 0393d95429..017621ff6a 100644
--- a/driver/accel_lis2dh.c
+++ b/driver/accel_lis2dh.c
@@ -397,7 +397,6 @@ const struct accelgyro_drv lis2dh_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = st_set_resolution,
.get_resolution = st_get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = st_get_data_rate,
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c
index 72b8b2a902..20a6a65a79 100644
--- a/driver/accelgyro_bmi160.c
+++ b/driver/accelgyro_bmi160.c
@@ -348,14 +348,6 @@ static int get_range(const struct motion_sensor_t *s)
return data->range;
}
-static int set_resolution(const struct motion_sensor_t *s,
- int res,
- int rnd)
-{
- /* Only one resolution, BMI160_RESOLUTION, so nothing to do. */
- return EC_SUCCESS;
-}
-
static int get_resolution(const struct motion_sensor_t *s)
{
return BMI160_RESOLUTION;
@@ -1308,7 +1300,6 @@ const struct accelgyro_drv bmi160_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = set_resolution,
.get_resolution = get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = get_data_rate,
diff --git a/driver/accelgyro_lsm6ds0.c b/driver/accelgyro_lsm6ds0.c
index 86232f93e6..cf2eb78ff4 100644
--- a/driver/accelgyro_lsm6ds0.c
+++ b/driver/accelgyro_lsm6ds0.c
@@ -209,14 +209,6 @@ static int get_range(const struct motion_sensor_t *s)
return data->base.range;
}
-static int set_resolution(const struct motion_sensor_t *s,
- int res,
- int rnd)
-{
- /* Only one resolution, LSM6DS0_RESOLUTION, so nothing to do. */
- return EC_SUCCESS;
-}
-
static int get_resolution(const struct motion_sensor_t *s)
{
return LSM6DS0_RESOLUTION;
@@ -427,7 +419,6 @@ const struct accelgyro_drv lsm6ds0_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = set_resolution,
.get_resolution = get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = get_data_rate,
diff --git a/driver/accelgyro_lsm6dsm.c b/driver/accelgyro_lsm6dsm.c
index d4466d5482..c685615f9f 100644
--- a/driver/accelgyro_lsm6dsm.c
+++ b/driver/accelgyro_lsm6dsm.c
@@ -124,12 +124,6 @@ static int get_range(const struct motion_sensor_t *s)
return LSM6DSM_GYRO_GAIN_FS(data->base.range);
}
-static int set_resolution(const struct motion_sensor_t *s, int res, int rnd)
-{
- /* Only one resolution, LSM6DSM_RESOLUTION, so nothing to do. */
- return EC_SUCCESS;
-}
-
static int get_resolution(const struct motion_sensor_t *s)
{
/* Only one resolution, LSM6DSM_RESOLUTION, so nothing to do. */
@@ -338,11 +332,9 @@ const struct accelgyro_drv lsm6dsm_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = set_resolution,
.get_resolution = get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = get_data_rate,
.set_offset = set_offset,
.get_offset = get_offset,
- .perform_calib = NULL,
};
diff --git a/driver/gyro_l3gd20h.c b/driver/gyro_l3gd20h.c
index 53ee98961f..2c7e9b11da 100644
--- a/driver/gyro_l3gd20h.c
+++ b/driver/gyro_l3gd20h.c
@@ -177,14 +177,6 @@ static int get_range(const struct motion_sensor_t *s)
return data->base.range;
}
-static int set_resolution(const struct motion_sensor_t *s,
- int res,
- int rnd)
-{
- /* Only one resolution, L3GD20_RESOLUTION, so nothing to do. */
- return EC_SUCCESS;
-}
-
static int get_resolution(const struct motion_sensor_t *s)
{
return L3GD20_RESOLUTION;
@@ -409,11 +401,9 @@ const struct accelgyro_drv l3gd20h_drv = {
.read = read,
.set_range = set_range,
.get_range = get_range,
- .set_resolution = set_resolution,
.get_resolution = get_resolution,
.set_data_rate = set_data_rate,
.get_data_rate = get_data_rate,
.set_offset = set_offset,
.get_offset = get_offset,
- .perform_calib = NULL,
};
diff --git a/driver/stm_mems_common.c b/driver/stm_mems_common.c
index 4655171b23..afffba2d25 100644
--- a/driver/stm_mems_common.c
+++ b/driver/stm_mems_common.c
@@ -73,19 +73,6 @@ int st_write_data_with_mask(const struct motion_sensor_t *s, int reg,
}
/**
- * set_resolution - Set bit resolution
- * @s: Motion sensor pointer
- * @res: Bit resolution
- * @rnd: Round bit
- *
- * TODO: must support multiple resolution
- */
-int st_set_resolution(const struct motion_sensor_t *s, int res, int rnd)
-{
- return EC_SUCCESS;
-}
-
- /**
* get_resolution - Get bit resolution
* @s: Motion sensor pointer
*
diff --git a/driver/stm_mems_common.h b/driver/stm_mems_common.h
index 5fa16936b7..848c3d4825 100644
--- a/driver/stm_mems_common.h
+++ b/driver/stm_mems_common.h
@@ -61,14 +61,6 @@ int st_write_data_with_mask(const struct motion_sensor_t *s, int reg,
uint8_t mask, uint8_t data);
/**
- * set_resolution - Set bit resolution
- * @s: Motion sensor pointer
- * @res: Bit resolution
- * @rnd: Round bit
- */
-int st_set_resolution(const struct motion_sensor_t *s, int res, int rnd);
-
- /**
* get_resolution - Get bit resolution
* @s: Motion sensor pointer
*