Lines Matching refs:common

62 			       struct stm32_adc_common *common)  in stm32h7_adc_clk_sel()  argument
70 if (!clk_valid(&common->bclk)) { in stm32h7_adc_clk_sel()
80 if (clk_valid(&common->aclk)) { in stm32h7_adc_clk_sel()
85 rate = clk_get_rate(&common->aclk); in stm32h7_adc_clk_sel()
105 rate = clk_get_rate(&common->bclk); in stm32h7_adc_clk_sel()
128 common->rate = rate / div; in stm32h7_adc_clk_sel()
131 clrsetbits_le32(common->base + STM32H7_ADC_CCR, in stm32h7_adc_clk_sel()
137 ckmode ? "bus" : "adc", div, common->rate / 1000); in stm32h7_adc_clk_sel()
144 struct stm32_adc_common *common = dev_get_priv(dev); in stm32_adc_core_probe() local
147 common->base = dev_read_addr_ptr(dev); in stm32_adc_core_probe()
148 if (!common->base) { in stm32_adc_core_probe()
153 ret = device_get_supply_regulator(dev, "vref-supply", &common->vref); in stm32_adc_core_probe()
159 ret = regulator_get_value(common->vref); in stm32_adc_core_probe()
164 common->vref_uv = ret; in stm32_adc_core_probe()
166 ret = clk_get_by_name(dev, "adc", &common->aclk); in stm32_adc_core_probe()
168 ret = clk_enable(&common->aclk); in stm32_adc_core_probe()
175 ret = clk_get_by_name(dev, "bus", &common->bclk); in stm32_adc_core_probe()
177 ret = clk_enable(&common->bclk); in stm32_adc_core_probe()
184 ret = stm32h7_adc_clk_sel(dev, common); in stm32_adc_core_probe()
191 if (clk_valid(&common->bclk)) in stm32_adc_core_probe()
192 clk_disable(&common->bclk); in stm32_adc_core_probe()
195 if (clk_valid(&common->aclk)) in stm32_adc_core_probe()
196 clk_disable(&common->aclk); in stm32_adc_core_probe()