diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-08-09 13:11:09 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-09 14:38:16 -0700 |
commit | 3c708cb802d395fc38350a8f856ae77e9a1315ba (patch) | |
tree | 7f62d8efa2929dd64373e130ae8e9de00dd3dbfc /include/clock.h | |
parent | 37470f1e778157f5ca3680820ca68353f3c4ab38 (diff) | |
download | chrome-ec-3c708cb802d395fc38350a8f856ae77e9a1315ba.tar.gz |
Enable PLL only briefly during ADC init
It was previously only enabled for 1500us during boot, but in a way
that triggered a needless round of notifications to other modules.
This is cleaner.
This also fixes adc_init() not initializing the task IDs to wake when
interrupts come in, and removes some unneeded code from other init
functions.
BUG=chrome-os-partner:12472
TEST=boot system and run adc command. Should still provide reasonable data.
Change-Id: I9ae5857d988c727caf5d53f551a2f12b30974c0f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29806
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/clock.h')
-rw-r--r-- | include/clock.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/clock.h b/include/clock.h index c28dbb1bf2..1d2506029d 100644 --- a/include/clock.h +++ b/include/clock.h @@ -3,24 +3,40 @@ * found in the LICENSE file. */ -/* Clocks and power management settings */ +/* Clocks and power management settings */ #ifndef __CROS_EC_CLOCK_H #define __CROS_EC_CLOCK_H #include "common.h" -/* Set the CPU clocks and PLLs. */ +/** + * Set the CPU clocks and PLLs. + */ int clock_init(void); -/* Return the current clock frequency in Hz. */ +/** + * Return the current clock frequency in Hz. + */ int clock_get_freq(void); -/* Enable or disable the PLL. */ -int clock_enable_pll(int enable); - -/* Wait <cycles> system clock cycles. Simple busy waiting for before - * clocks/timers are initialized. */ +/** + * Enable or disable the PLL. + * + * @param enable Enable PLL if non-zero; disable if zero. + * @param notify Notify other modules of the PLL change. This should + * be 1 unless you're briefly turning on the PLL to work + * around a chip errata at init time. + */ +int clock_enable_pll(int enable, int notify); + +/** + * Wait for a number of clock cycles. + * + * Simple busy waiting for use before clocks/timers are initialized. + * + * @param cycles Number of cycles to wait. + */ void clock_wait_cycles(uint32_t cycles); /* Low power modes for idle API */ |