Skip to content

Commit 24af0c8

Browse files
djiatsaf-stdanieldegrasse
authored andcommitted
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 <[email protected]>
1 parent 12fdde6 commit 24af0c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pwm/pwm_stm32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ static int get_tim_clk(const struct stm32_pclken *pclken, uint32_t *tim_clk)
247247
if (pclken->bus == STM32_CLOCK_BUS_APB1) {
248248
#if defined(CONFIG_SOC_SERIES_STM32MP1X)
249249
apb_psc = (uint32_t)(READ_BIT(RCC->APB1DIVR, RCC_APB1DIVR_APB1DIV));
250+
#elif defined(CONFIG_SOC_SERIES_STM32H7RSX)
251+
apb_psc = STM32_PPRE1;
250252
#else
251253
apb_psc = STM32_APB1_PRESCALER;
252254
#endif
@@ -256,6 +258,8 @@ static int get_tim_clk(const struct stm32_pclken *pclken, uint32_t *tim_clk)
256258
else {
257259
#if defined(CONFIG_SOC_SERIES_STM32MP1X)
258260
apb_psc = (uint32_t)(READ_BIT(RCC->APB2DIVR, RCC_APB2DIVR_APB2DIV));
261+
#elif defined(CONFIG_SOC_SERIES_STM32H7RSX)
262+
apb_psc = STM32_PPRE2;
259263
#else
260264
apb_psc = STM32_APB2_PRESCALER;
261265
#endif

0 commit comments

Comments
 (0)