From 24af0c8ee1305665ba889007fddd5f8c8d6ca29b Mon Sep 17 00:00:00 2001 From: Fabrice DJIATSA Date: Thu, 3 Jul 2025 16:42:56 +0200 Subject: [PATCH] drivers: pwm: stm32: add stm32h7rs bus prescalers The clock tree of the STM32H7RS series uses the ppre1 and ppre2 naming convention instead of apb1_prescaler and apb2_prescaler for bus prescaler. Signed-off-by: Fabrice DJIATSA --- drivers/pwm/pwm_stm32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pwm/pwm_stm32.c b/drivers/pwm/pwm_stm32.c index 708709bf2ef..fd53f2afa51 100644 --- a/drivers/pwm/pwm_stm32.c +++ b/drivers/pwm/pwm_stm32.c @@ -247,6 +247,8 @@ static int get_tim_clk(const struct stm32_pclken *pclken, uint32_t *tim_clk) if (pclken->bus == STM32_CLOCK_BUS_APB1) { #if defined(CONFIG_SOC_SERIES_STM32MP1X) apb_psc = (uint32_t)(READ_BIT(RCC->APB1DIVR, RCC_APB1DIVR_APB1DIV)); +#elif defined(CONFIG_SOC_SERIES_STM32H7RSX) + apb_psc = STM32_PPRE1; #else apb_psc = STM32_APB1_PRESCALER; #endif @@ -256,6 +258,8 @@ static int get_tim_clk(const struct stm32_pclken *pclken, uint32_t *tim_clk) else { #if defined(CONFIG_SOC_SERIES_STM32MP1X) apb_psc = (uint32_t)(READ_BIT(RCC->APB2DIVR, RCC_APB2DIVR_APB2DIV)); +#elif defined(CONFIG_SOC_SERIES_STM32H7RSX) + apb_psc = STM32_PPRE2; #else apb_psc = STM32_APB2_PRESCALER; #endif