summaryrefslogtreecommitdiff
path: root/driver/temp_sensor
diff options
context:
space:
mode:
authorElthan_Huang <elthan_huang@compal.corp-partner.google.com>2018-02-09 16:15:46 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-27 05:14:31 -0800
commit87c549aebdad39902e110b39c6f7b391c4be7ce8 (patch)
treea27c4fdc51745e60dc8c84083224eed38dfceea9 /driver/temp_sensor
parent5bab2ee13daa2e6ab69ff92f1a88f3c8c8fe9aeb (diff)
downloadchrome-ec-87c549aebdad39902e110b39c6f7b391c4be7ce8.tar.gz
Nami: Add remote temperture 2 reading function
1. Add reading function for remote2 temperature (Fintek, F75303) 2. Modify the temp_sensors to read sensor remote1 and remote2 for nami. BUG=b:72974136 BRANCH=none TEST=Verify Nami can get thermal remote 2 data by command "ectool temps all" Change-Id: I5e4a58f20089ed5690e2a084e93e7021e80afcdc Signed-off-by: Elthan_Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/910270 Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Diffstat (limited to 'driver/temp_sensor')
-rw-r--r--driver/temp_sensor/f75303.c11
-rw-r--r--driver/temp_sensor/f75303.h6
2 files changed, 13 insertions, 4 deletions
diff --git a/driver/temp_sensor/f75303.c b/driver/temp_sensor/f75303.c
index 61d672a7bd..f34451ba8c 100644
--- a/driver/temp_sensor/f75303.c
+++ b/driver/temp_sensor/f75303.c
@@ -13,6 +13,7 @@
static int temp_val_local;
static int temp_val_remote1;
+static int temp_val_remote2;
/**
* Read 8 bits register from temp sensor.
@@ -41,9 +42,12 @@ int f75303_get_val(int idx, int *temp_ptr)
case F75303_IDX_LOCAL:
*temp_ptr = temp_val_local;
break;
- case F75303_IDX_REMOTE:
+ case F75303_IDX_REMOTE1:
*temp_ptr = temp_val_remote1;
break;
+ case F75303_IDX_REMOTE2:
+ *temp_ptr = temp_val_remote2;
+ break;
default:
return EC_ERROR_UNKNOWN;
}
@@ -56,8 +60,11 @@ static void f75303_sensor_poll(void)
get_temp(F75303_TEMP_LOCAL, &temp_val_local);
temp_val_local = C_TO_K(temp_val_local);
- get_temp(F75303_TEMP_REMOTE, &temp_val_remote1);
+ get_temp(F75303_TEMP_REMOTE1, &temp_val_remote1);
temp_val_remote1 = C_TO_K(temp_val_remote1);
+
+ get_temp(F75303_TEMP_REMOTE2, &temp_val_remote2);
+ temp_val_remote2 = C_TO_K(temp_val_remote2);
}
DECLARE_HOOK(HOOK_SECOND, f75303_sensor_poll, HOOK_PRIO_TEMP_SENSOR);
diff --git a/driver/temp_sensor/f75303.h b/driver/temp_sensor/f75303.h
index da08898301..6c8d41250c 100644
--- a/driver/temp_sensor/f75303.h
+++ b/driver/temp_sensor/f75303.h
@@ -12,12 +12,14 @@
enum f75303_index {
F75303_IDX_LOCAL = 0,
- F75303_IDX_REMOTE,
+ F75303_IDX_REMOTE1,
+ F75303_IDX_REMOTE2,
};
/* F75303 register */
#define F75303_TEMP_LOCAL 0x00
-#define F75303_TEMP_REMOTE 0x01
+#define F75303_TEMP_REMOTE1 0x01
+#define F75303_TEMP_REMOTE2 0x23
/**
* Get the last polled value of a sensor.