summaryrefslogtreecommitdiff
path: root/driver/stm_mems_common.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-05-03 09:41:17 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-05-04 03:01:57 -0700
commit5df15c0b254bfa7b96c3c0db2a82ff5c9d8c0d75 (patch)
treefc6c5c371bd59ffb0fd73146424140b462f11e21 /driver/stm_mems_common.c
parent97bf820d2d3102a53f9ae8f4fea3f5c4709028d6 (diff)
downloadchrome-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.c')
-rw-r--r--driver/stm_mems_common.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/driver/stm_mems_common.c b/driver/stm_mems_common.c
index 4af0cb4a34..c7b84b5b98 100644
--- a/driver/stm_mems_common.c
+++ b/driver/stm_mems_common.c
@@ -9,24 +9,6 @@
#include "stm_mems_common.h"
/**
- * Read single register
- */
-int 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
- */
-int 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
*/
int st_raw_read_n(const int port, const int addr, const uint8_t reg,
@@ -72,7 +54,7 @@ int st_write_data_with_mask(const struct motion_sensor_t *s, int reg,
int err;
int new_data = 0x00, old_data = 0x00;
- err = raw_read8(s->port, s->addr, reg, &old_data);
+ err = st_raw_read8(s->port, s->addr, reg, &old_data);
if (err != EC_SUCCESS)
return err;
@@ -82,7 +64,7 @@ int st_write_data_with_mask(const struct motion_sensor_t *s, int reg,
if (new_data == old_data)
return EC_SUCCESS;
- return raw_write8(s->port, s->addr, reg, new_data);
+ return st_raw_write8(s->port, s->addr, reg, new_data);
}
/**