Skip to content

Commit eaa525c

Browse files
Alain Volmatkartben
authored andcommitted
clock_control: stm32: add I2C periph get_subsys_rate for mp13
Add code to handle stm32_clock_control_get_subsys_rate for all i2c instances from I2C1 to I2C5. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
1 parent d78842a commit eaa525c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/clock_control/clock_stm32_ll_mp13.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ static int stm32_clock_control_get_subsys_rate(const struct device *dev,
7070
case LL_APB1_GRP1_PERIPH_UART4:
7171
*rate = LL_RCC_GetUARTClockFreq(LL_RCC_UART4_CLKSOURCE);
7272
break;
73+
case LL_APB1_GRP1_PERIPH_I2C1:
74+
case LL_APB1_GRP1_PERIPH_I2C2:
75+
*rate = LL_RCC_GetI2CClockFreq(LL_RCC_I2C12_CLKSOURCE);
76+
break;
77+
default:
78+
return -ENOTSUP;
79+
}
80+
break;
81+
case STM32_CLOCK_BUS_APB6:
82+
switch (pclken->enr) {
83+
case LL_APB6_GRP1_PERIPH_I2C3:
84+
*rate = LL_RCC_GetI2CClockFreq(LL_RCC_I2C3_CLKSOURCE);
85+
break;
86+
case LL_APB6_GRP1_PERIPH_I2C4:
87+
*rate = LL_RCC_GetI2CClockFreq(LL_RCC_I2C4_CLKSOURCE);
88+
break;
89+
case LL_APB6_GRP1_PERIPH_I2C5:
90+
*rate = LL_RCC_GetI2CClockFreq(LL_RCC_I2C5_CLKSOURCE);
91+
break;
7392
default:
7493
return -ENOTSUP;
7594
}

0 commit comments

Comments
 (0)