summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-08-22 09:43:17 -0600
committerMartin Roth <martinroth@chromium.org>2018-09-06 18:39:49 +0000
commit9173b1eb0cc11e71051521e34c397d3653950419 (patch)
tree224ad7cb08d98e4e30fb0071a96f7b7d0be9b3c6 /chip
parenteb0909d940300ea6567257289c1514afcf795557 (diff)
downloadchrome-ec-9173b1eb0cc11e71051521e34c397d3653950419.tar.gz
chip/npcx: Tidy up comments for init_hw_timer()
The comments suggest that this function only operates with ITIM16 timers but it seems to support ITIM32 as well. Also it allows selecting the clock source. Update the comments, hopefully making them correct. BUG=chromium:876737 BRANCH=none TEST= make buildall -j50 Change-Id: Ic4ec2457cde2de55d51371f781d49bae80365989 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1185225 (cherry picked from commit e192f71aed932b88f3c42df4653a430a2e8ba10e) Reviewed-on: https://chromium-review.googlesource.com/1211362 Reviewed-by: Martin Roth <martinroth@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/npcx/hwtimer.c2
-rw-r--r--chip/npcx/hwtimer_chip.h9
2 files changed, 9 insertions, 2 deletions
diff --git a/chip/npcx/hwtimer.c b/chip/npcx/hwtimer.c
index e46a56fb1e..8d4b9f1147 100644
--- a/chip/npcx/hwtimer.c
+++ b/chip/npcx/hwtimer.c
@@ -46,7 +46,7 @@ static volatile uint32_t cur_cnt_us_dbg;
/* Internal functions */
void init_hw_timer(int itim_no, enum ITIM_SOURCE_CLOCK_T source)
{
- /* Use internal 32K clock/APB2 for ITIM16 */
+ /* Select which clock to use for this timer */
UPDATE_BIT(NPCX_ITCTS(itim_no), NPCX_ITCTS_CKSEL,
source != ITIM_SOURCE_CLOCK_APB2);
diff --git a/chip/npcx/hwtimer_chip.h b/chip/npcx/hwtimer_chip.h
index 3b00b0dea5..5239312d7a 100644
--- a/chip/npcx/hwtimer_chip.h
+++ b/chip/npcx/hwtimer_chip.h
@@ -23,7 +23,14 @@ enum ITIM_SOURCE_CLOCK_T {
ITIM_SOURCE_CLOCK_32K = 1,
};
-/* Initialize ITIM16 timer */
+/**
+ * Initialise a hardware timer
+ *
+ * Select the source clock for a timer and prepare it for use.
+ *
+ * @param itim_no Timer number to init (enum ITIM16_MODULE_T)
+ * @param source Source for timer clock (enum ITIM_SOURCE_CLOCK_T)
+ */
void init_hw_timer(int itim_no, enum ITIM_SOURCE_CLOCK_T source);
/* Returns the counter value of event timer */