drivers: gpio: fix gpio warning

Implement conditional compilation to avoid the warning:
- Use LL_PWR_EnableVDDIO2() for STM32U3 series.
- Use LL_PWR_EnableVddIO2() for other series.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
This commit is contained in:
Khaoula Bidani 2025-05-22 22:28:45 +02:00 committed by Daniel DeGrasse
commit a9aa341ed5

View file

@ -722,8 +722,12 @@ static int gpio_stm32_init(const struct device *dev)
DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpiog))
z_stm32_hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
/* Port G[15:2] requires external power supply */
/* Cf: L4/L5 RM, Chapter "Independent I/O supply rail" */
/* Cf: L4/L5/U3 RM, Chapter "Independent I/O supply rail" */
#ifdef CONFIG_SOC_SERIES_STM32U3X
LL_PWR_EnableVDDIO2();
#else
LL_PWR_EnableVddIO2();
#endif
z_stm32_hsem_unlock(CFG_HW_RCC_SEMID);
#endif