diff options
author | Simon Glass <sjg@chromium.org> | 2018-08-22 09:43:17 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-04 21:03:57 -0700 |
commit | e192f71aed932b88f3c42df4653a430a2e8ba10e (patch) | |
tree | 013f50b4bf3abe796d7594c9e02d53b7ebc69d3d /chip | |
parent | d6fc2d450496df392e99fc6ce2605fec0e9cfead (diff) | |
download | chrome-ec-e192f71aed932b88f3c42df4653a430a2e8ba10e.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
Diffstat (limited to 'chip')
-rw-r--r-- | chip/npcx/hwtimer.c | 2 | ||||
-rw-r--r-- | chip/npcx/hwtimer_chip.h | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chip/npcx/hwtimer.c b/chip/npcx/hwtimer.c index 38a8fce548..76f1822a94 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 d5939f77a8..80ee50b6ab 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 */ |