blob: 985c70af9a75a68d0569a9670cf596503df45131 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* Copyright 2022 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gpio/gpio_int.h"
#include "usbc/ppc.h"
#include <zephyr/init.h>
static int board_usbc_init(const struct device *unused)
{
/* Enable PPC interrupts. */
gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_ppc_bc12));
gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c1_ppc));
return 0;
}
SYS_INIT(board_usbc_init, APPLICATION, 1);
void ppc_interrupt(enum gpio_signal signal)
{
if (signal == GPIO_SIGNAL(DT_NODELABEL(usb_c0_ppc_bc12_int_odl))) {
ppc_chips[0].drv->interrupt(0);
}
if (signal == GPIO_SIGNAL(DT_NODELABEL(usb_c1_ppc_int_odl))) {
ppc_chips[1].drv->interrupt(1);
}
}
|