Lines Matching +full:dsp +full:- +full:aif2
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm5102.c -- WM5102 ALSA SoC Audio driver
34 #define DRV_NAME "wm5102-codec"
42 static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
43 static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
44 static DECLARE_TLV_DB_SCALE(noise_tlv, -13200, 600, 0);
45 static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
583 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm5102_sysclk_ev()
584 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_sysclk_ev()
585 struct regmap *regmap = arizona->regmap; in wm5102_sysclk_ev()
589 switch (arizona->rev) { in wm5102_sysclk_ev()
622 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm5102_adsp_power_ev()
623 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_adsp_power_ev()
629 ret = regmap_read(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, &v); in wm5102_adsp_power_ev()
631 dev_err(component->dev, in wm5102_adsp_power_ev()
633 return -EIO; in wm5102_adsp_power_ev()
641 dev_err(component->dev, in wm5102_adsp_power_ev()
653 dev_warn(component->dev, in wm5102_adsp_power_ev()
668 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_out_comp_coeff_get()
670 mutex_lock(&arizona->dac_comp_lock); in wm5102_out_comp_coeff_get()
671 put_unaligned_be16(arizona->dac_comp_coeff, in wm5102_out_comp_coeff_get()
672 ucontrol->value.bytes.data); in wm5102_out_comp_coeff_get()
673 mutex_unlock(&arizona->dac_comp_lock); in wm5102_out_comp_coeff_get()
682 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_out_comp_coeff_put()
684 mutex_lock(&arizona->dac_comp_lock); in wm5102_out_comp_coeff_put()
685 memcpy(&arizona->dac_comp_coeff, ucontrol->value.bytes.data, in wm5102_out_comp_coeff_put()
686 sizeof(arizona->dac_comp_coeff)); in wm5102_out_comp_coeff_put()
687 arizona->dac_comp_coeff = be16_to_cpu(arizona->dac_comp_coeff); in wm5102_out_comp_coeff_put()
688 mutex_unlock(&arizona->dac_comp_lock); in wm5102_out_comp_coeff_put()
697 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_out_comp_switch_get()
699 mutex_lock(&arizona->dac_comp_lock); in wm5102_out_comp_switch_get()
700 ucontrol->value.integer.value[0] = arizona->dac_comp_enabled; in wm5102_out_comp_switch_get()
701 mutex_unlock(&arizona->dac_comp_lock); in wm5102_out_comp_switch_get()
710 struct arizona *arizona = dev_get_drvdata(component->dev->parent); in wm5102_out_comp_switch_put()
712 mutex_lock(&arizona->dac_comp_lock); in wm5102_out_comp_switch_put()
713 arizona->dac_comp_enabled = ucontrol->value.integer.value[0]; in wm5102_out_comp_switch_put()
714 mutex_unlock(&arizona->dac_comp_lock); in wm5102_out_comp_switch_put()
1501 { "AIF2 Capture", NULL, "DBVDD2" },
1502 { "AIF2 Playback", NULL, "DBVDD2" },
1573 { "AIF2 Capture", NULL, "AIF2TX1" },
1574 { "AIF2 Capture", NULL, "AIF2TX2" },
1576 { "AIF2RX1", NULL, "AIF2 Playback" },
1577 { "AIF2RX2", NULL, "AIF2 Playback" },
1608 { "AIF2 Playback", NULL, "SYSCLK" },
1615 { "AIF2 Capture", NULL, "SYSCLK" },
1621 { "Audio Trace DSP", NULL, "DSP1" },
1746 return arizona_set_fll(&wm5102->fll[0], source, Fref, Fout); in wm5102_set_fll()
1748 return arizona_set_fll(&wm5102->fll[1], source, Fref, Fout); in wm5102_set_fll()
1750 return arizona_set_fll_refclk(&wm5102->fll[0], source, Fref, in wm5102_set_fll()
1753 return arizona_set_fll_refclk(&wm5102->fll[1], source, Fref, in wm5102_set_fll()
1756 return -EINVAL; in wm5102_set_fll()
1767 .name = "wm5102-aif1",
1789 .name = "wm5102-aif2",
1793 .stream_name = "AIF2 Playback",
1800 .stream_name = "AIF2 Capture",
1811 .name = "wm5102-aif3",
1833 .name = "wm5102-slim1",
1852 .name = "wm5102-slim2",
1871 .name = "wm5102-slim3",
1890 .name = "wm5102-cpu-trace",
1901 .name = "wm5102-dsp-trace",
1903 .stream_name = "Audio Trace DSP",
1917 return wm_adsp_compr_open(&priv->core.adsp[0], stream); in wm5102_open()
1923 struct arizona *arizona = priv->core.arizona; in wm5102_adsp2_irq()
1926 ret = wm_adsp_compr_handle_irq(&priv->core.adsp[0]); in wm5102_adsp2_irq()
1927 if (ret == -ENODEV) { in wm5102_adsp2_irq()
1928 dev_err(arizona->dev, "Spurious compressed data IRQ\n"); in wm5102_adsp2_irq()
1939 struct arizona *arizona = priv->core.arizona; in wm5102_component_probe()
1942 snd_soc_component_init_regmap(component, arizona->regmap); in wm5102_component_probe()
1944 ret = wm_adsp2_component_probe(&priv->core.adsp[0], component); in wm5102_component_probe()
1961 priv->core.arizona->dapm = dapm; in wm5102_component_probe()
1966 wm_adsp2_component_remove(&priv->core.adsp[0], component); in wm5102_component_probe()
1975 wm_adsp2_component_remove(&priv->core.adsp[0], component); in wm5102_component_remove()
1977 priv->core.arizona->dapm = NULL; in wm5102_component_remove()
2024 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); in wm5102_probe()
2028 wm5102 = devm_kzalloc(&pdev->dev, sizeof(struct wm5102_priv), in wm5102_probe()
2031 return -ENOMEM; in wm5102_probe()
2035 if (!dev_get_platdata(arizona->dev)) { in wm5102_probe()
2042 mutex_init(&arizona->dac_comp_lock); in wm5102_probe()
2044 wm5102->core.arizona = arizona; in wm5102_probe()
2045 wm5102->core.num_inputs = 6; in wm5102_probe()
2047 arizona_init_dvfs(&wm5102->core); in wm5102_probe()
2049 wm5102->core.adsp[0].part = "wm5102"; in wm5102_probe()
2050 wm5102->core.adsp[0].num = 1; in wm5102_probe()
2051 wm5102->core.adsp[0].type = WMFW_ADSP2; in wm5102_probe()
2052 wm5102->core.adsp[0].base = ARIZONA_DSP1_CONTROL_1; in wm5102_probe()
2053 wm5102->core.adsp[0].dev = arizona->dev; in wm5102_probe()
2054 wm5102->core.adsp[0].regmap = arizona->regmap; in wm5102_probe()
2055 wm5102->core.adsp[0].mem = wm5102_dsp1_regions; in wm5102_probe()
2056 wm5102->core.adsp[0].num_mems = ARRAY_SIZE(wm5102_dsp1_regions); in wm5102_probe()
2058 ret = wm_adsp2_init(&wm5102->core.adsp[0]); in wm5102_probe()
2062 for (i = 0; i < ARRAY_SIZE(wm5102->fll); i++) in wm5102_probe()
2063 wm5102->fll[i].vco_mult = 1; in wm5102_probe()
2065 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, in wm5102_probe()
2067 &wm5102->fll[0]); in wm5102_probe()
2068 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1, in wm5102_probe()
2070 &wm5102->fll[1]); in wm5102_probe()
2073 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2, in wm5102_probe()
2075 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3, in wm5102_probe()
2079 arizona_init_dai(&wm5102->core, i); in wm5102_probe()
2083 regmap_update_bits(arizona->regmap, wm5102_digital_vu[i], in wm5102_probe()
2086 pm_runtime_enable(&pdev->dev); in wm5102_probe()
2087 pm_runtime_idle(&pdev->dev); in wm5102_probe()
2093 dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret); in wm5102_probe()
2099 dev_warn(&pdev->dev, in wm5102_probe()
2112 ret = devm_snd_soc_register_component(&pdev->dev, in wm5102_probe()
2117 dev_err(&pdev->dev, "Failed to register component: %d\n", ret); in wm5102_probe()
2135 struct arizona *arizona = wm5102->core.arizona; in wm5102_remove()
2137 pm_runtime_disable(&pdev->dev); in wm5102_remove()
2139 wm_adsp2_remove(&wm5102->core.adsp[0]); in wm5102_remove()
2151 .name = "wm5102-codec",
2162 MODULE_ALIAS("platform:wm5102-codec");