summaryrefslogtreecommitdiff
path: root/board/dragonegg
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-08-16 11:06:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 18:58:37 -0700
commit675087c355ac85a7a82d20e2244822ff786aa4ae (patch)
tree1a7d274a4ea355055e3b9ed3db622033de02bc34 /board/dragonegg
parent3c53f0413a966da25cbe803f614acd36d5c87685 (diff)
downloadchrome-ec-675087c355ac85a7a82d20e2244822ff786aa4ae.tar.gz
DragonEgg: Add support for port 2 Type C
This CL adds support for Type C port 2 which uses the TI USB422 TCPC and NX20P3481 PPC. BUG=b:111281797 BRANCH=none TEST=Verifed that port 2 works as a sink and source. Change-Id: I7ad200768d81fd95aee625e5871b2350412a4f79 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1178997 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/dragonegg')
-rw-r--r--board/dragonegg/board.c26
-rw-r--r--board/dragonegg/ec.tasklist3
-rw-r--r--board/dragonegg/gpio.inc4
3 files changed, 30 insertions, 3 deletions
diff --git a/board/dragonegg/board.c b/board/dragonegg/board.c
index 6b784a9baa..ccff76debf 100644
--- a/board/dragonegg/board.c
+++ b/board/dragonegg/board.c
@@ -9,10 +9,13 @@
#include "common.h"
#include "charger.h"
#include "console.h"
+#include "driver/ppc/nx20p348x.h"
#include "driver/ppc/sn5s330.h"
+#include "ec_commands.h"
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
+#include "host_command.h"
#include "intc.h"
#include "lid_switch.h"
#include "power.h"
@@ -26,8 +29,29 @@
static void ppc_interrupt(enum gpio_signal signal)
{
- if (signal == GPIO_USB_C0_TCPPC_INT_L)
+
+ switch (signal) {
+ case GPIO_USB_C0_TCPPC_INT_L:
sn5s330_interrupt(0);
+ break;
+
+ case GPIO_USB_C2_TCPPC_INT_ODL:
+ nx20p348x_interrupt(2);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void tcpc_alert_event(enum gpio_signal signal)
+{
+
+
+#ifdef HAS_TASK_PDCMD
+ /* Exchange status with TCPCs */
+ host_command_pd_send_status(PD_CHARGE_NO_CHANGE);
+#endif
}
#include "gpio_list.h" /* Must come after other header files. */
diff --git a/board/dragonegg/ec.tasklist b/board/dragonegg/ec.tasklist
index 04618aa7e2..cce01989ec 100644
--- a/board/dragonegg/ec.tasklist
+++ b/board/dragonegg/ec.tasklist
@@ -31,5 +31,6 @@
TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \
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_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) \
+ TASK_ALWAYS(PD_C2, pd_task, NULL, LARGER_TASK_STACK_SIZE)
diff --git a/board/dragonegg/gpio.inc b/board/dragonegg/gpio.inc
index 417402d251..ab1c7652be 100644
--- a/board/dragonegg/gpio.inc
+++ b/board/dragonegg/gpio.inc
@@ -29,7 +29,9 @@ GPIO_INT(PG_EC_RSMRST_ODL,PIN(E, 1), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(PG_EC_DSW_PWROK, PIN(D, 6), GPIO_INT_BOTH, power_signal_interrupt)
/* USB-C interrupts */
-GPIO_INT(USB_C0_TCPPC_INT_L, PIN(B, 2), GPIO_INT_FALLING, ppc_interrupt)
+GPIO_INT(USB_C0_TCPPC_INT_L, PIN(B, 2), GPIO_INT_FALLING, ppc_interrupt)
+GPIO_INT(USB_C2_TCPPC_INT_ODL, PIN(L, 1), GPIO_INT_FALLING, ppc_interrupt)
+GPIO_INT(USB_C2_TCPC_INT_ODL, PIN(K, 6), GPIO_INT_FALLING, tcpc_alert_event)
/* Misc. interrupts */
/* TODO (b:110880394) Uncomment this when support for buttons is added */