drawcia: Check interrupt lines during init
This patch land to drawcia.
BRANCH=none
TEST=Verify C0/C1 port works.
@@ -250,8 +250,6 @@ void board_init(void)
{
int on;
- gpio_enable_interrupt(GPIO_USB_C0_INT_ODL);
-
if (get_cbi_fw_config_db() == DB_1A_HDMI) {
/* Select HDMI option */
gpio_set_level(GPIO_HDMI_SEL_L, 0);
@@ -260,7 +258,19 @@ void board_init(void)
gpio_set_level(GPIO_HDMI_SEL_L, 1);
}
+ gpio_enable_interrupt(GPIO_USB_C0_INT_ODL);
gpio_enable_interrupt(GPIO_USB_C1_INT_ODL);
+
+
+ /*
+ * If interrupt lines are already low, schedule them to be processed
+ * after inits are completed.
+ */
+ if (!gpio_get_level(GPIO_USB_C0_INT_ODL))
+ hook_call_deferred(&check_c0_line_data, 0);
+ if (!gpio_get_level(GPIO_USB_C1_INT_ODL))
+ hook_call_deferred(&check_c1_line_data, 0);
+
gpio_enable_interrupt(GPIO_USB_C0_CCSBU_OVP_ODL);
/* Enable Base Accel interrupt */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
