diff options
author | Jett Rink <jettrink@chromium.org> | 2018-05-03 09:41:17 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-04 03:01:57 -0700 |
commit | 5df15c0b254bfa7b96c3c0db2a82ff5c9d8c0d75 (patch) | |
tree | fc6c5c371bd59ffb0fd73146424140b462f11e21 /driver/stm_mems_common.h | |
parent | 97bf820d2d3102a53f9ae8f4fea3f5c4709028d6 (diff) | |
download | chrome-ec-5df15c0b254bfa7b96c3c0db2a82ff5c9d8c0d75.tar.gz |
stm: inline raw_read8 in header file
Rename raw_read8 to st_raw_read8 and statically inline in the header
file. Removing the extern removes linker warnings when including this
header file without the driver, which happens in baseboard files.
BRANCH=none
BUG=none
TEST=including "driver/accelgyro_lsm6dsm.h" in c files that
do not link the actual driver will now compile.
Change-Id: I43f799a3b05b2343e012d43bdc9459d138ecf1b5
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1042727
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'driver/stm_mems_common.h')
-rw-r--r-- | driver/stm_mems_common.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/driver/stm_mems_common.h b/driver/stm_mems_common.h index b708812d63..a06973c08c 100644 --- a/driver/stm_mems_common.h +++ b/driver/stm_mems_common.h @@ -34,14 +34,22 @@ /** * Read single register */ -extern inline int raw_read8(const int port, const int addr, const int reg, - int *data_ptr); +static inline int st_raw_read8(const int port, const int addr, const int reg, + int *data_ptr) +{ + /* TODO: Implement SPI interface support */ + return i2c_read8(port, addr, reg, data_ptr); +} /** * Write single register */ -extern inline int raw_write8(const int port, const int addr, const int reg, - int data); +static inline int st_raw_write8(const int port, const int addr, const int reg, + int data) +{ + /* TODO: Implement SPI interface support */ + return i2c_write8(port, addr, reg, data); +} /** * st_raw_read_n - Read n bytes for read |