Lines Matching refs:dfsdm

94 	struct stm32_dfsdm dfsdm; /* common data exported for all instances */  member
103 static inline struct dfsdm_priv *to_stm32_dfsdm_priv(struct stm32_dfsdm *dfsdm) in to_stm32_dfsdm_priv() argument
105 return container_of(dfsdm, struct dfsdm_priv, dfsdm); in to_stm32_dfsdm_priv()
108 static int stm32_dfsdm_clk_prepare_enable(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_clk_prepare_enable() argument
110 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_clk_prepare_enable()
124 static void stm32_dfsdm_clk_disable_unprepare(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_clk_disable_unprepare() argument
126 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_clk_disable_unprepare()
138 int stm32_dfsdm_start_dfsdm(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_start_dfsdm() argument
140 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_start_dfsdm()
152 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
159 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
166 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_start_dfsdm()
193 int stm32_dfsdm_stop_dfsdm(struct stm32_dfsdm *dfsdm) in stm32_dfsdm_stop_dfsdm() argument
195 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_stop_dfsdm()
200 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_stop_dfsdm()
207 ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), in stm32_dfsdm_stop_dfsdm()
234 priv->dfsdm.base = devm_platform_get_and_ioremap_resource(pdev, 0, 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()
239 priv->dfsdm.phys_base = res->start; in stm32_dfsdm_parse_of()
282 priv->dfsdm.spi_master_freq = clk_freq / (priv->spi_clk_out_div + 1); in stm32_dfsdm_parse_of()
312 struct stm32_dfsdm *dfsdm = &priv->dfsdm; in stm32_dfsdm_probe_identification() local
318 dfsdm->num_fls = dev_data->num_filters; in stm32_dfsdm_probe_identification()
319 dfsdm->num_chs = dev_data->num_channels; in stm32_dfsdm_probe_identification()
323 ret = regmap_read(dfsdm->regmap, DFSDM_IPIDR, &id); in stm32_dfsdm_probe_identification()
341 ret = regmap_read(dfsdm->regmap, DFSDM_HWCFGR, &val); in stm32_dfsdm_probe_identification()
345 dfsdm->num_fls = FIELD_GET(DFSDM_HWCFGR_NBF_MASK, val); in stm32_dfsdm_probe_identification()
346 dfsdm->num_chs = FIELD_GET(DFSDM_HWCFGR_NBT_MASK, val); in stm32_dfsdm_probe_identification()
348 if (count > dfsdm->num_fls) { in stm32_dfsdm_probe_identification()
353 ret = regmap_read(dfsdm->regmap, DFSDM_VERR, &val); in stm32_dfsdm_probe_identification()
360 dfsdm->num_chs, dfsdm->num_fls); in stm32_dfsdm_probe_identification()
369 struct stm32_dfsdm *dfsdm; in stm32_dfsdm_probe() local
380 dfsdm = &priv->dfsdm; in stm32_dfsdm_probe()
386 dfsdm->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "dfsdm", in stm32_dfsdm_probe()
387 dfsdm->base, in stm32_dfsdm_probe()
389 if (IS_ERR(dfsdm->regmap)) { in stm32_dfsdm_probe()
390 ret = PTR_ERR(dfsdm->regmap); in stm32_dfsdm_probe()
400 dfsdm->fl_list = devm_kcalloc(&pdev->dev, dfsdm->num_fls, in stm32_dfsdm_probe()
401 sizeof(*dfsdm->fl_list), GFP_KERNEL); in stm32_dfsdm_probe()
402 if (!dfsdm->fl_list) in stm32_dfsdm_probe()
405 dfsdm->ch_list = devm_kcalloc(&pdev->dev, dfsdm->num_chs, in stm32_dfsdm_probe()
406 sizeof(*dfsdm->ch_list), GFP_KERNEL); in stm32_dfsdm_probe()
407 if (!dfsdm->ch_list) in stm32_dfsdm_probe()
410 platform_set_drvdata(pdev, dfsdm); in stm32_dfsdm_probe()
412 ret = stm32_dfsdm_clk_prepare_enable(dfsdm); in stm32_dfsdm_probe()
434 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_probe()
441 struct stm32_dfsdm *dfsdm = platform_get_drvdata(pdev); in stm32_dfsdm_core_remove() local
448 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_core_remove()
455 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_suspend() local
456 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_core_suspend()
471 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_resume() local
472 struct dfsdm_priv *priv = to_stm32_dfsdm_priv(dfsdm); in stm32_dfsdm_core_resume()
488 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_runtime_suspend() local
490 stm32_dfsdm_clk_disable_unprepare(dfsdm); in stm32_dfsdm_core_runtime_suspend()
497 struct stm32_dfsdm *dfsdm = dev_get_drvdata(dev); in stm32_dfsdm_core_runtime_resume() local
499 return stm32_dfsdm_clk_prepare_enable(dfsdm); in stm32_dfsdm_core_runtime_resume()