Lines Matching defs:scodec
197 struct sun8i_codec *scodec = dev_get_drvdata(dev);
200 regcache_cache_only(scodec->regmap, false);
202 ret = regcache_sync(scodec->regmap);
213 struct sun8i_codec *scodec = dev_get_drvdata(dev);
215 regcache_cache_only(scodec->regmap, true);
216 regcache_mark_dirty(scodec->regmap);
256 static int sun8i_codec_update_sample_rate(struct sun8i_codec *scodec)
262 struct sun8i_codec_aif *aif = &scodec->aifs[i];
276 regmap_update_bits(scodec->regmap, SUN8I_SYS_SR_CTRL,
285 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai);
306 regmap_update_bits(scodec->regmap, SUN8I_AIF_CLK_CTRL(dai->id),
310 regmap_update_bits(scodec->regmap, SUN8I_AIF_CLK_CTRL(dai->id),
343 regmap_update_bits(scodec->regmap, SUN8I_AIF_CLK_CTRL(dai->id),
384 invert ^= scodec->quirks->lrck_inversion;
387 regmap_update_bits(scodec->regmap, SUN8I_AIF_CLK_CTRL(dai->id),
398 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai);
399 struct sun8i_codec_aif *aif = &scodec->aifs[dai->id];
435 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai);
442 if (!scodec->sysclk_refcnt)
444 else if (scodec->sysclk_rate == 22579200)
446 else if (scodec->sysclk_rate == 24576000)
514 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai);
515 struct sun8i_codec_aif *aif = &scodec->aifs[dai->id];
541 regmap_update_bits(scodec->regmap, SUN8I_AIF_CLK_CTRL(dai->id),
553 const struct sun8i_codec_aif *partner_aif = &scodec->aifs[partner];
570 regmap_update_bits(scodec->regmap, clk_reg,
579 regmap_update_bits(scodec->regmap, clk_reg,
592 ret = (aif->open_streams ? clk_set_rate : clk_set_rate_exclusive)(scodec->clk_module,
602 scodec->sysclk_refcnt++;
603 scodec->sysclk_rate = sysclk_rate;
609 return sun8i_codec_update_sample_rate(scodec);
615 struct sun8i_codec *scodec = snd_soc_dai_get_drvdata(dai);
616 struct sun8i_codec_aif *aif = &scodec->aifs[dai->id];
622 clk_rate_exclusive_put(scodec->clk_module);
623 scodec->sysclk_refcnt--;
757 struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component);
758 struct sun8i_codec_aif *aif = &scodec->aifs[w->sname[3] - '1'];
766 return sun8i_codec_update_sample_rate(scodec);
1232 struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component);
1236 if (scodec->quirks->legacy_widgets) {
1254 regmap_update_bits(scodec->regmap, SUN8I_SYSCLK_CTL,
1261 regmap_update_bits(scodec->regmap, SUN8I_SYSCLK_CTL,
1266 sun8i_codec_update_sample_rate(scodec);
1294 struct sun8i_codec *scodec;
1298 scodec = devm_kzalloc(&pdev->dev, sizeof(*scodec), GFP_KERNEL);
1299 if (!scodec)
1302 scodec->clk_module = devm_clk_get(&pdev->dev, "mod");
1303 if (IS_ERR(scodec->clk_module)) {
1305 return PTR_ERR(scodec->clk_module);
1314 scodec->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base,
1316 if (IS_ERR(scodec->regmap)) {
1318 return PTR_ERR(scodec->regmap);
1321 scodec->quirks = of_device_get_match_data(&pdev->dev);
1323 platform_set_drvdata(pdev, scodec);