mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 10:25:20 +00:00
I2C: Increase priority of i2c_init
Chipset sometimes needs I2C, therefore i2c_init should have a higher priority than power_common_init so i2c is available by the time the chipset might be talking to the battery. BUG=chrome-os-partner:35502, chrome-os-partner:35173 TEST=There is no "battery not responding" message at startup on veyron TEST=EC boot takes less than 1 second on veyron BRANCH=none Change-Id: Ib10b653decc7703e706d4dd1976abf0fdbc25ac2 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/241102 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
7893715cb7
commit
fe294979d6
@@ -406,7 +406,7 @@ static void i2c_init(void)
|
||||
i2c_set_timeout(i, 0);
|
||||
}
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
/**
|
||||
* Handle an interrupt on the specified port.
|
||||
|
||||
@@ -340,7 +340,7 @@ static void i2c_init(void)
|
||||
for (i = 0; i < i2c_ports_used; ++i)
|
||||
configure_port(i2c_ports[i].port, i2c_ports[i].kbps);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
static void handle_interrupt(int port)
|
||||
{
|
||||
|
||||
@@ -589,4 +589,4 @@ static void i2c_init(void)
|
||||
task_enable_irq(i2c_irqs[port]);
|
||||
}
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
@@ -63,7 +63,7 @@ static void i2c_init(void)
|
||||
for (i = 0; i < i2c_ports_used; i++)
|
||||
i2c_init_port(i);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
static void dump_i2c_reg(int port)
|
||||
{
|
||||
|
||||
@@ -380,7 +380,7 @@ static void i2c_init(void)
|
||||
task_enable_irq(STM32_IRQ_I2C2_EV);
|
||||
task_enable_irq(STM32_IRQ_I2C2_ER);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* STM32 Host I2C */
|
||||
|
||||
@@ -443,7 +443,7 @@ static void i2c_init(void)
|
||||
task_enable_irq(IRQ_SLAVE);
|
||||
#endif
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR
|
||||
/**
|
||||
|
||||
@@ -408,7 +408,7 @@ static void i2c_init(void)
|
||||
for (i = 0; i < i2c_ports_used; i++, p++)
|
||||
i2c_init_port(p);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
|
||||
DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Console commands */
|
||||
|
||||
@@ -21,16 +21,18 @@ enum hook_priority {
|
||||
HOOK_PRIO_INIT_DMA = HOOK_PRIO_FIRST + 1,
|
||||
/* LPC inits before modules which need memory-mapped I/O */
|
||||
HOOK_PRIO_INIT_LPC = HOOK_PRIO_FIRST + 1,
|
||||
/* I2C is needed before chipset inits (battery communications). */
|
||||
HOOK_PRIO_INIT_I2C = HOOK_PRIO_FIRST + 2,
|
||||
/* Chipset inits before modules which need to know its initial state. */
|
||||
HOOK_PRIO_INIT_CHIPSET = HOOK_PRIO_FIRST + 2,
|
||||
HOOK_PRIO_INIT_CHIPSET = HOOK_PRIO_FIRST + 3,
|
||||
/* Lid switch inits before power button */
|
||||
HOOK_PRIO_INIT_LID = HOOK_PRIO_FIRST + 3,
|
||||
HOOK_PRIO_INIT_LID = HOOK_PRIO_FIRST + 4,
|
||||
/* Power button inits before chipset and switch */
|
||||
HOOK_PRIO_INIT_POWER_BUTTON = HOOK_PRIO_FIRST + 4,
|
||||
HOOK_PRIO_INIT_POWER_BUTTON = HOOK_PRIO_FIRST + 5,
|
||||
/* PWM inits before modules which might use it (fans, LEDs) */
|
||||
HOOK_PRIO_INIT_PWM = HOOK_PRIO_FIRST + 5,
|
||||
HOOK_PRIO_INIT_PWM = HOOK_PRIO_FIRST + 6,
|
||||
/* Extpower inits before modules which might use it (battery, LEDs) */
|
||||
HOOK_PRIO_INIT_EXTPOWER = HOOK_PRIO_FIRST + 6,
|
||||
HOOK_PRIO_INIT_EXTPOWER = HOOK_PRIO_FIRST + 7,
|
||||
|
||||
/* Specific values to lump temperature-related hooks together */
|
||||
HOOK_PRIO_TEMP_SENSOR = 6000,
|
||||
|
||||
Reference in New Issue
Block a user