summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-04-02 16:35:34 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-06 18:00:33 +0000
commite858299538e00490ccbab65e199307c455a7d1c8 (patch)
tree10be278a28ca03b2e384daa31d6b87518b5326f5
parent65eedb7805c7190254dd620e5fa272cc8e3dc599 (diff)
downloadchrome-ec-e858299538e00490ccbab65e199307c455a7d1c8.tar.gz
Drawcia: 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. BRANCH=None BUG=b:182534117,b:173056845 TEST=on drawcia, confirm charger attach to C1 works reliably Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6670c62ca6d59fc3f5db4151cf7142b2da1fec38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803462 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/drawcia/board.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c
index e1f91871dd..2826f254c7 100644
--- a/board/drawcia/board.c
+++ b/board/drawcia/board.c
@@ -52,6 +52,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);
@@ -94,7 +109,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)