summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/charger_bq24725.c9
-rw-r--r--common/main.c13
-rw-r--r--common/port80.c14
-rw-r--r--common/temp_sensor.c7
4 files changed, 7 insertions, 36 deletions
diff --git a/common/charger_bq24725.c b/common/charger_bq24725.c
index bd52e2e854..5df2cc7803 100644
--- a/common/charger_bq24725.c
+++ b/common/charger_bq24725.c
@@ -160,8 +160,8 @@ int charger_set_voltage(int voltage)
return sbc_write(SB_CHARGING_VOLTAGE, voltage);
}
-/* Initialization */
-int charger_init(void)
+/* Charging power state initialization */
+int charger_post_init(void)
{
/* bq24725 power on reset state:
* watch dog timer = 175 sec
@@ -169,12 +169,7 @@ int charger_init(void)
* charging voltage = 0 mV
* charging current = 0 mA
*/
- return EC_SUCCESS;
-}
-/* Charging power state initialization */
-int charger_post_init(void)
-{
/* Set charger input current limit */
return charger_set_input_current(CONFIG_CHARGER_INPUT_CURRENT);
}
diff --git a/common/main.c b/common/main.c
index 1b72d9f9ab..606a04d830 100644
--- a/common/main.c
+++ b/common/main.c
@@ -114,13 +114,13 @@ int main(void)
* RO image and once in the RW image. */
vboot_init();
- system_init();
+ /* Initialize driver modules. These can occur in any order. State
+ * machines are initialized in their task functions, not here. */
+
gpio_init();
#ifdef CONFIG_LPC
- port_80_init();
lpc_init();
- uart_comx_enable();
#endif
#ifdef CONFIG_SPI
spi_init();
@@ -131,10 +131,6 @@ int main(void)
#ifdef CONFIG_I2C
i2c_init();
#endif
-#ifdef CONFIG_TASK_TEMPSENSOR
- temp_sensor_init();
- chip_temp_sensor_init();
-#endif
#ifdef CONFIG_TASK_POWERBTN
power_button_init();
#endif
@@ -144,9 +140,6 @@ int main(void)
#ifdef CONFIG_ONEWIRE
onewire_init();
#endif
-#ifdef CONFIG_CHARGER
- charger_init();
-#endif
#ifdef CONFIG_PECI
peci_init();
#endif
diff --git a/common/port80.c b/common/port80.c
index 9e6ba40c1f..77ff6fa471 100644
--- a/common/port80.c
+++ b/common/port80.c
@@ -14,8 +14,8 @@
#define HISTORY_LEN 16
static uint8_t history[HISTORY_LEN];
-static int head = 0; /* Next index to use / oldest previous entry */
-static int scroll = 0;
+static int head; /* Next index to use / oldest previous entry */
+static int scroll;
void port_80_write(int data)
@@ -30,7 +30,6 @@ void port_80_write(int data)
head = (head + 1) & (HISTORY_LEN - 1);
}
-
/*****************************************************************************/
/* Console commands */
@@ -58,12 +57,3 @@ static int command_port80(int argc, char **argv)
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(port80, command_port80);
-
-/*****************************************************************************/
-/* Initialization */
-
-int port_80_init(void)
-{
- memset(history, 0, sizeof(history));
- return EC_SUCCESS;
-}
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 40d245bc0c..36c24632cb 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -127,10 +127,3 @@ static int command_temps(int argc, char **argv)
}
DECLARE_CONSOLE_COMMAND(temps, command_temps);
-/*****************************************************************************/
-/* Initialization */
-
-int temp_sensor_init(void)
-{
- return EC_SUCCESS;
-}