From 803b5f69747021f8fb8b1fd02569b726ae37372a Mon Sep 17 00:00:00 2001 From: Tommy Chung Date: Tue, 6 Apr 2021 12:06:03 +0800 Subject: lantis: Move C1 SM5803 processing to the PD_INT task Since the SM5803 shares an interrupt line with the TCPC, allow the PD_INT task for C1 to process interrupts for this chip. This will ensure that any interrupts from the charger are handled at a high priority and cannot leave the shared IRQ line low for extended periods. BUG=none BRANCH=dedede TEST=On lantis, confirm charger attach to C1 works reliably. Signed-off-by: Tommy Chung Change-Id: Id363b743eb7825f4a03f7119248218d0259e9d5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804004 Reviewed-by: Aseda Aboagye Commit-Queue: Aseda Aboagye --- board/lantis/board.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/board/lantis/board.c b/board/lantis/board.c index ed2aea981d..cd02a4fd91 100644 --- a/board/lantis/board.c +++ b/board/lantis/board.c @@ -53,6 +53,21 @@ const int usb_port_enable[USB_PORT_COUNT] = { GPIO_EN_USB_A_5V, }; +__override void board_process_pd_alert(int port) +{ + /* + * PD_INT task will process this alert, and that task is only needed on + * C1. + */ + if (port != 1) + return; + + if (gpio_get_level(GPIO_USB_C1_INT_ODL)) + return; + + sm5803_handle_interrupt(port); +} + /* C0 interrupt line shared by BC 1.2 and charger */ static void check_c0_line(void); DECLARE_DEFERRED(check_c0_line); @@ -95,7 +110,6 @@ static void notify_c1_chips(void) { schedule_deferred_pd_interrupt(1); task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_BC12); - sm5803_interrupt(1); } static void check_c1_line(void) -- cgit v1.2.1