summaryrefslogtreecommitdiff
path: root/board/dragonegg
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-10-16 08:23:37 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-10-18 19:01:26 -0700
commitbd20798aa85a0bbb2dca3b9ce9a9d563e215fa0c (patch)
treec17e00f64b2608c2f099d661ddfdd21e1bb90e1d /board/dragonegg
parentf4d4224e4e3f0dd2137c9afcf08a5a949669a568 (diff)
downloadchrome-ec-bd20798aa85a0bbb2dca3b9ce9a9d563e215fa0c.tar.gz
dragonegg: make PD interrupt use higher priority task
Start using the higher priority task to handle PD interrupts from C2. Remove higher priority tasks for C0 and C1 since they are handle by chip code in interrupt context method already. BRANCH=none BUG=b:112088135 TEST=dragonegg PD still works Change-Id: I90f2557b73ce6331f012057839e5de22646183c6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1283243 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/dragonegg')
-rw-r--r--board/dragonegg/board.c20
-rw-r--r--board/dragonegg/ec.tasklist3
2 files changed, 16 insertions, 7 deletions
diff --git a/board/dragonegg/board.c b/board/dragonegg/board.c
index 5c55852012..18b4c7c6dc 100644
--- a/board/dragonegg/board.c
+++ b/board/dragonegg/board.c
@@ -27,6 +27,7 @@
#include "switch.h"
#include "system.h"
#include "uart.h"
+#include "usb_pd.h"
#include "util.h"
static void ppc_interrupt(enum gpio_signal signal)
@@ -48,12 +49,23 @@ static void ppc_interrupt(enum gpio_signal signal)
static void tcpc_alert_event(enum gpio_signal signal)
{
+ int port = -1;
+ /*
+ * Since C0/C1 TCPC are embedded within EC, we don't need the PDCMD
+ * tasks.The (embedded) TCPC status since chip driver code will
+ * handles its own interrupts and forward the correct events to
+ * the PD_C0/1 task. See it83xx/intc.c
+ */
+ switch (signal) {
+ case GPIO_USB_C2_TCPC_INT_ODL:
+ port = 2;
+ break;
+ default:
+ return;
+ }
-#ifdef HAS_TASK_PDCMD
- /* Exchange status with TCPCs */
- host_command_pd_send_status(PD_CHARGE_NO_CHANGE);
-#endif
+ schedule_deferred_pd_interrupt(port);
}
#include "gpio_list.h" /* Must come after other header files. */
diff --git a/board/dragonegg/ec.tasklist b/board/dragonegg/ec.tasklist
index e4f8c3ab93..e12fde51cc 100644
--- a/board/dragonegg/ec.tasklist
+++ b/board/dragonegg/ec.tasklist
@@ -36,7 +36,4 @@
TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(PD_C2, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, TASK_STACK_SIZE) \
TASK_ALWAYS(PD_INT_C2, pd_interrupt_handler_task, 2, TASK_STACK_SIZE)
-