summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2015-02-05 23:35:19 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-12 22:36:24 +0000
commit8f9a37ae53be72b4b385d267c2a13254bd810e56 (patch)
tree257050f0fbe63a258e7aaa83518b0aa26fbe864c
parent53b21bf5dc81739243b32ce6b608878a54a6e1d4 (diff)
downloadchrome-ec-8f9a37ae53be72b4b385d267c2a13254bd810e56.tar.gz
tmp432: Renamed TMP432 temperature sensor driver to TMP43X
This change is done in preparation for the support of both TMP431 and TMP432. BUG=none TEST=make -j buildall BRANCH=none Change-Id: I8d7c97ee50fc83ad94f94559570da4f5b2286d38 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/248711 Tested-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
-rw-r--r--board/rambi/board.c8
-rw-r--r--board/squawks/board.c8
-rw-r--r--driver/build.mk2
-rw-r--r--driver/temp_sensor/tmp43x.c (renamed from driver/temp_sensor/tmp432.c)8
-rw-r--r--driver/temp_sensor/tmp43x.h (renamed from driver/temp_sensor/tmp432.h)8
5 files changed, 17 insertions, 17 deletions
diff --git a/board/rambi/board.c b/board/rambi/board.c
index 35e5849b73..fcd008dc9b 100644
--- a/board/rambi/board.c
+++ b/board/rambi/board.c
@@ -10,7 +10,7 @@
#include "charge_state.h"
#include "charger.h"
#include "common.h"
-#include "driver/temp_sensor/tmp432.h"
+#include "driver/temp_sensor/tmp43x.h"
#include "extpower.h"
#include "gpio.h"
#include "host_command.h"
@@ -94,11 +94,11 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
*/
const struct temp_sensor_t temp_sensors[] = {
{"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4},
- {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_LOCAL, 4},
- {"TMP432_Power_top", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_Power_top", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_REMOTE1, 4},
- {"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_REMOTE2, 4},
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
};
diff --git a/board/squawks/board.c b/board/squawks/board.c
index 292dc31ee6..0c2663473d 100644
--- a/board/squawks/board.c
+++ b/board/squawks/board.c
@@ -10,7 +10,7 @@
#include "charge_state.h"
#include "charger.h"
#include "common.h"
-#include "driver/temp_sensor/tmp432.h"
+#include "driver/temp_sensor/tmp43x.h"
#include "extpower.h"
#include "gpio.h"
#include "host_command.h"
@@ -95,11 +95,11 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
*/
const struct temp_sensor_t temp_sensors[] = {
{"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4},
- {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_LOCAL, 4},
- {"TMP432_Power_top", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_Power_top", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_REMOTE1, 4},
- {"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ {"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp43x_get_val,
TMP432_IDX_REMOTE2, 4},
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
};
diff --git a/driver/build.mk b/driver/build.mk
index 26430e2eec..af31874ccf 100644
--- a/driver/build.mk
+++ b/driver/build.mk
@@ -46,7 +46,7 @@ driver-$(CONFIG_REGULATOR_IR357X)+=regulator_ir357x.o
# Temperature sensors
driver-$(CONFIG_TEMP_SENSOR_G781)+=temp_sensor/g781.o
driver-$(CONFIG_TEMP_SENSOR_TMP006)+=temp_sensor/tmp006.o
-driver-$(CONFIG_TEMP_SENSOR_TMP432)+=temp_sensor/tmp432.o
+driver-$(CONFIG_TEMP_SENSOR_TMP432)+=temp_sensor/tmp43x.o
# USB switches
driver-$(CONFIG_USB_SWITCH_PI3USB9281)+=usb_switch_pi3usb9281.o
diff --git a/driver/temp_sensor/tmp432.c b/driver/temp_sensor/tmp43x.c
index b0f1c056f2..aad9717807 100644
--- a/driver/temp_sensor/tmp432.c
+++ b/driver/temp_sensor/tmp43x.c
@@ -7,7 +7,7 @@
#include "common.h"
#include "console.h"
-#include "tmp432.h"
+#include "tmp43x.h"
#include "gpio.h"
#include "i2c.h"
#include "hooks.h"
@@ -54,7 +54,7 @@ static int get_temp(const int offset, int *temp_ptr)
return EC_SUCCESS;
}
-static int tmp432_set_temp(const int offset, int temp)
+static int tmp43x_set_temp(const int offset, int temp)
{
if (temp < -127 || temp > 127)
return EC_ERROR_INVAL;
@@ -62,7 +62,7 @@ static int tmp432_set_temp(const int offset, int temp)
return raw_write8(offset, (uint8_t)temp);
}
-int tmp432_get_val(int idx, int *temp_ptr)
+int tmp43x_get_val(int idx, int *temp_ptr)
{
if (!has_power())
return EC_ERROR_NOT_POWERED;
@@ -202,7 +202,7 @@ static int command_tmp432(int argc, char **argv)
if (!strcasecmp(command, "settemp")) {
ccprintf("Setting 0x%02x to %dC\n", offset, data);
- rv = tmp432_set_temp(offset, data);
+ rv = tmp43x_set_temp(offset, data);
} else if (!strcasecmp(command, "setbyte")) {
ccprintf("Setting 0x%02x to 0x%02x\n", offset, data);
rv = raw_write8(offset, data);
diff --git a/driver/temp_sensor/tmp432.h b/driver/temp_sensor/tmp43x.h
index acfaf39503..99b6a49e4c 100644
--- a/driver/temp_sensor/tmp432.h
+++ b/driver/temp_sensor/tmp43x.h
@@ -5,8 +5,8 @@
/* TMP432 temperature sensor module for Chrome EC */
-#ifndef __CROS_EC_TEMP_SENSOR_TMP432_H
-#define __CROS_EC_TEMP_SENSOR_TMP432_H
+#ifndef __CROS_EC_TEMP_SENSOR_TMP43X_H
+#define __CROS_EC_TEMP_SENSOR_TMP43X_H
#define TMP432_I2C_ADDR 0x98 /* 7-bit address is 0x4C */
@@ -91,6 +91,6 @@
*
* @return EC_SUCCESS if successful, non-zero if error.
*/
-int tmp432_get_val(int idx, int *temp_ptr);
+int tmp43x_get_val(int idx, int *temp_ptr);
-#endif /* __CROS_EC_TEMP_SENSOR_TMP432_H */
+#endif /* __CROS_EC_TEMP_SENSOR_TMP43X_H */