summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2021-04-06 12:06:03 +0800
committerCommit Bot <commit-bot@chromium.org>2021-04-07 00:53:16 +0000
commit803b5f69747021f8fb8b1fd02569b726ae37372a (patch)
tree2d1c1123b197e527358b422580c4d255070ca33b
parent7ee4824866dc31bbab4707fe0adabddfd4a3da7e (diff)
downloadchrome-ec-803b5f69747021f8fb8b1fd02569b726ae37372a.tar.gz
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 <tommy.chung@quanta.corp-partner.google.com> Change-Id: Id363b743eb7825f4a03f7119248218d0259e9d5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804004 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/lantis/board.c16
1 files changed, 15 insertions, 1 deletions
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)