diff options
Diffstat (limited to 'board/brya/board.c')
-rw-r--r-- | board/brya/board.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/brya/board.c b/board/brya/board.c index 4c3c89567e..93b75977e9 100644 --- a/board/brya/board.c +++ b/board/brya/board.c @@ -121,3 +121,26 @@ static void set_board_id_1_gpios(void) } DECLARE_HOOK(HOOK_INIT, set_board_id_1_gpios, HOOK_PRIO_FIRST); +/* + * ALT function group MODULE_ADC are set in HOOK_PRIO_INIT_ADC. + * Reclaim these as GPIO as needed for board ID 1. + */ + +static void id_1_reclaim_adc(void) +{ + if (get_board_id() != 1) + return; + + /* + * GPIO_ID_1_USB_C0_C2_TCPC_RST_ODL is on GPIO34 + * + * The TCPC has already been reset by board_tcpc_init() executed + * from HOOK_PRIO_INIT_CHIPSET. Later, the pin gets set to ADC6 + * in HOOK_PRIO_INIT_ADC, so we simply need to set the pin back + * to GPIO34. + */ + gpio_set_flags(GPIO_ID_1_USB_C0_C2_TCPC_RST_ODL, GPIO_ODR_HIGH); + gpio_set_alternate_function(GPIO_PORT_3, BIT(4), GPIO_ALT_FUNC_NONE); +} + +DECLARE_HOOK(HOOK_INIT, id_1_reclaim_adc, HOOK_PRIO_INIT_ADC + 1); |