summaryrefslogtreecommitdiff
path: root/driver/temp_sensor/amd_r19me4070.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /driver/temp_sensor/amd_r19me4070.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14588.14.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'driver/temp_sensor/amd_r19me4070.c')
-rw-r--r--driver/temp_sensor/amd_r19me4070.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/driver/temp_sensor/amd_r19me4070.c b/driver/temp_sensor/amd_r19me4070.c
deleted file mode 100644
index b331a1a3eb..0000000000
--- a/driver/temp_sensor/amd_r19me4070.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* R19ME4070 temperature sensor module for Chrome EC */
-
-#include "chipset.h"
-#include "common.h"
-#include "console.h"
-#include "hooks.h"
-#include "i2c.h"
-#include "amd_r19me4070.h"
-#include "power.h"
-
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
-
-/* GPU I2C address */
-#define GPU_ADDR_FLAGS 0x0041
-
-#define GPU_INIT_OFFSET 0x01
-#define GPU_TEMPERATURE_OFFSET 0x03
-
-static int initialized;
-/*
- * Tell SMBus we want to read 4 Byte from register offset(0x01665A)
- */
-static const uint8_t gpu_init_write_value[5] = {
- 0x04, 0x0F, 0x01, 0x66, 0x5A,
-};
-
-static void gpu_init_temp_sensor(void)
-{
- int rv;
- rv = i2c_write_block(I2C_PORT_GPU, GPU_ADDR_FLAGS, GPU_INIT_OFFSET,
- gpu_init_write_value,
- ARRAY_SIZE(gpu_init_write_value));
- if (rv == EC_SUCCESS) {
- initialized = 1;
- return;
- }
- CPRINTS("init GPU fail");
-}
-
-/* INIT GPU first before read the GPU's die tmeperature. */
-int get_temp_R19ME4070(int idx, int *temp_ptr)
-{
- uint8_t reg[5];
- int rv;
-
- /*
- * We shouldn't read the GPU temperature when the state
- * is not in S0, because GPU is enabled in S0.
- */
- if ((power_get_state()) != POWER_S0) {
- *temp_ptr = C_TO_K(0);
- return EC_ERROR_BUSY;
- }
- /* if no INIT GPU, must init it first and wait 1 sec. */
- if (!initialized) {
- gpu_init_temp_sensor();
- *temp_ptr = C_TO_K(0);
- return EC_ERROR_BUSY;
- }
- rv = i2c_read_block(I2C_PORT_GPU, GPU_ADDR_FLAGS,
- GPU_TEMPERATURE_OFFSET, reg, ARRAY_SIZE(reg));
- if (rv) {
- CPRINTS("read GPU Temperature fail");
- *temp_ptr = C_TO_K(0);
- return rv;
- }
- /*
- * The register is four bytes, bit[17:9] represents the GPU temperature.
- * 0x000 : 0 ゚C
- * 0x001 : 1 ゚C
- * 0x002 : 2 ゚C
- * ...
- * 0x1FF : 511 ゚C
- * -------------------------------
- * reg[4] = bit0 - bit7
- * reg[3] = bit8 - bit15
- * reg[2] = bit16 - bit23
- * reg[1] = bit24 - bit31
- * reg[0] = 0x04
- */
- *temp_ptr = C_TO_K(reg[3] >> 1);
-
- return EC_SUCCESS;
-}