Lines Matching +full:codec +full:- +full:aif3

1 // SPDX-License-Identifier: GPL-2.0-only
3 * cs47l24.h -- ALSA SoC Audio driver for Cirrus Logic CS47L24
33 #define DRV_NAME "cs47l24-codec"
62 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs47l24_adsp_power_ev()
63 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in cs47l24_adsp_power_ev()
67 ret = regmap_read(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, &v); in cs47l24_adsp_power_ev()
69 dev_err(component->dev, "Failed to read SYSCLK state: %d\n", ret); in cs47l24_adsp_power_ev()
80 static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
81 static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
82 static DECLARE_TLV_DB_SCALE(noise_tlv, -13200, 600, 0);
83 static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
809 { "AIF3 Capture", NULL, "AIF3TX1" },
810 { "AIF3 Capture", NULL, "AIF3TX2" },
812 { "AIF3RX1", NULL, "AIF3 Playback" },
813 { "AIF3RX2", NULL, "AIF3 Playback" },
817 { "AIF3 Playback", NULL, "SYSCLK" },
821 { "AIF3 Capture", NULL, "SYSCLK" },
941 return arizona_set_fll(&cs47l24->fll[0], source, Fref, Fout); in cs47l24_set_fll()
943 return arizona_set_fll(&cs47l24->fll[1], source, Fref, Fout); in cs47l24_set_fll()
945 return arizona_set_fll_refclk(&cs47l24->fll[0], source, Fref, in cs47l24_set_fll()
948 return arizona_set_fll_refclk(&cs47l24->fll[1], source, Fref, in cs47l24_set_fll()
951 return -EINVAL; in cs47l24_set_fll()
962 .name = "cs47l24-aif1",
984 .name = "cs47l24-aif2",
1006 .name = "cs47l24-aif3",
1010 .stream_name = "AIF3 Playback",
1017 .stream_name = "AIF3 Capture",
1028 .name = "cs47l24-cpu-voicectrl",
1039 .name = "cs47l24-dsp-voicectrl",
1049 .name = "cs47l24-cpu-trace",
1060 .name = "cs47l24-dsp-trace",
1074 struct snd_soc_pcm_runtime *rtd = stream->private_data; in cs47l24_open()
1076 struct arizona *arizona = priv->core.arizona; in cs47l24_open()
1079 if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-voicectrl") == 0) { in cs47l24_open()
1081 } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-trace") == 0) { in cs47l24_open()
1084 dev_err(arizona->dev, in cs47l24_open()
1086 asoc_rtd_to_codec(rtd, 0)->name); in cs47l24_open()
1087 return -EINVAL; in cs47l24_open()
1090 return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream); in cs47l24_open()
1096 struct arizona *arizona = priv->core.arizona; in cs47l24_adsp2_irq()
1102 ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); in cs47l24_adsp2_irq()
1103 if (ret != -ENODEV) in cs47l24_adsp2_irq()
1114 dev_err(arizona->dev, "Spurious compressed data IRQ\n"); in cs47l24_adsp2_irq()
1125 struct arizona *arizona = priv->core.arizona; in cs47l24_component_probe()
1128 arizona->dapm = dapm; in cs47l24_component_probe()
1129 snd_soc_component_init_regmap(component, arizona->regmap); in cs47l24_component_probe()
1138 ret = wm_adsp2_component_probe(&priv->core.adsp[1], component); in cs47l24_component_probe()
1142 ret = wm_adsp2_component_probe(&priv->core.adsp[2], component); in cs47l24_component_probe()
1157 wm_adsp2_component_remove(&priv->core.adsp[1], component); in cs47l24_component_probe()
1158 wm_adsp2_component_remove(&priv->core.adsp[2], component); in cs47l24_component_probe()
1167 wm_adsp2_component_remove(&priv->core.adsp[1], component); in cs47l24_component_remove()
1168 wm_adsp2_component_remove(&priv->core.adsp[2], component); in cs47l24_component_remove()
1170 priv->core.arizona->dapm = NULL; in cs47l24_component_remove()
1210 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); in cs47l24_probe()
1216 cs47l24 = devm_kzalloc(&pdev->dev, sizeof(struct cs47l24_priv), in cs47l24_probe()
1219 return -ENOMEM; in cs47l24_probe()
1222 if (!dev_get_platdata(arizona->dev)) { in cs47l24_probe()
1231 cs47l24->core.arizona = arizona; in cs47l24_probe()
1232 cs47l24->core.num_inputs = 4; in cs47l24_probe()
1235 cs47l24->core.adsp[i].part = "cs47l24"; in cs47l24_probe()
1236 cs47l24->core.adsp[i].cs_dsp.num = i + 1; in cs47l24_probe()
1237 cs47l24->core.adsp[i].cs_dsp.type = WMFW_ADSP2; in cs47l24_probe()
1238 cs47l24->core.adsp[i].cs_dsp.dev = arizona->dev; in cs47l24_probe()
1239 cs47l24->core.adsp[i].cs_dsp.regmap = arizona->regmap; in cs47l24_probe()
1241 cs47l24->core.adsp[i].cs_dsp.base = ARIZONA_DSP1_CONTROL_1 + in cs47l24_probe()
1243 cs47l24->core.adsp[i].cs_dsp.mem = cs47l24_dsp_regions[i - 1]; in cs47l24_probe()
1244 cs47l24->core.adsp[i].cs_dsp.num_mems = in cs47l24_probe()
1247 ret = wm_adsp2_init(&cs47l24->core.adsp[i]); in cs47l24_probe()
1252 for (i = 0; i < ARRAY_SIZE(cs47l24->fll); i++) in cs47l24_probe()
1253 cs47l24->fll[i].vco_mult = 3; in cs47l24_probe()
1255 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, in cs47l24_probe()
1257 &cs47l24->fll[0]); in cs47l24_probe()
1258 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1, in cs47l24_probe()
1260 &cs47l24->fll[1]); in cs47l24_probe()
1263 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2, in cs47l24_probe()
1265 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3, in cs47l24_probe()
1269 arizona_init_dai(&cs47l24->core, i); in cs47l24_probe()
1273 regmap_update_bits(arizona->regmap, cs47l24_digital_vu[i], in cs47l24_probe()
1276 pm_runtime_enable(&pdev->dev); in cs47l24_probe()
1277 pm_runtime_idle(&pdev->dev); in cs47l24_probe()
1283 dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret); in cs47l24_probe()
1289 dev_warn(&pdev->dev, in cs47l24_probe()
1302 ret = devm_snd_soc_register_component(&pdev->dev, in cs47l24_probe()
1307 dev_err(&pdev->dev, "Failed to register component: %d\n", ret); in cs47l24_probe()
1325 struct arizona *arizona = cs47l24->core.arizona; in cs47l24_remove()
1327 pm_runtime_disable(&pdev->dev); in cs47l24_remove()
1329 wm_adsp2_remove(&cs47l24->core.adsp[1]); in cs47l24_remove()
1330 wm_adsp2_remove(&cs47l24->core.adsp[2]); in cs47l24_remove()
1342 .name = "cs47l24-codec",
1353 MODULE_ALIAS("platform:cs47l24-codec");