driver/accel_bma4xx.c: Format with clang-format
BRANCH=none
TEST=none
@@ -97,9 +97,8 @@ static int set_foc_config(struct motion_sensor_t *s)
BMA4_NV_ACCEL_OFFSET_MSK));
/* Set accelerometer configurations to 50Hz,CIC, continuous mode */
- RETURN_ERROR(bma4_write8(s, BMA4_ACCEL_CONFIG_ADDR,
- BMA4_FOC_ACC_CONF_VAL));
-
+ RETURN_ERROR(
+ bma4_write8(s, BMA4_ACCEL_CONFIG_ADDR, BMA4_FOC_ACC_CONF_VAL));
/* Set accelerometer to normal mode by enabling it */
RETURN_ERROR(bma4_set_reg8(s, BMA4_POWER_CTRL_ADDR,
@@ -107,9 +106,9 @@ static int set_foc_config(struct motion_sensor_t *s)
BMA4_ACCEL_ENABLE_MSK));
/* Disable advance power save mode */
- RETURN_ERROR(bma4_set_reg8(s, BMA4_POWER_CONF_ADDR,
- (BMA4_DISABLE
- << BMA4_ADVANCE_POWER_SAVE_POS),
+ RETURN_ERROR(
+ bma4_set_reg8(s, BMA4_POWER_CONF_ADDR,
+ (BMA4_DISABLE << BMA4_ADVANCE_POWER_SAVE_POS),
BMA4_ADVANCE_POWER_SAVE_MSK));
return EC_SUCCESS;
@@ -142,8 +141,8 @@ static int wait_and_read_data(struct motion_sensor_t *s, intv3_t v)
BMA4_DATA_8_ADDR, reg_data, 6));
for (i = X; i <= Z; i++) {
- v[i] = (((int8_t)reg_data[i * 2 + 1]) << 8)
- | (reg_data[i * 2] & 0xf0);
+ v[i] = (((int8_t)reg_data[i * 2 + 1]) << 8) |
+ (reg_data[i * 2] & 0xf0);
/* Since the resolution is only 12 bits*/
v[i] = (v[i] / 0x10);
@@ -181,8 +180,10 @@ static int8_t perform_accel_foc(struct motion_sensor_t *s, int *target,
* (unit of offset:mg)
*/
for (i = X; i <= Z; ++i) {
- offset[i] = ((((delta_value[i] * 1000 * sens_range)
- / sample_count) / 2048) * -1);
+ offset[i] = ((((delta_value[i] * 1000 * sens_range) /
+ sample_count) /
+ 2048) *
+ -1);
}
RETURN_ERROR(write_accel_offset(s, offset));
@@ -366,8 +367,8 @@ static int read(const struct motion_sensor_t *s, intv3_t v)
mutex_lock(s->mutex);
/* Read 6 bytes starting at X_AXIS_LSB. */
- ret = i2c_read_block(s->port, s->i2c_spi_addr_flags,
- BMA4_DATA_8_ADDR, acc, 6);
+ ret = i2c_read_block(s->port, s->i2c_spi_addr_flags, BMA4_DATA_8_ADDR,
+ acc, 6);
mutex_unlock(s->mutex);
