Lines Matching +full:codec +full:- +full:aif1
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);
777 { "AIF1 Capture", NULL, "AIF1TX1" },
778 { "AIF1 Capture", NULL, "AIF1TX2" },
779 { "AIF1 Capture", NULL, "AIF1TX3" },
780 { "AIF1 Capture", NULL, "AIF1TX4" },
781 { "AIF1 Capture", NULL, "AIF1TX5" },
782 { "AIF1 Capture", NULL, "AIF1TX6" },
783 { "AIF1 Capture", NULL, "AIF1TX7" },
784 { "AIF1 Capture", NULL, "AIF1TX8" },
786 { "AIF1RX1", NULL, "AIF1 Playback" },
787 { "AIF1RX2", NULL, "AIF1 Playback" },
788 { "AIF1RX3", NULL, "AIF1 Playback" },
789 { "AIF1RX4", NULL, "AIF1 Playback" },
790 { "AIF1RX5", NULL, "AIF1 Playback" },
791 { "AIF1RX6", NULL, "AIF1 Playback" },
792 { "AIF1RX7", NULL, "AIF1 Playback" },
793 { "AIF1RX8", NULL, "AIF1 Playback" },
815 { "AIF1 Playback", NULL, "SYSCLK" },
819 { "AIF1 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()
966 .name = "cs47l24-aif1",
970 .stream_name = "AIF1 Playback",
977 .stream_name = "AIF1 Capture",
988 .name = "cs47l24-aif2",
1010 .name = "cs47l24-aif3",
1032 .name = "cs47l24-cpu-voicectrl",
1043 .name = "cs47l24-dsp-voicectrl",
1053 .name = "cs47l24-cpu-trace",
1064 .name = "cs47l24-dsp-trace",
1078 struct snd_soc_pcm_runtime *rtd = stream->private_data; in cs47l24_open()
1080 struct arizona *arizona = priv->core.arizona; in cs47l24_open()
1083 if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-voicectrl") == 0) { in cs47l24_open()
1085 } else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-trace") == 0) { in cs47l24_open()
1088 dev_err(arizona->dev, in cs47l24_open()
1090 snd_soc_rtd_to_codec(rtd, 0)->name); in cs47l24_open()
1091 return -EINVAL; in cs47l24_open()
1094 return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream); in cs47l24_open()
1100 struct arizona *arizona = priv->core.arizona; in cs47l24_adsp2_irq()
1106 ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); in cs47l24_adsp2_irq()
1107 if (ret != -ENODEV) in cs47l24_adsp2_irq()
1118 dev_err(arizona->dev, "Spurious compressed data IRQ\n"); in cs47l24_adsp2_irq()
1129 struct arizona *arizona = priv->core.arizona; in cs47l24_component_probe()
1132 arizona->dapm = dapm; in cs47l24_component_probe()
1133 snd_soc_component_init_regmap(component, arizona->regmap); in cs47l24_component_probe()
1142 ret = wm_adsp2_component_probe(&priv->core.adsp[1], component); in cs47l24_component_probe()
1146 ret = wm_adsp2_component_probe(&priv->core.adsp[2], component); in cs47l24_component_probe()
1161 wm_adsp2_component_remove(&priv->core.adsp[1], component); in cs47l24_component_probe()
1162 wm_adsp2_component_remove(&priv->core.adsp[2], component); in cs47l24_component_probe()
1171 wm_adsp2_component_remove(&priv->core.adsp[1], component); in cs47l24_component_remove()
1172 wm_adsp2_component_remove(&priv->core.adsp[2], component); in cs47l24_component_remove()
1174 priv->core.arizona->dapm = NULL; in cs47l24_component_remove()
1214 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); in cs47l24_probe()
1220 cs47l24 = devm_kzalloc(&pdev->dev, sizeof(struct cs47l24_priv), in cs47l24_probe()
1223 return -ENOMEM; in cs47l24_probe()
1226 if (!dev_get_platdata(arizona->dev)) { in cs47l24_probe()
1235 cs47l24->core.arizona = arizona; in cs47l24_probe()
1236 cs47l24->core.num_inputs = 4; in cs47l24_probe()
1239 cs47l24->core.adsp[i].part = "cs47l24"; in cs47l24_probe()
1240 cs47l24->core.adsp[i].cs_dsp.num = i + 1; in cs47l24_probe()
1241 cs47l24->core.adsp[i].cs_dsp.type = WMFW_ADSP2; in cs47l24_probe()
1242 cs47l24->core.adsp[i].cs_dsp.dev = arizona->dev; in cs47l24_probe()
1243 cs47l24->core.adsp[i].cs_dsp.regmap = arizona->regmap; in cs47l24_probe()
1245 cs47l24->core.adsp[i].cs_dsp.base = ARIZONA_DSP1_CONTROL_1 + in cs47l24_probe()
1247 cs47l24->core.adsp[i].cs_dsp.mem = cs47l24_dsp_regions[i - 1]; in cs47l24_probe()
1248 cs47l24->core.adsp[i].cs_dsp.num_mems = in cs47l24_probe()
1251 ret = wm_adsp2_init(&cs47l24->core.adsp[i]); in cs47l24_probe()
1256 for (i = 0; i < ARRAY_SIZE(cs47l24->fll); i++) in cs47l24_probe()
1257 cs47l24->fll[i].vco_mult = 3; in cs47l24_probe()
1259 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, in cs47l24_probe()
1261 &cs47l24->fll[0]); in cs47l24_probe()
1262 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1, in cs47l24_probe()
1264 &cs47l24->fll[1]); in cs47l24_probe()
1267 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2, in cs47l24_probe()
1269 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3, in cs47l24_probe()
1273 arizona_init_dai(&cs47l24->core, i); in cs47l24_probe()
1277 regmap_update_bits(arizona->regmap, cs47l24_digital_vu[i], in cs47l24_probe()
1280 pm_runtime_enable(&pdev->dev); in cs47l24_probe()
1281 pm_runtime_idle(&pdev->dev); in cs47l24_probe()
1287 dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret); in cs47l24_probe()
1293 dev_warn(&pdev->dev, in cs47l24_probe()
1306 ret = devm_snd_soc_register_component(&pdev->dev, in cs47l24_probe()
1311 dev_err(&pdev->dev, "Failed to register component: %d\n", ret); in cs47l24_probe()
1329 struct arizona *arizona = cs47l24->core.arizona; in cs47l24_remove()
1331 pm_runtime_disable(&pdev->dev); in cs47l24_remove()
1333 wm_adsp2_remove(&cs47l24->core.adsp[1]); in cs47l24_remove()
1334 wm_adsp2_remove(&cs47l24->core.adsp[2]); in cs47l24_remove()
1344 .name = "cs47l24-codec",
1355 MODULE_ALIAS("platform:cs47l24-codec");