summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-04-19 12:42:35 -0700
committerRandall Spangler <rspangler@chromium.org>2012-04-19 13:08:58 -0700
commitf4e772708bde3e4e1d184190a7f0be2417d2029a (patch)
tree4b668c02a9a6dca2704e6d0a8b3cb8e5c9e95b76 /include
parentd5d2159c6d215b3a0feca42d961985cd37603ca8 (diff)
downloadchrome-ec-f4e772708bde3e4e1d184190a7f0be2417d2029a.tar.gz
Added HOOK_INIT for driver module inits
This covers modules which need to initialize before task_start(), but don't particularly care in what order they're initialized. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: I69829aac8d1c3c14ee04916a794b84bbf03a09eb
Diffstat (limited to 'include')
-rw-r--r--include/adc.h6
-rw-r--r--include/gpio.h3
-rw-r--r--include/hooks.h2
-rw-r--r--include/i2c.h3
-rw-r--r--include/lpc.h24
-rw-r--r--include/onewire.h3
-rw-r--r--include/peci.h3
-rw-r--r--include/power_button.h5
-rw-r--r--include/pwm.h6
-rw-r--r--include/spi.h3
-rw-r--r--include/usb_charge.h2
11 files changed, 13 insertions, 47 deletions
diff --git a/include/adc.h b/include/adc.h
index 5ce79d172e..661baca292 100644
--- a/include/adc.h
+++ b/include/adc.h
@@ -11,9 +11,6 @@
#include "common.h"
#include "board.h"
-/* forward declaration */
-enum adc_channel;
-
/* Data structure to define ADC channels. */
struct adc_t
{
@@ -26,9 +23,6 @@ struct adc_t
int flag;
};
-/* Initializes the module. */
-int adc_init(void);
-
/* Read ADC channel. */
int adc_read_channel(enum adc_channel ch);
diff --git a/include/gpio.h b/include/gpio.h
index 6eab4f1583..23cd1e9537 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -59,9 +59,6 @@ struct gpio_info {
* set up. */
int gpio_pre_init(void);
-/* Initializes the GPIO module. */
-int gpio_init(void);
-
/* Gets the current value of a signal (0=low, 1=hi). */
int gpio_get_level(enum gpio_signal signal);
diff --git a/include/hooks.h b/include/hooks.h
index 3d3a834e25..889cf553bc 100644
--- a/include/hooks.h
+++ b/include/hooks.h
@@ -16,7 +16,9 @@ enum hook_priority {
HOOK_PRIO_LAST = 9999 /* Lowest priority */
};
+
enum hook_type {
+ HOOK_INIT, /* System init */
HOOK_FREQ_CHANGE, /* System clock changed frequency */
};
diff --git a/include/i2c.h b/include/i2c.h
index 7543d8cb25..5dfedaa7e2 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -13,9 +13,6 @@
/* Flags for slave address field, in addition to the 8-bit address */
#define I2C_FLAG_BIG_ENDIAN 0x100 /* 16 byte values are MSB-first */
-/* Initialize the module. */
-int i2c_init(void);
-
/* Read 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. */
int i2c_read16(int port, int slave_addr, int offset, int* data);
diff --git a/include/lpc.h b/include/lpc.h
index 17a78cc9cb..295522ad1f 100644
--- a/include/lpc.h
+++ b/include/lpc.h
@@ -10,26 +10,22 @@
#include "common.h"
-/* Manually generates an IRQ to host.
+/* Manually generate an IRQ to host.
* Note that the irq_num == 0 would set the AH bit (Active High).
*/
void lpc_manual_irq(int irq_num);
-/* Initializes the LPC module. */
-int lpc_init(void);
-
-/* Returns a pointer to the host command data buffer. This buffer
- * must only be accessed between a notification to
- * host_command_received() and a subsequent call to
- * lpc_SendHostResponse(). <slot> is 0 for kernel-originated
- * commands, 1 for usermode-originated commands. */
+/* Return a pointer to the host command data buffer. This buffer must
+ * only be accessed between a notification to host_command_received()
+ * and a subsequent call to lpc_SendHostResponse(). <slot> is 0 for
+ * kernel-originated commands, 1 for usermode-originated commands. */
uint8_t *lpc_get_host_range(int slot);
-/* Returns a pointer to the memory-mapped buffer. This buffer is writable at
+/* Return a pointer to the memory-mapped buffer. This buffer is writable at
* any time, and the host can read it at any time. */
uint8_t *lpc_get_memmap_range(void);
-/* Sends a result code to a host command. <slot> is 0 for kernel-originated
+/* Send a result code to a host command. <slot> is 0 for kernel-originated
* commands, 1 for usermode-originated commands. */
void lpc_send_host_response(int slot, int result);
@@ -39,13 +35,13 @@ int lpc_keyboard_has_char(void);
/* Send a byte to host via port 0x60 and asserts IRQ if specified. */
void lpc_keyboard_put_char(uint8_t chr, int send_irq);
-/* Returns non-zero if the COMx interface has received a character. */
+/* Return non-zero if the COMx interface has received a character. */
int lpc_comx_has_char(void);
-/* Returns the next character pending on the COMx interface. */
+/* Return the next character pending on the COMx interface. */
int lpc_comx_get_char(void);
-/* Puts a character to the COMx LPC interface. */
+/* Put a character to the COMx LPC interface. */
void lpc_comx_put_char(int c);
/* Types of host events */
diff --git a/include/onewire.h b/include/onewire.h
index b7120dca90..f28abdd9b4 100644
--- a/include/onewire.h
+++ b/include/onewire.h
@@ -17,9 +17,6 @@
#include "common.h"
-/* Initialize the module. */
-int onewire_init(void);
-
/* Reset the 1-wire bus. Returns error if presence detect fails. */
int onewire_reset(void);
diff --git a/include/peci.h b/include/peci.h
index 1ad0d92bad..e24a3d0c15 100644
--- a/include/peci.h
+++ b/include/peci.h
@@ -10,9 +10,6 @@
#include "common.h"
-/* Initialize the module. */
-int peci_init(void);
-
/* Return 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/power_button.h b/include/power_button.h
index c6cf4f4e24..b25b90661a 100644
--- a/include/power_button.h
+++ b/include/power_button.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.
*/
@@ -11,9 +11,6 @@
#include "common.h"
#include "gpio.h"
-/* Initializes the module. */
-int power_button_init(void);
-
/* Interrupt handler for the power button and lid switch. Passed the signal
* which triggered the interrupt. */
void power_button_interrupt(enum gpio_signal signal);
diff --git a/include/pwm.h b/include/pwm.h
index 26e5fa4686..edea50e954 100644
--- a/include/pwm.h
+++ b/include/pwm.h
@@ -10,9 +10,6 @@
#include "common.h"
-/* Initialize the module. */
-int pwm_init(void);
-
/* Enable/disable the fan. This should be called by whatever function
* enables the power supply to the fan. */
int pwm_enable_fan(int enable);
@@ -35,7 +32,4 @@ int pwm_get_keyboard_backlight(void);
/* Set the keyboard backlight percentage (0=off, 100=max). */
int pwm_set_keyboard_backlight(int percent);
-/* Set the power LED brightness to the specified percent (0=off, 100=max). */
-int pwm_set_power_led(int percent);
-
#endif /* __CROS_EC_PWM_H */
diff --git a/include/spi.h b/include/spi.h
index 45ea75231f..00482db7e2 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -8,7 +8,4 @@
#ifndef __CROS_EC_SPI_H
#define __CROS_EC_SPI_H
-/* Initialize the SPI module ready for use */
-extern int spi_init(void);
-
#endif /* __CROS_EC_SPI_H */
diff --git a/include/usb_charge.h b/include/usb_charge.h
index 0b3b7a497f..b73f57a684 100644
--- a/include/usb_charge.h
+++ b/include/usb_charge.h
@@ -29,6 +29,4 @@ enum usb_charge_mode {
int usb_charge_set_mode(int usb_port_id, enum usb_charge_mode);
-int usb_charge_init(void);
-
#endif /* __CROS_EC_USB_CHARGE_H */