summaryrefslogtreecommitdiff
path: root/chip/lm4/chip_temp_sensor.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-26 16:33:30 -0700
committerGerrit <chrome-bot@google.com>2012-11-01 12:45:22 -0700
commitd83f42bdc8b61773efc17e0194e5abe26109128d (patch)
treee8351b0f756dff9aac9d6b919037c1f3b283c644 /chip/lm4/chip_temp_sensor.c
parent742ec5a1ff3a058bf6f1753bafde9e3e57d44f58 (diff)
downloadchrome-ec-d83f42bdc8b61773efc17e0194e5abe26109128d.tar.gz
Switch temp sensor polling to use hooks instead of task
This reduces memory / code size, and gets rid of ifdefs in temp_sensor.c. BUG=chrome-os-partner:15714 BRANCH=none TEST=boot system and run 'ectool temps all' every few seconds - ectool temps all The numbers should update over time. Change-Id: Idaac7e6e4cbc1d6689f5d3b607c623a5cc536a4f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36940
Diffstat (limited to 'chip/lm4/chip_temp_sensor.c')
-rw-r--r--chip/lm4/chip_temp_sensor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/chip/lm4/chip_temp_sensor.c b/chip/lm4/chip_temp_sensor.c
index 077806ba73..2377806023 100644
--- a/chip/lm4/chip_temp_sensor.c
+++ b/chip/lm4/chip_temp_sensor.c
@@ -7,18 +7,17 @@
#include "adc.h"
#include "common.h"
+#include "hooks.h"
#include "lm4_adc.h"
-#include "temp_sensor.h"
/* Initialize temperature reading to a sane value (27 C) */
static int last_val = 300;
-int chip_temp_sensor_poll(void)
+static void chip_temp_sensor_poll(void)
{
last_val = adc_read_channel(ADC_CH_EC_TEMP);
-
- return EC_SUCCESS;
}
+DECLARE_HOOK(HOOK_SECOND, chip_temp_sensor_poll, HOOK_PRIO_DEFAULT);
int chip_temp_sensor_get_val(int idx, int *temp_ptr)
{