summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2014-09-11 09:32:51 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-14 01:15:49 +0000
commit3779b8ccbebf19155f98c924bfa39acf6ecc317f (patch)
tree99fe0dfbf827f1039af020de040f262a128f2514
parent356695da354db3bfd53e0c54b4bf0980f3b2672c (diff)
downloadchrome-ec-3779b8ccbebf19155f98c924bfa39acf6ecc317f.tar.gz
strago: Added support for TMP432 temperature sensor.
BUG=none TEST=Verified tmp432 console command is returnning correct temperature. BRANCH=none Change-Id: Ic43af17961361e4c971a343a0d24d310c3aaf2ac Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/265540 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/strago/board.c29
-rw-r--r--board/strago/board.h11
2 files changed, 40 insertions, 0 deletions
diff --git a/board/strago/board.c b/board/strago/board.c
index bfd574d5cf..586eac8552 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -4,6 +4,7 @@
*/
/* Strago board-specific configuration */
+#include "driver/temp_sensor/tmp432.h"
#include "extpower.h"
#include "gpio.h"
#include "i2c.h"
@@ -11,6 +12,9 @@
#include "power.h"
#include "power_button.h"
#include "registers.h"
+#include "temp_sensor.h"
+#include "temp_sensor_chip.h"
+#include "thermal.h"
#include "util.h"
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP)
@@ -35,3 +39,28 @@ const struct i2c_port_t i2c_ports[] = {
{"thermal", 3, 100}
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
+
+/*
+ * Temperature sensors data; must be in same order as enum temp_sensor_id.
+ * Sensor index and name must match those present in coreboot:
+ * src/mainboard/google/${board}/acpi/dptf.asl
+ */
+const struct temp_sensor_t temp_sensors[] = {
+ {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_LOCAL, 4},
+ {"TMP432_Sensor_1", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_REMOTE1, 4},
+ {"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_REMOTE2, 4},
+};
+BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+
+/* Thermal limits for each temp sensor. All temps are in degrees K. Must be in
+ * same order as enum temp_sensor_id. To always ignore any temp, use 0.
+ */
+struct ec_thermal_config thermal_params[] = {
+ {{0, 0, 0}, 0, 0}, /* TMP432_Internal */
+ {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_1 */
+ {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */
+};
+BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
diff --git a/board/strago/board.h b/board/strago/board.h
index edfca0a6dd..4a46c8745c 100644
--- a/board/strago/board.h
+++ b/board/strago/board.h
@@ -31,6 +31,9 @@
#define CONFIG_SPI_FLASH_SIZE 524288
#define CONFIG_SPI_FLASH_W25Q64
+#define CONFIG_TEMP_SENSOR
+#define CONFIG_TEMP_SENSOR_TMP432
+
#define CONFIG_I2C
/* I2C ports */
@@ -66,6 +69,14 @@ enum power_signal {
POWER_SIGNAL_COUNT
};
+enum temp_sensor_id {
+ /* TMP432 local and remote sensors */
+ TEMP_SENSOR_I2C_TMP432_LOCAL,
+ TEMP_SENSOR_I2C_TMP432_REMOTE1,
+ TEMP_SENSOR_I2C_TMP432_REMOTE2,
+
+ TEMP_SENSOR_COUNT
+};
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */