diff options
Diffstat (limited to 'driver/sensorhub_lsm6dsm.c')
-rw-r--r-- | driver/sensorhub_lsm6dsm.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/driver/sensorhub_lsm6dsm.c b/driver/sensorhub_lsm6dsm.c index c9989b8c0b..f663f5a5ae 100644 --- a/driver/sensorhub_lsm6dsm.c +++ b/driver/sensorhub_lsm6dsm.c @@ -188,39 +188,12 @@ static int config_slv0_read(const struct motion_sensor_t *s, uint8_t addr, return EC_SUCCESS; } -int sensorhub_set_ext_data_rate(const struct motion_sensor_t *s, - int rate, int rnd, int *ret_rate) -{ - int xl_rate; - int ret = EC_SUCCESS; - - if (!s || s->parent) - return EC_ERROR_INVAL; - - xl_rate = st_get_data_rate(s); - *ret_rate = MIN(rate, xl_rate); -#ifdef CONFIG_ACCEL_FIFO - ret = accelgyro_fifo_disable(s); - if (ret != EC_SUCCESS) - return ret; - /* - * NOTE: the ODR on the pass-through sensor does not currently change. - * If it does, that step needs to be performed here - */ - ret = accelgyro_fifo_enable(s); -#endif - return ret; -} - int sensorhub_config_ext_reg(const struct motion_sensor_t *s, uint8_t slv_addr, uint8_t reg, uint8_t val) { int ret; int tmp; - if (!s || s->parent) - return EC_ERROR_INVAL; - ret = enable_i2c_pass_through(s, &tmp); if (ret != EC_SUCCESS) { CPRINTF("%s: %s type:0x%x ENI2C error ret: %d\n", @@ -239,9 +212,6 @@ int sensorhub_config_slv0_read(const struct motion_sensor_t *s, int tmp_xl_cfg; int ret; - if (!s || s->parent) - return EC_ERROR_INVAL; - if (len <= 0 || len > OUT_XYZ_SIZE) { CPRINTF("%s: %s type:0x%x Invalid length: %d\n", __func__, s->name, s->type, len); @@ -288,14 +258,10 @@ out_restore_ctrl1: return ret; } -int sensorhub_slv0_data_read(const struct motion_sensor_t *s, intv3_t v) +int sensorhub_slv0_data_read(const struct motion_sensor_t *s, uint8_t *raw) { - uint8_t raw[OUT_XYZ_SIZE]; int ret; - if (!s || s->parent) - return EC_ERROR_INVAL; - /* * Accel/Gyro is already reading slave 0 data into the sensorhub1 * register as soon as the accel is in power-up mode. So return the @@ -308,9 +274,6 @@ int sensorhub_slv0_data_read(const struct motion_sensor_t *s, intv3_t v) __func__, s->name, s->type, ret); return ret; } - - /* Apply precision, sensitivity and rotation vector */ - st_normalize(s, v, raw); return EC_SUCCESS; } @@ -321,9 +284,6 @@ int sensorhub_check_and_rst(const struct motion_sensor_t *s, uint8_t slv_addr, int ret, tmp; int tmp_master_cfg; - if (!s || s->parent) - return EC_ERROR_INVAL; - ret = enable_i2c_pass_through(s, &tmp_master_cfg); if (ret != EC_SUCCESS) { CPRINTF("%s: %s type:0x%x ENI2C error ret: %d\n", |