drivers: gpio: smartbond: Add GPIO latching for PM

This adds automatic GPIO latching before going to extended sleep and
restoring state after wakeup.

Mode and state for each pin is stored, then ports are latched to retain
state when PD_COM is disabled during sleep. On wakeup mode and state for
each pin is restored and ports are unlatched to make it work again.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This commit is contained in:
Andrzej Kaczmarek 2023-06-14 14:06:15 +02:00 committed by Carles Cufí
commit 422092f2d3
3 changed files with 105 additions and 8 deletions

View file

@ -175,7 +175,6 @@ static int renesas_da1469x_init(void)
da1469x_pd_init();
da1469x_pd_acquire(MCU_PD_DOMAIN_SYS);
da1469x_pd_acquire(MCU_PD_DOMAIN_TIM);
da1469x_pd_acquire(MCU_PD_DOMAIN_COM);
return 0;
}