summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 14:54:09 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-28 10:13:46 +0000
commitd493acf537b2a88f7090e7d269242ea8d9e037d6 (patch)
tree6399218e63cfb0c0bbca586826826dcac4608c7a
parent13e3ad21e0003042c662f46fffb8aa6cca2cc0c8 (diff)
downloadchrome-ec-d493acf537b2a88f7090e7d269242ea8d9e037d6.tar.gz
driver/stm_mems_common.h: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I601b6d77a7bb0783689a23c2e46cc9e7e6208442 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730065 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--driver/stm_mems_common.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/driver/stm_mems_common.h b/driver/stm_mems_common.h
index 1c0afbc9f4..75377cabbf 100644
--- a/driver/stm_mems_common.h
+++ b/driver/stm_mems_common.h
@@ -15,25 +15,25 @@
#include "i2c.h"
/* X, Y, Z axis data len */
-#define OUT_XYZ_SIZE 6
+#define OUT_XYZ_SIZE 6
-#define ST_NORMALIZE_RATE(_fs) (1 << __fls(_fs))
+#define ST_NORMALIZE_RATE(_fs) (1 << __fls(_fs))
-#define FIFO_BUFFER_NUM_PATTERN 8
+#define FIFO_BUFFER_NUM_PATTERN 8
/* Define number of data to be read from FIFO each time
* It must be a multiple of OUT_XYZ_SIZE.
* In case of LSM6DSM FIFO contains pattern depending ODR
* of Acc/gyro, be sure that FIFO can contains almost
* FIFO_BUFFER_NUM_PATTERNpattern
*/
-#define FIFO_READ_LEN (FIFO_BUFFER_NUM_PATTERN * OUT_XYZ_SIZE)
+#define FIFO_READ_LEN (FIFO_BUFFER_NUM_PATTERN * OUT_XYZ_SIZE)
/**
* Read single register
*/
static inline int st_raw_read8(const int port,
- const uint16_t i2c_spi_addr_flags,
- const int reg, int *data_ptr)
+ const uint16_t i2c_spi_addr_flags, const int reg,
+ int *data_ptr)
{
/* TODO: Implement SPI interface support */
return i2c_read8(port, i2c_spi_addr_flags, reg, data_ptr);
@@ -53,18 +53,16 @@ static inline int st_raw_write8(const int port,
/**
* st_raw_read_n - Read n bytes for read
*/
-int st_raw_read_n(const int port,
- const uint16_t i2c_spi_addr_flags,
+int st_raw_read_n(const int port, const uint16_t i2c_spi_addr_flags,
const uint8_t reg, uint8_t *data_ptr, const int len);
/**
* st_raw_read_n_noinc - Read n bytes for read (no auto inc address)
*/
-int st_raw_read_n_noinc(const int port,
- const uint16_t i2c_spi_addr_flags,
+int st_raw_read_n_noinc(const int port, const uint16_t i2c_spi_addr_flags,
const uint8_t reg, uint8_t *data_ptr, const int len);
- /**
+/**
* st_write_data_with_mask - Write register with mask
* @s: Motion sensor pointer
* @reg: Device register
@@ -72,9 +70,9 @@ int st_raw_read_n_noinc(const int port,
* @data: Data pointer
*/
int st_write_data_with_mask(const struct motion_sensor_t *s, int reg,
- uint8_t mask, uint8_t data);
+ uint8_t mask, uint8_t data);
- /**
+/**
* st_get_resolution - Get bit resolution
* @s: Motion sensor pointer
*/
@@ -86,8 +84,8 @@ int st_get_resolution(const struct motion_sensor_t *s);
* @offset: offset vector
* @temp: Temp
*/
-int st_set_offset(const struct motion_sensor_t *s,
- const int16_t *offset, int16_t temp);
+int st_set_offset(const struct motion_sensor_t *s, const int16_t *offset,
+ int16_t temp);
/**
* st_get_offset - Get data offset
@@ -95,8 +93,8 @@ int st_set_offset(const struct motion_sensor_t *s,
* @offset: offset vector
* @temp: Temp
*/
-int st_get_offset(const struct motion_sensor_t *s,
- int16_t *offset, int16_t *temp);
+int st_get_offset(const struct motion_sensor_t *s, int16_t *offset,
+ int16_t *temp);
/**
* st_get_data_rate - Get data rate (ODR)
@@ -115,8 +113,8 @@ void st_normalize(const struct motion_sensor_t *s, intv3_t v, uint8_t *data);
/* Internal data structure for sensors */
struct stprivate_data {
struct accelgyro_saved_data_t base;
- uint8_t enabled_activities;
- uint8_t disabled_activities;
+ uint8_t enabled_activities;
+ uint8_t disabled_activities;
int16_t offset[3];
uint8_t resol;
};