summaryrefslogtreecommitdiff
path: root/driver/temp_sensor/oti502.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/oti502.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14589.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/oti502.c')
-rw-r--r--driver/temp_sensor/oti502.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/driver/temp_sensor/oti502.c b/driver/temp_sensor/oti502.c
deleted file mode 100644
index 8a420363e8..0000000000
--- a/driver/temp_sensor/oti502.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright 2019 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.
- */
-
-/* OTI502 temperature sensor module for Chrome EC */
-
-#include "common.h"
-#include "console.h"
-#include "oti502.h"
-#include "i2c.h"
-#include "hooks.h"
-#include "util.h"
-
-static int temp_val_ambient; /* Ambient is chip temperature*/
-static int temp_val_object; /* Object is IR temperature */
-
-static int oti502_read_block(const int offset, uint8_t *data, int len)
-{
- return i2c_read_block(I2C_PORT_THERMAL, OTI502_I2C_ADDR_FLAGS,
- offset, data, len);
-}
-
-int oti502_get_val(int idx, int *temp_ptr)
-{
- switch (idx) {
- case OTI502_IDX_AMBIENT:
- *temp_ptr = temp_val_ambient;
- break;
- case OTI502_IDX_OBJECT:
- *temp_ptr = temp_val_object;
- break;
- default:
- return EC_ERROR_UNKNOWN;
- }
-
- return EC_SUCCESS;
-}
-
-static void temp_sensor_poll(void)
-{
- uint8_t temp_val[6];
-
- memset(temp_val, 0, sizeof(temp_val));
-
- oti502_read_block(0x80, temp_val, sizeof(temp_val));
-
- if (temp_val[2] >= 0x80) {
- /* Treat temperature as 0 degree C if temperature is negative*/
- temp_val_ambient = 0;
- ccprintf("Temperature ambient is negative !\n");
- } else {
- temp_val_ambient = ((temp_val[1] << 8) + temp_val[0]) / 200;
- temp_val_ambient = C_TO_K(temp_val_ambient);
- }
-
- if (temp_val[5] >= 0x80) {
- /* Treat temperature as 0 degree C if temperature is negative*/
- temp_val_object = 0;
- ccprintf("Temperature object is negative !\n");
- } else {
- temp_val_object = ((temp_val[4] << 8) + temp_val[5]) / 200;
- temp_val_object = C_TO_K(temp_val_object);
- }
-}
-DECLARE_HOOK(HOOK_SECOND, temp_sensor_poll, HOOK_PRIO_TEMP_SENSOR);
-