summaryrefslogtreecommitdiff
path: root/driver/battery
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-07-16 15:10:11 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-20 23:09:18 +0000
commit473bd883b60fd5b00377766dae2bacad246de0d2 (patch)
tree992d9f03104277934c22c869eceb634e2cf5f7ec /driver/battery
parent053491b560d2c4e374bb739373d8ae25c41f6315 (diff)
downloadchrome-ec-473bd883b60fd5b00377766dae2bacad246de0d2.tar.gz
Remove __7b, __8b and __7bf
The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'driver/battery')
-rw-r--r--driver/battery/bq27541.c2
-rw-r--r--driver/battery/bq27621_g1.c2
-rw-r--r--driver/battery/max17055.c4
-rw-r--r--driver/battery/max17055.h2
-rw-r--r--driver/battery/mm8013.c4
-rw-r--r--driver/battery/mm8013.h2
-rw-r--r--driver/battery/smart.c8
7 files changed, 12 insertions, 12 deletions
diff --git a/driver/battery/bq27541.c b/driver/battery/bq27541.c
index c41914f4e8..b9c80c3b24 100644
--- a/driver/battery/bq27541.c
+++ b/driver/battery/bq27541.c
@@ -12,7 +12,7 @@
#include "i2c.h"
#include "util.h"
-#define BQ27541_ADDR__7bf 0x55
+#define BQ27541_ADDR_FLAGS 0x55
#define BQ27541_TYPE_ID 0x0541
#define BQ27741_TYPE_ID 0x0741
#define BQ27742_TYPE_ID 0x0742
diff --git a/driver/battery/bq27621_g1.c b/driver/battery/bq27621_g1.c
index 76d020f6df..8445516600 100644
--- a/driver/battery/bq27621_g1.c
+++ b/driver/battery/bq27621_g1.c
@@ -13,7 +13,7 @@
#include "util.h"
#include "timer.h"
-#define BQ27621_ADDR__7bf 0x55
+#define BQ27621_ADDR_FLAGS 0x55
#define BQ27621_TYPE_ID 0x0621
#define REG_CTRL 0x00
diff --git a/driver/battery/max17055.c b/driver/battery/max17055.c
index 90ceb12214..35fd63b445 100644
--- a/driver/battery/max17055.c
+++ b/driver/battery/max17055.c
@@ -66,13 +66,13 @@ static int fake_state_of_charge = -1;
static int max17055_read(int offset, int *data)
{
- return i2c_read16__7bf(I2C_PORT_BATTERY, MAX17055_ADDR__7bf,
+ return i2c_read16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS,
offset, data);
}
static int max17055_write(int offset, int data)
{
- return i2c_write16__7bf(I2C_PORT_BATTERY, MAX17055_ADDR__7bf,
+ return i2c_write16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS,
offset, data);
}
diff --git a/driver/battery/max17055.h b/driver/battery/max17055.h
index ce10b8ebf0..0f97fb90f0 100644
--- a/driver/battery/max17055.h
+++ b/driver/battery/max17055.h
@@ -8,7 +8,7 @@
#ifndef __CROS_EC_MAX17055_H
#define __CROS_EC_MAX17055_H
-#define MAX17055_ADDR__7bf 0x36
+#define MAX17055_ADDR_FLAGS 0x36
#define MAX17055_DEVICE_ID 0x4010
#define MAX17055_OCV_TABLE_SIZE 48
diff --git a/driver/battery/mm8013.c b/driver/battery/mm8013.c
index 87926553db..d7fba89076 100644
--- a/driver/battery/mm8013.c
+++ b/driver/battery/mm8013.c
@@ -23,7 +23,7 @@ static int mm8013_read16(int offset, int *data)
int rv;
*data = 0;
- rv = i2c_read16__7bf(I2C_PORT_BATTERY, MM8013_ADDR__7bf, offset, data);
+ rv = i2c_read16(I2C_PORT_BATTERY, MM8013_ADDR_FLAGS, offset, data);
usleep(I2C_WAIT_TIME);
if (rv)
return rv;
@@ -34,7 +34,7 @@ static int mm8013_read_block(int offset, uint8_t *data, int len)
{
int rv;
- rv = i2c_read_block__7bf(I2C_PORT_BATTERY, MM8013_ADDR__7bf,
+ rv = i2c_read_block(I2C_PORT_BATTERY, MM8013_ADDR_FLAGS,
offset, data, len);
usleep(I2C_WAIT_TIME);
if (rv)
diff --git a/driver/battery/mm8013.h b/driver/battery/mm8013.h
index 5acdcdff68..2ffaca7b5d 100644
--- a/driver/battery/mm8013.h
+++ b/driver/battery/mm8013.h
@@ -8,7 +8,7 @@
#ifndef __CROS_EC_MM8013_H
#define __CROS_EC_MM8013_H
-#define MM8013_ADDR__7bf 0x55
+#define MM8013_ADDR_FLAGS 0x55
#define REG_TEMPERATURE 0x06
#define REG_VOLTAGE 0x08
diff --git a/driver/battery/smart.c b/driver/battery/smart.c
index ced1e7cfc3..50a29cfeff 100644
--- a/driver/battery/smart.c
+++ b/driver/battery/smart.c
@@ -31,7 +31,7 @@ test_mockable int sb_read(int cmd, int *param)
return EC_RES_ACCESS_DENIED;
#endif
- return i2c_read16__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf,
+ return i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS,
cmd, param);
}
@@ -45,7 +45,7 @@ test_mockable int sb_write(int cmd, int param)
return EC_RES_ACCESS_DENIED;
#endif
- return i2c_write16__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf,
+ return i2c_write16(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS,
cmd, param);
}
@@ -59,7 +59,7 @@ int sb_read_string(int offset, uint8_t *data, int len)
return EC_RES_ACCESS_DENIED;
#endif
- return i2c_read_string__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf,
+ return i2c_read_string(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS,
offset, data, len);
}
@@ -104,7 +104,7 @@ int sb_write_block(int reg, const uint8_t *val, int len)
#endif
/* TODO: implement smbus_write_block. */
- return i2c_write_block__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf,
+ return i2c_write_block(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS,
reg, val, len);
}