Lines Matching +full:msm8916 +full:- +full:qdsp6 +full:- +full:sndcard
1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <uapi/linux/input-event-codes.h>
18 #include <dt-bindings/sound/apq8016-lpass.h>
20 #include "qdsp6/q6afe.h"
62 struct snd_soc_card *card = rtd->card; in apq8016_dai_init()
69 writel(readl(pdata->spkr_iomux) | SPKR_CTL_PRI_WS_SLAVE_SEL_11, in apq8016_dai_init()
70 pdata->spkr_iomux); in apq8016_dai_init()
75 writel(readl(pdata->mic_iomux) | MIC_CTRL_QUA_WS_SLAVE_SEL_10 | in apq8016_dai_init()
77 pdata->mic_iomux); in apq8016_dai_init()
81 value = readl(pdata->spkr_iomux) & in apq8016_dai_init()
86 SPKR_CTL_TLMM_WS_EN_SEL_SEC, pdata->spkr_iomux); in apq8016_dai_init()
89 writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL | in apq8016_dai_init()
91 pdata->mic_iomux); in apq8016_dai_init()
96 dev_err(card->dev, "unsupported cpu dai configuration\n"); in apq8016_dai_init()
97 return -EINVAL; in apq8016_dai_init()
101 if (!pdata->jack_setup) { in apq8016_dai_init()
110 &pdata->jack, in apq8016_dai_init()
115 dev_err(card->dev, "Unable to add Headphone Jack\n"); in apq8016_dai_init()
119 jack = pdata->jack.jack; in apq8016_dai_init()
125 pdata->jack_setup = true; in apq8016_dai_init()
130 component = codec_dai->component; in apq8016_dai_init()
134 if (rval != 0 && rval != -ENOTSUPP) { in apq8016_dai_init()
135 dev_warn(card->dev, "Failed to set mclk: %d\n", rval); in apq8016_dai_init()
138 rval = snd_soc_component_set_jack(component, &pdata->jack, NULL); in apq8016_dai_init()
139 if (rval != 0 && rval != -ENOTSUPP) { in apq8016_dai_init()
140 dev_warn(card->dev, "Failed to set jack: %d\n", rval); in apq8016_dai_init()
152 return apq8016_dai_init(rtd, cpu_dai->id); in apq8016_sbc_dai_init()
161 link->init = apq8016_sbc_dai_init; in apq8016_sbc_add_ops()
166 switch (cpu_dai->id) { in qdsp6_dai_get_lpass_id()
180 return -EINVAL; in qdsp6_dai_get_lpass_id()
194 struct snd_soc_pcm_runtime *rtd = substream->private_data; in msm8916_qdsp6_startup()
195 struct snd_soc_card *card = rtd->card; in msm8916_qdsp6_startup()
204 if (++data->mi2s_clk_count[mi2s] > 1) in msm8916_qdsp6_startup()
209 dev_err(card->dev, "Failed to enable LPAIF bit clk: %d\n", ret); in msm8916_qdsp6_startup()
215 struct snd_soc_pcm_runtime *rtd = substream->private_data; in msm8916_qdsp6_shutdown()
216 struct snd_soc_card *card = rtd->card; in msm8916_qdsp6_shutdown()
225 if (--data->mi2s_clk_count[mi2s] > 0) in msm8916_qdsp6_shutdown()
230 dev_err(card->dev, "Failed to disable LPAIF bit clk: %d\n", ret); in msm8916_qdsp6_shutdown()
247 rate->min = rate->max = 48000; in msm8916_qdsp6_be_hw_params_fixup()
248 channels->min = channels->max = 2; in msm8916_qdsp6_be_hw_params_fixup()
259 /* Make it obvious to userspace that QDSP6 is used */ in msm8916_qdsp6_add_ops()
260 card->components = "qdsp6"; in msm8916_qdsp6_add_ops()
263 if (link->no_pcm) { in msm8916_qdsp6_add_ops()
264 link->init = msm8916_qdsp6_dai_init; in msm8916_qdsp6_add_ops()
265 link->ops = &msm8916_qdsp6_be_ops; in msm8916_qdsp6_add_ops()
266 link->be_hw_params_fixup = msm8916_qdsp6_be_hw_params_fixup; in msm8916_qdsp6_add_ops()
289 struct device *dev = &pdev->dev; in apq8016_sbc_platform_probe()
294 add_ops = device_get_match_data(&pdev->dev); in apq8016_sbc_platform_probe()
296 return -EINVAL; in apq8016_sbc_platform_probe()
300 return -ENOMEM; in apq8016_sbc_platform_probe()
302 card = &data->card; in apq8016_sbc_platform_probe()
303 card->dev = dev; in apq8016_sbc_platform_probe()
304 card->owner = THIS_MODULE; in apq8016_sbc_platform_probe()
305 card->dapm_widgets = apq8016_sbc_dapm_widgets; in apq8016_sbc_platform_probe()
306 card->num_dapm_widgets = ARRAY_SIZE(apq8016_sbc_dapm_widgets); in apq8016_sbc_platform_probe()
307 card->controls = apq8016_sbc_snd_controls; in apq8016_sbc_platform_probe()
308 card->num_controls = ARRAY_SIZE(apq8016_sbc_snd_controls); in apq8016_sbc_platform_probe()
314 data->mic_iomux = devm_platform_ioremap_resource_byname(pdev, "mic-iomux"); in apq8016_sbc_platform_probe()
315 if (IS_ERR(data->mic_iomux)) in apq8016_sbc_platform_probe()
316 return PTR_ERR(data->mic_iomux); in apq8016_sbc_platform_probe()
318 data->spkr_iomux = devm_platform_ioremap_resource_byname(pdev, "spkr-iomux"); in apq8016_sbc_platform_probe()
319 if (IS_ERR(data->spkr_iomux)) in apq8016_sbc_platform_probe()
320 return PTR_ERR(data->spkr_iomux); in apq8016_sbc_platform_probe()
325 return devm_snd_soc_register_card(&pdev->dev, card); in apq8016_sbc_platform_probe()
329 { .compatible = "qcom,apq8016-sbc-sndcard", .data = apq8016_sbc_add_ops },
330 { .compatible = "qcom,msm8916-qdsp6-sndcard", .data = msm8916_qdsp6_add_ops },
337 .name = "qcom-apq8016-sbc",