Lines Matching +full:dsp +full:- +full:aif1
1 // SPDX-License-Identifier: GPL-2.0-only
5 // Copyright (C) 2015-2019 Cirrus Logic, Inc. and
23 #include <linux/irqchip/irq-madera.h>
33 #define DRV_NAME "cs47l35-codec"
90 snd_soc_dapm_to_component(w->dapm); in cs47l35_adsp_power_ev()
92 struct madera_priv *priv = &cs47l35->core; in cs47l35_adsp_power_ev()
93 struct madera *madera = priv->madera; in cs47l35_adsp_power_ev()
97 ret = regmap_read(madera->regmap, MADERA_DSP_CLOCK_1, &freq); in cs47l35_adsp_power_ev()
99 dev_err(madera->dev, in cs47l35_adsp_power_ev()
109 ret = madera_set_adsp_clk(&cs47l35->core, w->shift, freq); in cs47l35_adsp_power_ev()
130 snd_soc_dapm_to_component(w->dapm); in cs47l35_hp_post_enable()
133 switch (w->shift) { in cs47l35_hp_post_enable()
154 snd_soc_dapm_to_component(w->dapm); in cs47l35_hp_post_disable()
156 switch (w->shift) { in cs47l35_hp_post_disable()
196 return -EINVAL; in cs47l35_hp_ev()
625 SND_SOC_DAPM_OUTPUT("DSP Trigger Out"),
1122 { "AIF1 Capture", NULL, "AIF1TX1" },
1123 { "AIF1 Capture", NULL, "AIF1TX2" },
1124 { "AIF1 Capture", NULL, "AIF1TX3" },
1125 { "AIF1 Capture", NULL, "AIF1TX4" },
1126 { "AIF1 Capture", NULL, "AIF1TX5" },
1127 { "AIF1 Capture", NULL, "AIF1TX6" },
1129 { "AIF1RX1", NULL, "AIF1 Playback" },
1130 { "AIF1RX2", NULL, "AIF1 Playback" },
1131 { "AIF1RX3", NULL, "AIF1 Playback" },
1132 { "AIF1RX4", NULL, "AIF1 Playback" },
1133 { "AIF1RX5", NULL, "AIF1 Playback" },
1134 { "AIF1RX6", NULL, "AIF1 Playback" },
1164 { "AIF1 Playback", NULL, "SYSCLK" },
1170 { "AIF1 Capture", NULL, "SYSCLK" },
1176 { "Voice Control DSP", NULL, "DSP3" },
1178 { "Audio Trace DSP", NULL, "DSP1" },
1267 { "DSP Trigger Out", NULL, "DSP1 Trigger Output" },
1268 { "DSP Trigger Out", NULL, "DSP2 Trigger Output" },
1269 { "DSP Trigger Out", NULL, "DSP3 Trigger Output" },
1341 return madera_set_fll_refclk(&cs47l35->fll, source, fref, in cs47l35_set_fll()
1344 return madera_set_fll_syncclk(&cs47l35->fll, source, fref, in cs47l35_set_fll()
1347 return -EINVAL; in cs47l35_set_fll()
1357 .name = "cs47l35-aif1",
1361 .stream_name = "AIF1 Playback",
1368 .stream_name = "AIF1 Capture",
1379 .name = "cs47l35-aif2",
1401 .name = "cs47l35-aif3",
1423 .name = "cs47l35-slim1",
1442 .name = "cs47l35-slim2",
1461 .name = "cs47l35-cpu-voicectrl",
1472 .name = "cs47l35-dsp-voicectrl",
1474 .stream_name = "Voice Control DSP",
1482 .name = "cs47l35-cpu-trace",
1493 .name = "cs47l35-dsp-trace",
1495 .stream_name = "Audio Trace DSP",
1507 struct snd_soc_pcm_runtime *rtd = stream->private_data; in cs47l35_open()
1509 struct madera_priv *priv = &cs47l35->core; in cs47l35_open()
1510 struct madera *madera = priv->madera; in cs47l35_open()
1513 if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-voicectrl") == 0) { in cs47l35_open()
1515 } else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-trace") == 0) { in cs47l35_open()
1518 dev_err(madera->dev, in cs47l35_open()
1520 snd_soc_rtd_to_codec(rtd, 0)->name); in cs47l35_open()
1521 return -EINVAL; in cs47l35_open()
1524 return wm_adsp_compr_open(&priv->adsp[n_adsp], stream); in cs47l35_open()
1530 struct madera_priv *priv = &cs47l35->core; in cs47l35_adsp2_irq()
1531 struct madera *madera = priv->madera; in cs47l35_adsp2_irq()
1537 ret = wm_adsp_compr_handle_irq(&priv->adsp[i]); in cs47l35_adsp2_irq()
1538 if (ret != -ENODEV) in cs47l35_adsp2_irq()
1542 blocking_notifier_call_chain(&madera->notifier, in cs47l35_adsp2_irq()
1549 dev_err(madera->dev, "Spurious compressed data IRQ\n"); in cs47l35_adsp2_irq()
1563 struct madera *madera = cs47l35->core.madera; in cs47l35_component_probe()
1566 snd_soc_component_init_regmap(component, madera->regmap); in cs47l35_component_probe()
1568 mutex_lock(&madera->dapm_ptr_lock); in cs47l35_component_probe()
1569 madera->dapm = snd_soc_component_get_dapm(component); in cs47l35_component_probe()
1570 mutex_unlock(&madera->dapm_ptr_lock); in cs47l35_component_probe()
1591 wm_adsp2_component_probe(&cs47l35->core.adsp[i], component); in cs47l35_component_probe()
1599 struct madera *madera = cs47l35->core.madera; in cs47l35_component_remove()
1602 mutex_lock(&madera->dapm_ptr_lock); in cs47l35_component_remove()
1603 madera->dapm = NULL; in cs47l35_component_remove()
1604 mutex_unlock(&madera->dapm_ptr_lock); in cs47l35_component_remove()
1607 wm_adsp2_component_remove(&cs47l35->core.adsp[i], component); in cs47l35_component_remove()
1649 struct madera *madera = dev_get_drvdata(pdev->dev.parent); in cs47l35_probe()
1656 if (!madera->irq_dev) { in cs47l35_probe()
1657 dev_dbg(&pdev->dev, "irqchip driver not ready\n"); in cs47l35_probe()
1658 return -EPROBE_DEFER; in cs47l35_probe()
1661 cs47l35 = devm_kzalloc(&pdev->dev, sizeof(struct cs47l35), GFP_KERNEL); in cs47l35_probe()
1663 return -ENOMEM; in cs47l35_probe()
1666 cs47l35->core.madera = madera; in cs47l35_probe()
1667 cs47l35->core.dev = &pdev->dev; in cs47l35_probe()
1668 cs47l35->core.num_inputs = 4; in cs47l35_probe()
1670 ret = madera_core_init(&cs47l35->core); in cs47l35_probe()
1674 ret = madera_init_overheat(&cs47l35->core); in cs47l35_probe()
1682 dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret); in cs47l35_probe()
1688 dev_warn(&pdev->dev, "Failed to set DSP IRQ wake: %d\n", ret); in cs47l35_probe()
1691 cs47l35->core.adsp[i].part = "cs47l35"; in cs47l35_probe()
1692 cs47l35->core.adsp[i].cs_dsp.num = i + 1; in cs47l35_probe()
1693 cs47l35->core.adsp[i].cs_dsp.type = WMFW_ADSP2; in cs47l35_probe()
1694 cs47l35->core.adsp[i].cs_dsp.rev = 1; in cs47l35_probe()
1695 cs47l35->core.adsp[i].cs_dsp.dev = madera->dev; in cs47l35_probe()
1696 cs47l35->core.adsp[i].cs_dsp.regmap = madera->regmap_32bit; in cs47l35_probe()
1698 cs47l35->core.adsp[i].cs_dsp.base = wm_adsp2_control_bases[i]; in cs47l35_probe()
1699 cs47l35->core.adsp[i].cs_dsp.mem = cs47l35_dsp_regions[i]; in cs47l35_probe()
1700 cs47l35->core.adsp[i].cs_dsp.num_mems = in cs47l35_probe()
1703 ret = wm_adsp2_init(&cs47l35->core.adsp[i]); in cs47l35_probe()
1705 for (--i; i >= 0; --i) in cs47l35_probe()
1706 wm_adsp2_remove(&cs47l35->core.adsp[i]); in cs47l35_probe()
1711 madera_init_fll(madera, 1, MADERA_FLL1_CONTROL_1 - 1, &cs47l35->fll); in cs47l35_probe()
1714 madera_init_dai(&cs47l35->core, i); in cs47l35_probe()
1718 regmap_update_bits(madera->regmap, cs47l35_digital_vu[i], in cs47l35_probe()
1721 pm_runtime_enable(&pdev->dev); in cs47l35_probe()
1722 pm_runtime_idle(&pdev->dev); in cs47l35_probe()
1724 ret = devm_snd_soc_register_component(&pdev->dev, in cs47l35_probe()
1729 dev_err(&pdev->dev, "Failed to register component: %d\n", ret); in cs47l35_probe()
1736 pm_runtime_disable(&pdev->dev); in cs47l35_probe()
1739 wm_adsp2_remove(&cs47l35->core.adsp[i]); in cs47l35_probe()
1744 madera_free_overheat(&cs47l35->core); in cs47l35_probe()
1746 madera_core_free(&cs47l35->core); in cs47l35_probe()
1756 pm_runtime_disable(&pdev->dev); in cs47l35_remove()
1759 wm_adsp2_remove(&cs47l35->core.adsp[i]); in cs47l35_remove()
1761 madera_set_irq_wake(cs47l35->core.madera, MADERA_IRQ_DSP_IRQ1, 0); in cs47l35_remove()
1762 madera_free_irq(cs47l35->core.madera, MADERA_IRQ_DSP_IRQ1, cs47l35); in cs47l35_remove()
1763 madera_free_overheat(&cs47l35->core); in cs47l35_remove()
1764 madera_core_free(&cs47l35->core); in cs47l35_remove()
1769 .name = "cs47l35-codec",
1777 MODULE_SOFTDEP("pre: madera irq-madera arizona-micsupp");
1781 MODULE_ALIAS("platform:cs47l35-codec");