summaryrefslogtreecommitdiff
path: root/driver/temp_sensor/pct2075.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/temp_sensor/pct2075.c')
-rw-r--r--driver/temp_sensor/pct2075.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/driver/temp_sensor/pct2075.c b/driver/temp_sensor/pct2075.c
index 9c7b7190e9..02150ad796 100644
--- a/driver/temp_sensor/pct2075.c
+++ b/driver/temp_sensor/pct2075.c
@@ -7,8 +7,8 @@
#include "common.h"
#include "console.h"
-#include "i2c.h"
#include "hooks.h"
+#include "i2c.h"
#include "math_util.h"
#include "temp_sensor/pct2075.h"
#include "util.h"
@@ -76,6 +76,7 @@ int pct2075_get_val_mk(int idx, int *temp_mk_ptr)
return EC_SUCCESS;
}
+#ifndef CONFIG_ZEPHYR
static void pct2075_poll(void)
{
int s;
@@ -87,6 +88,18 @@ static void pct2075_poll(void)
}
}
DECLARE_HOOK(HOOK_SECOND, pct2075_poll, HOOK_PRIO_TEMP_SENSOR);
+#else
+void pct2075_update_temperature(int idx)
+{
+ int temp_reg = 0;
+
+ if (idx >= PCT2075_COUNT)
+ return;
+
+ if (get_reg_temp(idx, &temp_reg) == EC_SUCCESS)
+ temp_mk_local[idx] = pct2075_reg_to_mk(temp_reg);
+}
+#endif /* CONFIG_ZEPHYR */
void pct2075_init(void)
{