stm32: Move clock line mapping from stm32h7_adc.c to lookup_clock_line()
Use the common lookup_clock_line() code to lookup the adc clock lines. This also enables resets on the adc1/adc2 hardware block. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -43,6 +43,10 @@ lookup_clock_line(uint32_t periph_base)
|
||||
.bit = 1 << pos};
|
||||
|
||||
} else {
|
||||
if (periph_base == ADC12_COMMON_BASE)
|
||||
return (struct cline){.en = &RCC->AHB2ENR,
|
||||
.rst = &RCC->AHB2RSTR,
|
||||
.bit = RCC_AHB2ENR_ADC12EN};
|
||||
uint32_t pos = (periph_base - AHB2PERIPH_BASE) / 0x400;
|
||||
return (struct cline){.en = &RCC->AHB2ENR,
|
||||
.rst = &RCC->AHB2RSTR,
|
||||
|
||||
Reference in New Issue
Block a user