summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clock.h19
-rw-r--r--include/hwtimer.h3
-rw-r--r--include/i2c.h5
-rw-r--r--include/peci.h3
-rw-r--r--include/watchdog.h20
5 files changed, 34 insertions, 16 deletions
diff --git a/include/clock.h b/include/clock.h
index c4008672ef..081c9c95a9 100644
--- a/include/clock.h
+++ b/include/clock.h
@@ -1,14 +1,23 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Clocks and power management settings */
-#ifndef __CLOCK_H
-#define __CLOCK_H
+#ifndef __CROS_EC_CLOCK_H
+#define __CROS_EC_CLOCK_H
-/* set the CPU clocks and PLLs */
+#include "common.h"
+
+/* Set the CPU clocks and PLLs. */
int clock_init(void);
-#endif /* __CLOCK_H */
+/* Returns the current clock frequency in Hz. */
+int clock_get_freq(void);
+
+/* Wait <cycles> system clock cycles. Simple busy waiting for before
+ * clocks/timers are initialized. */
+void clock_wait_cycles(uint32_t cycles);
+
+#endif /* __CROS_EC_CLOCK_H */
diff --git a/include/hwtimer.h b/include/hwtimer.h
index 384e3613dd..5fee466b7c 100644
--- a/include/hwtimer.h
+++ b/include/hwtimer.h
@@ -30,6 +30,9 @@ uint32_t __hw_clock_source_read(void);
*/
int __hw_clock_source_init(void);
+/* Notifies the module the system clock frequency has changed to <freq>. */
+void hwtimer_clock_changed(int freq);
+
/**
* Searches the next deadline and program it in the timer hardware.
*
diff --git a/include/i2c.h b/include/i2c.h
index 701992e35e..22ab18adcf 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -16,6 +16,9 @@
/* Initializes the module. */
int i2c_init(void);
+/* Notifies the module the system clock frequency has changed to <freq>. */
+void i2c_clock_changed(int freq);
+
/* Reads a 16-bit register from the slave at 8-bit slave address
* <slaveaddr>, at the specified 8-bit <offset> in the slave's address
* space. */
diff --git a/include/peci.h b/include/peci.h
index 2b2c33f4a7..7a98a24991 100644
--- a/include/peci.h
+++ b/include/peci.h
@@ -15,6 +15,9 @@ struct temp_sensor_t;
/* Initializes the module. */
int peci_init(void);
+/* Notifies the module the system clock frequency has changed to <freq>. */
+void peci_clock_changed(int freq);
+
/* Returns the current CPU temperature in degrees K, or -1 if error.
*
* Note that the PECI interface is currently a little flaky; if you get an
diff --git a/include/watchdog.h b/include/watchdog.h
index 75a5e0b4a5..569352bc6a 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -1,21 +1,21 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Watchdog driver */
-#ifndef _WATCHDOG_H
-#define _WATCHDOG_H
+#ifndef __CROS_EC_WATCHDOG_H
+#define __CROS_EC_WATCHDOG_H
+
+/* Initialize the watchdog. This will cause the CPU to reboot if it has been
+ * more than 2 watchdog periods since watchdog_reload() has been called. */
+int watchdog_init(int period_ms);
/* Reload the watchdog counter */
void watchdog_reload(void);
-/**
- * Initialize the watchdog
- * with a reloading period of <period_ms> milliseconds.
- * It reboots the CPU if the counter has not been reloaded for twice the period.
- */
-int watchdog_init(int period_ms);
+/* Notifies the module the system clock frequency has changed to <freq>. */
+void watchdog_clock_changed(int freq);
-#endif /* _WATCHDOG_H */
+#endif /* __CROS_EC_WATCHDOG_H */