Lines Matching refs:dfsdm
86 struct stm32_dfsdm dfsdm; /* common data exported for all instances */ member
95 static inline struct dfsdm_priv *to_stm32_dfsdm_priv(struct stm32_dfsdm *dfsdm) in to_stm32_dfsdm_priv() argument
97 return container_of(dfsdm, struct dfsdm_priv, dfsdm); in to_stm32_dfsdm_priv()
100 static int stm32_dfsdm_clk_prepare_enable(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_clk_prepare_enable() argument
102 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_clk_prepare_enable()
116 static void stm32_dfsdm_clk_disable_unprepare(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_clk_disable_unprepare() argument
118 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_clk_disable_unprepare()
131 int stm32_dfsdm_start_dfsdm(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_start_dfsdm() argument
133 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_start_dfsdm()
147 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
154 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
161 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
188 int stm32_dfsdm_stop_dfsdm(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_stop_dfsdm() argument
190 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_stop_dfsdm()
195 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_stop_dfsdm()
202 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_stop_dfsdm()
234 priv->dfsdm.phys_base = res->start; in stm32_dfsdm_parse_of()
235 priv->dfsdm.base = devm_ioremap_resource(&pdev->dev, res); in stm32_dfsdm_parse_of()
236 if (IS_ERR(priv->dfsdm.base)) in stm32_dfsdm_parse_of()
237 return PTR_ERR(priv->dfsdm.base); in stm32_dfsdm_parse_of()
283 priv->dfsdm.spi_master_freq = clk_freq / (priv->spi_clk_out_div + 1); in stm32_dfsdm_parse_of()
311 struct stm32_dfsdm *dfsdm; in stm32_dfsdm_probe() local
322 dfsdm = &priv->dfsdm; in stm32_dfsdm_probe()
323 dfsdm->fl_list = devm_kcalloc(&pdev->dev, dev_data->num_filters, in stm32_dfsdm_probe()
324 sizeof(*dfsdm->fl_list), GFP_KERNEL); in stm32_dfsdm_probe()
325 if (!dfsdm->fl_list) in stm32_dfsdm_probe()
328 dfsdm->num_fls = dev_data->num_filters; in stm32_dfsdm_probe()
329 dfsdm->ch_list = devm_kcalloc(&pdev->dev, dev_data->num_channels, in stm32_dfsdm_probe()
330 sizeof(*dfsdm->ch_list), in stm32_dfsdm_probe()
332 if (!dfsdm->ch_list) in stm32_dfsdm_probe()
334 dfsdm->num_chs = dev_data->num_channels; in stm32_dfsdm_probe()
340 dfsdm->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "dfsdm", in stm32_dfsdm_probe()
341 dfsdm->base, in stm32_dfsdm_probe()
343 if (IS_ERR(dfsdm->regmap)) { in stm32_dfsdm_probe()
344 ret = PTR_ERR(dfsdm->regmap); in stm32_dfsdm_probe()
350 platform_set_drvdata(pdev, dfsdm); in stm32_dfsdm_probe()
352 ret = stm32_dfsdm_clk_prepare_enable(dfsdm); in stm32_dfsdm_probe()
374 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_probe()
381 struct stm32_dfsdm *dfsdm = platform_get_drvdata(pdev); in stm32_dfsdm_core_remove() local
388 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_core_remove()
395 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_suspend() local
396 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_core_suspend()
411 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_resume() local
412 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_core_resume()
428 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_runtime_suspend() local
430 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_core_runtime_suspend()
437 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_runtime_resume() local
439 return stm32_dfsdm_clk_prepare_enable(dfsdm); in stm32_dfsdm_core_runtime_resume()