Lines Matching refs:scodec
111 struct sun8i_codec *scodec = dev_get_drvdata(dev); in sun8i_codec_runtime_resume() local
114 regcache_cache_only(scodec->regmap, false); in sun8i_codec_runtime_resume()
116 ret = regcache_sync(scodec->regmap); in sun8i_codec_runtime_resume()
127 struct sun8i_codec *scodec = dev_get_drvdata(dev); in sun8i_codec_runtime_suspend() local
129 regcache_cache_only(scodec->regmap, true); in sun8i_codec_runtime_suspend()
130 regcache_mark_dirty(scodec->regmap); in sun8i_codec_runtime_suspend()
170 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai); in sun8i_set_fmt() local
184 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_set_fmt()
199 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_set_fmt()
213 value ^= scodec->quirks->lrck_inversion; in sun8i_set_fmt()
214 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_set_fmt()
236 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_set_fmt()
265 static u8 sun8i_codec_get_bclk_div(struct sun8i_codec *scodec, in sun8i_codec_get_bclk_div() argument
269 unsigned long clk_rate = clk_get_rate(scodec->clk_module); in sun8i_codec_get_bclk_div()
302 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai); in sun8i_codec_hw_params() local
310 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_codec_hw_params()
314 bclk_div = sun8i_codec_get_bclk_div(scodec, params_rate(params), 16); in sun8i_codec_hw_params()
315 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_codec_hw_params()
324 regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, in sun8i_codec_hw_params()
332 regmap_update_bits(scodec->regmap, SUN8I_SYS_SR_CTRL, in sun8i_codec_hw_params()
591 struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component); in sun8i_codec_component_probe() local
595 if (scodec->quirks->legacy_widgets) { in sun8i_codec_component_probe()
613 regmap_update_bits(scodec->regmap, SUN8I_SYSCLK_CTL, in sun8i_codec_component_probe()
620 regmap_update_bits(scodec->regmap, SUN8I_SYSCLK_CTL, in sun8i_codec_component_probe()
678 struct sun8i_codec *scodec; in sun8i_codec_probe() local
682 scodec = devm_kzalloc(&pdev->dev, sizeof(*scodec), GFP_KERNEL); in sun8i_codec_probe()
683 if (!scodec) in sun8i_codec_probe()
686 scodec->clk_module = devm_clk_get(&pdev->dev, "mod"); in sun8i_codec_probe()
687 if (IS_ERR(scodec->clk_module)) { in sun8i_codec_probe()
689 return PTR_ERR(scodec->clk_module); in sun8i_codec_probe()
698 scodec->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base, in sun8i_codec_probe()
700 if (IS_ERR(scodec->regmap)) { in sun8i_codec_probe()
702 return PTR_ERR(scodec->regmap); in sun8i_codec_probe()
705 scodec->quirks = of_device_get_match_data(&pdev->dev); in sun8i_codec_probe()
707 platform_set_drvdata(pdev, scodec); in sun8i_codec_probe()