summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-08-03 14:26:22 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-03 19:41:02 -0700
commitd93cbcff8df27a0b0a490e3caf24d87cc289c55b (patch)
treee6710941e23a0137f3611ee07c486cbe5d42084c /driver
parentd67f3aa1f60ff9abd4f03c58a103ab4eecf99e7f (diff)
downloadchrome-ec-d93cbcff8df27a0b0a490e3caf24d87cc289c55b.tar.gz
reef: Add code to read battery temperature
Reef doesn't have the battery temperature sense pin connected to the charger, hence reading the battery temperature from the battery registers. BUG=chrome-os-partner:55834 BRANCH=none TEST=Using 'battery' & 'temps' console command verified, temperature readings are same from both the commands. Change-Id: I897e453296151f31344f3e0434202baa67c7025d Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/365970 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/bd99955.c4
-rw-r--r--driver/charger/bd99955.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/driver/charger/bd99955.c b/driver/charger/bd99955.c
index a4eb1c07ca..cac77ab322 100644
--- a/driver/charger/bd99955.c
+++ b/driver/charger/bd99955.c
@@ -813,7 +813,8 @@ int bd99955_select_input_port(enum bd99955_charge_port port)
BD99955_EXTENDED_COMMAND);
}
-int bd99955_get_temp(int *temp_ptr)
+#ifdef CONFIG_CHARGER_BATTERY_TSENSE
+int bd99955_get_battery_temp(int *temp_ptr)
{
int rv;
@@ -826,6 +827,7 @@ int bd99955_get_temp(int *temp_ptr)
*temp_ptr = 200 - *temp_ptr;
return EC_SUCCESS;
}
+#endif
#ifdef HAS_TASK_USB_CHG
int bd99955_bc12_enable_charging(enum bd99955_charge_port port, int enable)
diff --git a/driver/charger/bd99955.h b/driver/charger/bd99955.h
index 214a20fd7b..f9c95d7663 100644
--- a/driver/charger/bd99955.h
+++ b/driver/charger/bd99955.h
@@ -296,6 +296,6 @@ int bd99955_bc12_enable_charging(enum bd99955_charge_port port, int enable);
/* Interrupt handler for USB charger VBUS */
void bd99955_vbus_interrupt(enum gpio_signal signal);
/* Read temperature measurement value (in Celsius) */
-int bd99955_get_temp(int *temp_ptr);
+int bd99955_get_battery_temp(int *temp_ptr);
#endif /* __CROS_EC_BD99955_H */