diff options
Diffstat (limited to 'driver/temp_sensor')
-rw-r--r-- | driver/temp_sensor/adt7481.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/adt7481.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/bd99992gw.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/bd99992gw.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/f75303.c | 2 | ||||
-rw-r--r-- | driver/temp_sensor/f75303.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/g78x.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/g78x.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/sb_tsi.c | 2 | ||||
-rw-r--r-- | driver/temp_sensor/sb_tsi.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/tmp006.c | 40 | ||||
-rw-r--r-- | driver/temp_sensor/tmp006.h | 10 | ||||
-rw-r--r-- | driver/temp_sensor/tmp112.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/tmp112.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/tmp411.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/tmp432.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/tmp432.h | 2 | ||||
-rw-r--r-- | driver/temp_sensor/tmp468.c | 4 | ||||
-rw-r--r-- | driver/temp_sensor/tmp468.h | 2 |
19 files changed, 48 insertions, 48 deletions
diff --git a/driver/temp_sensor/adt7481.c b/driver/temp_sensor/adt7481.c index c724e958e1..df6ff4bb7c 100644 --- a/driver/temp_sensor/adt7481.c +++ b/driver/temp_sensor/adt7481.c @@ -34,13 +34,13 @@ static int has_power(void) static int raw_read8(const int offset, int *data_ptr) { - return i2c_read8__7bf(I2C_PORT_THERMAL, ADT7481_I2C_ADDR__7bf, + return i2c_read8(I2C_PORT_THERMAL, ADT7481_I2C_ADDR_FLAGS, offset, data_ptr); } static int raw_write8(const int offset, int data) { - return i2c_write8__7bf(I2C_PORT_THERMAL, ADT7481_I2C_ADDR__7bf, + return i2c_write8(I2C_PORT_THERMAL, ADT7481_I2C_ADDR_FLAGS, offset, data); } diff --git a/driver/temp_sensor/adt7481.h b/driver/temp_sensor/adt7481.h index 17f3c20056..78541a0a3b 100644 --- a/driver/temp_sensor/adt7481.h +++ b/driver/temp_sensor/adt7481.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_ADT7481_H #define __CROS_EC_ADT7481_H -#define ADT7481_I2C_ADDR__7bf 0x4B +#define ADT7481_I2C_ADDR_FLAGS 0x4B #define ADT7481_IDX_LOCAL 0 #define ADT7481_IDX_REMOTE1 1 diff --git a/driver/temp_sensor/bd99992gw.c b/driver/temp_sensor/bd99992gw.c index 9ccbde6d8e..0fc8f094b4 100644 --- a/driver/temp_sensor/bd99992gw.c +++ b/driver/temp_sensor/bd99992gw.c @@ -39,7 +39,7 @@ static enum bd99992gw_adc_channel static int raw_read8(const int offset, int *data_ptr) { int ret; - ret = i2c_read8__7bf(I2C_PORT_THERMAL, BD99992GW_I2C_ADDR__7bf, + ret = i2c_read8(I2C_PORT_THERMAL, BD99992GW_I2C_ADDR_FLAGS, offset, data_ptr); if (ret != EC_SUCCESS) CPRINTS("bd99992gw read fail %d", ret); @@ -49,7 +49,7 @@ static int raw_read8(const int offset, int *data_ptr) static int raw_write8(const int offset, int data) { int ret; - ret = i2c_write8__7bf(I2C_PORT_THERMAL, BD99992GW_I2C_ADDR__7bf, + ret = i2c_write8(I2C_PORT_THERMAL, BD99992GW_I2C_ADDR_FLAGS, offset, data); if (ret != EC_SUCCESS) CPRINTS("bd99992gw write fail %d", ret); diff --git a/driver/temp_sensor/bd99992gw.h b/driver/temp_sensor/bd99992gw.h index 1d5aff7287..c461012c45 100644 --- a/driver/temp_sensor/bd99992gw.h +++ b/driver/temp_sensor/bd99992gw.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_TEMP_SENSOR_BD99992GW_H #define __CROS_EC_TEMP_SENSOR_BD99992GW_H -#define BD99992GW_I2C_ADDR__7bf 0x30 +#define BD99992GW_I2C_ADDR_FLAGS 0x30 /* ADC channels */ enum bd99992gw_adc_channel { diff --git a/driver/temp_sensor/f75303.c b/driver/temp_sensor/f75303.c index 794d2e865a..6b8895a252 100644 --- a/driver/temp_sensor/f75303.c +++ b/driver/temp_sensor/f75303.c @@ -20,7 +20,7 @@ static int8_t fake_temp[F75303_IDX_COUNT] = {-1, -1, -1}; */ static int raw_read8(const int offset, int *data) { - return i2c_read8__7bf(I2C_PORT_THERMAL, F75303_I2C_ADDR__7bf, + return i2c_read8(I2C_PORT_THERMAL, F75303_I2C_ADDR_FLAGS, offset, data); } diff --git a/driver/temp_sensor/f75303.h b/driver/temp_sensor/f75303.h index ea2dcdbd79..a4bdcbf872 100644 --- a/driver/temp_sensor/f75303.h +++ b/driver/temp_sensor/f75303.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_F75303_H #define __CROS_EC_F75303_H -#define F75303_I2C_ADDR__7bf 0x4C +#define F75303_I2C_ADDR_FLAGS 0x4C enum f75303_index { F75303_IDX_LOCAL = 0, diff --git a/driver/temp_sensor/g78x.c b/driver/temp_sensor/g78x.c index 0a71556b27..935586b8fa 100644 --- a/driver/temp_sensor/g78x.c +++ b/driver/temp_sensor/g78x.c @@ -35,14 +35,14 @@ static int has_power(void) static int raw_read8(const int offset, int *data_ptr) { - return i2c_read8__7bf(I2C_PORT_THERMAL, G78X_I2C_ADDR__7bf, + return i2c_read8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, offset, data_ptr); } #ifdef CONFIG_CMD_TEMP_SENSOR static int raw_write8(const int offset, int data) { - return i2c_write8__7bf(I2C_PORT_THERMAL, G78X_I2C_ADDR__7bf, + return i2c_write8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, offset, data); } #endif diff --git a/driver/temp_sensor/g78x.h b/driver/temp_sensor/g78x.h index 6d656610d9..fdd987fcbd 100644 --- a/driver/temp_sensor/g78x.h +++ b/driver/temp_sensor/g78x.h @@ -12,7 +12,7 @@ #error Cannot support both G781 and G782 together! #endif -#define G78X_I2C_ADDR__7bf 0x4C +#define G78X_I2C_ADDR_FLAGS 0x4C #define G78X_IDX_INTERNAL 0 #define G78X_IDX_EXTERNAL1 1 diff --git a/driver/temp_sensor/sb_tsi.c b/driver/temp_sensor/sb_tsi.c index 3de816e1dc..a806ff395f 100644 --- a/driver/temp_sensor/sb_tsi.c +++ b/driver/temp_sensor/sb_tsi.c @@ -19,7 +19,7 @@ static int raw_read8(const int offset, int *data_ptr) { - return i2c_read8__7bf(I2C_PORT_THERMAL, SB_TSI_I2C_ADDR__7bf, + return i2c_read8(I2C_PORT_THERMAL, SB_TSI_I2C_ADDR_FLAGS, offset, data_ptr); } diff --git a/driver/temp_sensor/sb_tsi.h b/driver/temp_sensor/sb_tsi.h index afed1d206f..ae61e4e34d 100644 --- a/driver/temp_sensor/sb_tsi.h +++ b/driver/temp_sensor/sb_tsi.h @@ -11,7 +11,7 @@ #ifndef __CROS_EC_SB_TSI_H #define __CROS_EC_SB_TSI_H -#define SB_TSI_I2C_ADDR__7bf 0x4C +#define SB_TSI_I2C_ADDR_FLAGS 0x4C /* G781 register */ #define SB_TSI_TEMP_H 0x01 diff --git a/driver/temp_sensor/tmp006.c b/driver/temp_sensor/tmp006.c index b615dbd4cc..1b8f6eb746 100644 --- a/driver/temp_sensor/tmp006.c +++ b/driver/temp_sensor/tmp006.c @@ -86,7 +86,7 @@ static void tmp006_poll_sensor(int sensor_id) { struct tmp006_data_t *tdata = tmp006_data + sensor_id; int t, v, rv; - int addr__7bf = tmp006_sensors__7bf[sensor_id].addr__7bf; + int addr_flags = tmp006_sensors[sensor_id].addr_flags; /* Invalidate the filter history if there is any error */ if (tdata->fail) { @@ -104,8 +104,8 @@ static void tmp006_poll_sensor(int sensor_id) * data ready; otherwise, we read garbage data. */ if (tdata->fail & (FAIL_POWER | FAIL_INIT)) { - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_CONFIG, &v); if (rv) { tdata->fail |= FAIL_I2C; @@ -117,16 +117,16 @@ static void tmp006_poll_sensor(int sensor_id) } } - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_TDIE, &t); if (rv) { tdata->fail |= FAIL_I2C; return; } - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_VOBJ, &v); if (rv) { tdata->fail |= FAIL_I2C; @@ -373,42 +373,42 @@ static int tmp006_print(int idx) int traw, t; int rv; int d; - int addr__7bf = tmp006_sensors__7bf[idx].addr__7bf; + int addr_flags = tmp006_sensors[idx].addr_flags; - ccprintf("Debug data from %s:\n", tmp006_sensors__7bf[idx].name); + ccprintf("Debug data from %s:\n", tmp006_sensors[idx].name); if (!tmp006_has_power(idx)) { ccputs("Sensor powered off.\n"); return EC_ERROR_UNKNOWN; } - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_MANUFACTURER_ID, &d); if (rv) return rv; ccprintf(" Manufacturer ID: 0x%04x\n", d); - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_DEVICE_ID, &d); ccprintf(" Device ID: 0x%04x\n", d); - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_CONFIG, &d); ccprintf(" Config: 0x%04x\n", d); - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_VOBJ, &vraw); v = ((int)vraw * 15625) / 100; ccprintf(" Voltage: 0x%04x = %d nV\n", vraw, v); - rv = i2c_read16__7bf(TMP006_PORT(addr__7bf), - TMP006_REG__7bf(addr__7bf), + rv = i2c_read16(TMP006_PORT(addr_flags), + TMP006_REG(addr_flags), TMP006_REG_TDIE, &traw); t = (int)traw; ccprintf(" Temperature: 0x%04x = %d.%02d C\n", @@ -463,7 +463,7 @@ static int command_t6cal(int argc, char **argv) tdata = tmp006_data + i; ccprintf("%d %-11s" "%7de-17 %7de-8 %7de-10 %7de-12\n", - i, tmp006_sensors__7bf[i].name, + i, tmp006_sensors[i].name, (int)(tdata->s0 * 1e17f), (int)(tdata->b0 * 1e8f), (int)(tdata->b1 * 1e10f), diff --git a/driver/temp_sensor/tmp006.h b/driver/temp_sensor/tmp006.h index 98f8e31ee0..594dbc711a 100644 --- a/driver/temp_sensor/tmp006.h +++ b/driver/temp_sensor/tmp006.h @@ -16,17 +16,17 @@ #define TMP006_REG_DEVICE_ID 0xff /* I2C address components */ -#define TMP006_ADDR__7bf(PORT, REG) ((PORT << 16) + REG) -#define TMP006_PORT(ADDR__7bf) (ADDR__7bf >> 16) -#define TMP006_REG__7bf(ADDR__7bf) (ADDR__7bf & 0xffff) +#define TMP006_ADDR(PORT, REG) ((PORT << 16) + REG) +#define TMP006_PORT(ADDR) (ADDR >> 16) +#define TMP006_REG(ADDR) (ADDR & 0xffff) struct tmp006_t { const char *name; - int addr__7bf; /* I2C address formed by TMP006_ADDR macro. */ + int addr_flags; /* I2C address formed by TMP006_ADDR macro. */ }; /* Names and addresses of the sensors we have */ -extern const struct tmp006_t tmp006_sensors__7bf[]; +extern const struct tmp006_t tmp006_sensors[]; /** * Get the last polled value of a sensor. diff --git a/driver/temp_sensor/tmp112.c b/driver/temp_sensor/tmp112.c index b80fc4bb61..045aca8c9c 100644 --- a/driver/temp_sensor/tmp112.c +++ b/driver/temp_sensor/tmp112.c @@ -20,13 +20,13 @@ static int temp_val_local; static int raw_read16(const int offset, int *data_ptr) { - return i2c_read16__7bf(I2C_PORT_THERMAL, TMP112_I2C_ADDR__7bf, + return i2c_read16(I2C_PORT_THERMAL, TMP112_I2C_ADDR_FLAGS, offset, data_ptr); } static int raw_write16(const int offset, int data) { - return i2c_write16__7bf(I2C_PORT_THERMAL, TMP112_I2C_ADDR__7bf, + return i2c_write16(I2C_PORT_THERMAL, TMP112_I2C_ADDR_FLAGS, offset, data); } diff --git a/driver/temp_sensor/tmp112.h b/driver/temp_sensor/tmp112.h index f1c5725741..35f5909045 100644 --- a/driver/temp_sensor/tmp112.h +++ b/driver/temp_sensor/tmp112.h @@ -8,7 +8,7 @@ #include "i2c.h" -#define TMP112_I2C_ADDR__7bf (0x48 | I2C_FLAG_BIG_ENDIAN) +#define TMP112_I2C_ADDR_FLAGS (0x48 | I2C_FLAG_BIG_ENDIAN) #define TMP112_REG_TEMP 0x00 #define TMP112_REG_CONF 0x01 diff --git a/driver/temp_sensor/tmp411.h b/driver/temp_sensor/tmp411.h index 6e15f52c3e..ef1b23278c 100644 --- a/driver/temp_sensor/tmp411.h +++ b/driver/temp_sensor/tmp411.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_TMP411_H #define __CROS_EC_TMP411_H -#define TMP411_I2C_ADDR__7bf 0x4C +#define TMP411_I2C_ADDR_FLAGS 0x4C #define TMP411_IDX_LOCAL 0 #define TMP411_IDX_REMOTE1 1 diff --git a/driver/temp_sensor/tmp432.c b/driver/temp_sensor/tmp432.c index 6325547ace..1b95886c63 100644 --- a/driver/temp_sensor/tmp432.c +++ b/driver/temp_sensor/tmp432.c @@ -35,13 +35,13 @@ static int has_power(void) static int raw_read8(const int offset, int *data_ptr) { - return i2c_read8__7bf(I2C_PORT_THERMAL, TMP432_I2C_ADDR__7bf, + return i2c_read8(I2C_PORT_THERMAL, TMP432_I2C_ADDR_FLAGS, offset, data_ptr); } static int raw_write8(const int offset, int data) { - return i2c_write8__7bf(I2C_PORT_THERMAL, TMP432_I2C_ADDR__7bf, + return i2c_write8(I2C_PORT_THERMAL, TMP432_I2C_ADDR_FLAGS, offset, data); } diff --git a/driver/temp_sensor/tmp432.h b/driver/temp_sensor/tmp432.h index 638cde91e1..e58e39a4a0 100644 --- a/driver/temp_sensor/tmp432.h +++ b/driver/temp_sensor/tmp432.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_TMP432_H #define __CROS_EC_TMP432_H -#define TMP432_I2C_ADDR__7bf 0x4C +#define TMP432_I2C_ADDR_FLAGS 0x4C #define TMP432_IDX_LOCAL 0 #define TMP432_IDX_REMOTE1 1 diff --git a/driver/temp_sensor/tmp468.c b/driver/temp_sensor/tmp468.c index 444a1d5dc8..46e77ca696 100644 --- a/driver/temp_sensor/tmp468.c +++ b/driver/temp_sensor/tmp468.c @@ -27,13 +27,13 @@ static int has_power(void) static int raw_read16(const int offset, int *data_ptr) { - return i2c_read16__7bf(I2C_PORT_THERMAL, TMP468_I2C_ADDR__7bf, + return i2c_read16(I2C_PORT_THERMAL, TMP468_I2C_ADDR_FLAGS, offset, data_ptr); } static int raw_write16(const int offset, int data_ptr) { - return i2c_write16__7bf(I2C_PORT_THERMAL, TMP468_I2C_ADDR__7bf, + return i2c_write16(I2C_PORT_THERMAL, TMP468_I2C_ADDR_FLAGS, offset, data_ptr); } diff --git a/driver/temp_sensor/tmp468.h b/driver/temp_sensor/tmp468.h index f8f4337d8a..59fbd20477 100644 --- a/driver/temp_sensor/tmp468.h +++ b/driver/temp_sensor/tmp468.h @@ -8,7 +8,7 @@ #ifndef __CROS_EC_TMP468_H #define __CROS_EC_TMP468_H -#define TMP468_I2C_ADDR__7bf (0x48 | I2C_FLAG_BIG_ENDIAN) +#define TMP468_I2C_ADDR_FLAGS (0x48 | I2C_FLAG_BIG_ENDIAN) #define TMP468_SHIFT1 7 #define TMP468_LOCAL 0x00 |