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>
This commit is contained in:
Kevin K Wong
2014-09-11 09:32:51 -07:00
committed by ChromeOS Commit Bot
parent 356695da35
commit 3779b8ccbe
2 changed files with 40 additions and 0 deletions

View File

@@ -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);

View File

@@ -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 */