diff options
author | loganliao <Logan_Liao@compal.corp-partner.google.com> | 2020-03-03 14:25:39 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-13 04:39:14 +0000 |
commit | d7e7049b4569865b28c136ffc37c4ec0a0f061f8 (patch) | |
tree | c00634bb9f8ca5e9942cccaa381ca6bf4ac34ab4 /board/mushu | |
parent | feda8a46e7a35d364c2cc5d5146de6ca24fea0e0 (diff) | |
download | chrome-ec-d7e7049b4569865b28c136ffc37c4ec0a0f061f8.tar.gz |
Mushu : enable GPU temperature sensor driver in Mushu
BUG=b:148968367
BRANCH=none
TEST=make BOARD=mushu
Change-Id: I20e1ebd8714e3d4b3b990d6e2a38f415afd8b5c5
Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2082303
Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Commit-Queue: Logan Liao <logan_liao@compal.corp-partner.google.com>
Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
Diffstat (limited to 'board/mushu')
-rw-r--r-- | board/mushu/board.c | 18 | ||||
-rw-r--r-- | board/mushu/board.h | 7 | ||||
-rw-r--r-- | board/mushu/gpio.inc | 3 |
3 files changed, 20 insertions, 8 deletions
diff --git a/board/mushu/board.c b/board/mushu/board.c index bd5d2750b3..1155b33ffc 100644 --- a/board/mushu/board.c +++ b/board/mushu/board.c @@ -42,6 +42,7 @@ #include "usb_pd.h" #include "usbc_ppc.h" #include "util.h" +#include "driver/temp_sensor/amd_r19me4070.h" #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) @@ -401,21 +402,25 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); /* ADC channels */ const struct adc_t adc_channels[] = { [ADC_TEMP_SENSOR_1] = { - "TEMP_AMB", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, + "TEMP_CHARGER", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, [ADC_TEMP_SENSOR_2] = { - "TEMP_CHARGER", NPCX_ADC_CH1, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, + "TEMP_5V", NPCX_ADC_CH1, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1] = {.name = "Temp1", + [TEMP_CHARGER] = {.name = "CHARGER", .type = TEMP_SENSOR_TYPE_BOARD, .read = get_temp_3v3_30k9_47k_4050b, .idx = ADC_TEMP_SENSOR_1}, - [TEMP_SENSOR_2] = {.name = "Temp2", + [TEMP_5V] = {.name = "5V", .type = TEMP_SENSOR_TYPE_BOARD, .read = get_temp_3v3_30k9_47k_4050b, .idx = ADC_TEMP_SENSOR_2}, + [TEMP_GPU] = {.name = "GPU", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_R19ME4070, + .idx = R19ME4070_LOCAL}, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); @@ -461,8 +466,9 @@ struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT]; static void setup_fans(void) { - thermal_params[TEMP_SENSOR_1] = thermal_a; - thermal_params[TEMP_SENSOR_2] = thermal_b; + thermal_params[TEMP_CHARGER] = thermal_a; + thermal_params[TEMP_5V] = thermal_a; + thermal_params[TEMP_GPU] = thermal_b; } /* Sets the gpio flags correct taking into account warm resets */ diff --git a/board/mushu/board.h b/board/mushu/board.h index d72e886441..9059acf937 100644 --- a/board/mushu/board.h +++ b/board/mushu/board.h @@ -25,6 +25,8 @@ /* Keyboard features */ #define CONFIG_PWM_KBLIGHT +#define CONFIG_TEMP_SENSOR_AMD_R19ME4070 + /* Sensors */ /* BMI160 Base accel/gyro */ #define CONFIG_ACCEL_INTERRUPTS @@ -167,8 +169,9 @@ enum mft_channel { }; enum temp_sensor_id { - TEMP_SENSOR_1, - TEMP_SENSOR_2, + TEMP_CHARGER, + TEMP_5V, + TEMP_GPU, TEMP_SENSOR_COUNT }; diff --git a/board/mushu/gpio.inc b/board/mushu/gpio.inc index 85a8e54163..beea864591 100644 --- a/board/mushu/gpio.inc +++ b/board/mushu/gpio.inc @@ -92,6 +92,8 @@ GPIO(I2C2_SCL, PIN(9, 2), GPIO_INPUT) /* EC_I2C_USB_C1 GPIO(I2C2_SDA, PIN(9, 1), GPIO_INPUT) /* EC_I2C_USB_C1_PD_SDA */ GPIO(I2C3_SCL, PIN(D, 1), GPIO_INPUT) /* EC_I2C_USB_C0_TCPC_SDA */ GPIO(I2C3_SDA, PIN(D, 0), GPIO_INPUT) /* EC_I2C_USB_C0_TCPC_SCL */ +GPIO(I2C4_SCL, PIN(F, 3), GPIO_INPUT) /* EC_I2C_GPU_TEMPERATURE_SCL */ +GPIO(I2C4_SDA, PIN(F, 2), GPIO_INPUT) /* EC_I2C_GPU_TEMPERATURE_SDA */ GPIO(I2C5_SCL, PIN(3, 3), GPIO_INPUT) /* EC_I2C_POWER_SCL */ GPIO(I2C5_SDA, PIN(3, 6), GPIO_INPUT) /* EC_I2C_POWER_SDA */ GPIO(I2C7_SCL, PIN(B, 3), GPIO_INPUT) /* EC_I2C_EEPROM_SCL */ @@ -112,6 +114,7 @@ ALTERNATE(PIN_MASK(B, 0x30), 0, MODULE_I2C, (GPIO_INPUT | GPIO_SEL_1P8V)) /* I2 ALTERNATE(PIN_MASK(9, 0x07), 0, MODULE_I2C, 0) /* I2C1 SCL / I2C2 */ ALTERNATE(PIN_MASK(8, 0x80), 0, MODULE_I2C, 0) /* I2C1 SDA */ ALTERNATE(PIN_MASK(D, 0x03), 0, MODULE_I2C, 0) /* I2C3 */ +ALTERNATE(PIN_MASK(F, 0x0C), 0, MODULE_I2C, 0) /* I2C4 */ ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5 */ ALTERNATE(PIN_MASK(B, 0x0C), 0, MODULE_I2C, 0) /* I2C7 */ |