Lines Matching +full:spkr +full:- +full:iomux
1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <uapi/linux/input-event-codes.h>
18 #include <dt-bindings/sound/apq8016-lpass.h>
19 #include <dt-bindings/sound/qcom,q6afe.h>
63 struct snd_soc_card *card = rtd->card; in apq8016_dai_init()
70 writel(readl(pdata->spkr_iomux) | SPKR_CTL_PRI_WS_SLAVE_SEL_11, in apq8016_dai_init()
71 pdata->spkr_iomux); in apq8016_dai_init()
76 writel(readl(pdata->mic_iomux) | MIC_CTRL_QUA_WS_SLAVE_SEL_10 | in apq8016_dai_init()
78 pdata->mic_iomux); in apq8016_dai_init()
82 value = readl(pdata->spkr_iomux) & in apq8016_dai_init()
87 SPKR_CTL_TLMM_WS_EN_SEL_SEC, pdata->spkr_iomux); in apq8016_dai_init()
90 writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL | in apq8016_dai_init()
92 pdata->mic_iomux); in apq8016_dai_init()
97 dev_err(card->dev, "unsupported cpu dai configuration\n"); in apq8016_dai_init()
98 return -EINVAL; in apq8016_dai_init()
102 if (!pdata->jack_setup) { in apq8016_dai_init()
111 &pdata->jack, in apq8016_dai_init()
116 dev_err(card->dev, "Unable to add Headphone Jack\n"); in apq8016_dai_init()
120 jack = pdata->jack.jack; in apq8016_dai_init()
126 pdata->jack_setup = true; in apq8016_dai_init()
131 component = codec_dai->component; in apq8016_dai_init()
135 if (rval != 0 && rval != -ENOTSUPP) { in apq8016_dai_init()
136 dev_warn(card->dev, "Failed to set mclk: %d\n", rval); in apq8016_dai_init()
139 rval = snd_soc_component_set_jack(component, &pdata->jack, NULL); in apq8016_dai_init()
140 if (rval != 0 && rval != -ENOTSUPP) { in apq8016_dai_init()
141 dev_warn(card->dev, "Failed to set jack: %d\n", rval); in apq8016_dai_init()
153 return apq8016_dai_init(rtd, cpu_dai->id); in apq8016_sbc_dai_init()
162 link->init = apq8016_sbc_dai_init; in apq8016_sbc_add_ops()
167 switch (cpu_dai->id) { in qdsp6_dai_get_lpass_id()
181 return -EINVAL; in qdsp6_dai_get_lpass_id()
196 struct snd_soc_card *card = rtd->card; in msm8916_qdsp6_startup()
205 if (++data->mi2s_clk_count[mi2s] > 1) in msm8916_qdsp6_startup()
210 dev_err(card->dev, "Failed to enable LPAIF bit clk: %d\n", ret); in msm8916_qdsp6_startup()
217 struct snd_soc_card *card = rtd->card; in msm8916_qdsp6_shutdown()
226 if (--data->mi2s_clk_count[mi2s] > 0) in msm8916_qdsp6_shutdown()
231 dev_err(card->dev, "Failed to disable LPAIF bit clk: %d\n", ret); in msm8916_qdsp6_shutdown()
248 rate->min = rate->max = 48000; in msm8916_qdsp6_be_hw_params_fixup()
249 channels->min = channels->max = 2; in msm8916_qdsp6_be_hw_params_fixup()
261 card->components = "qdsp6"; in msm8916_qdsp6_add_ops()
264 if (link->no_pcm) { in msm8916_qdsp6_add_ops()
265 link->init = msm8916_qdsp6_dai_init; in msm8916_qdsp6_add_ops()
266 link->ops = &msm8916_qdsp6_be_ops; in msm8916_qdsp6_add_ops()
267 link->be_hw_params_fixup = msm8916_qdsp6_be_hw_params_fixup; in msm8916_qdsp6_add_ops()
290 struct device *dev = &pdev->dev; in apq8016_sbc_platform_probe()
295 add_ops = device_get_match_data(&pdev->dev); in apq8016_sbc_platform_probe()
297 return -EINVAL; in apq8016_sbc_platform_probe()
301 return -ENOMEM; in apq8016_sbc_platform_probe()
303 card = &data->card; in apq8016_sbc_platform_probe()
304 card->dev = dev; in apq8016_sbc_platform_probe()
305 card->owner = THIS_MODULE; in apq8016_sbc_platform_probe()
306 card->dapm_widgets = apq8016_sbc_dapm_widgets; in apq8016_sbc_platform_probe()
307 card->num_dapm_widgets = ARRAY_SIZE(apq8016_sbc_dapm_widgets); in apq8016_sbc_platform_probe()
308 card->controls = apq8016_sbc_snd_controls; in apq8016_sbc_platform_probe()
309 card->num_controls = ARRAY_SIZE(apq8016_sbc_snd_controls); in apq8016_sbc_platform_probe()
315 data->mic_iomux = devm_platform_ioremap_resource_byname(pdev, "mic-iomux"); in apq8016_sbc_platform_probe()
316 if (IS_ERR(data->mic_iomux)) in apq8016_sbc_platform_probe()
317 return PTR_ERR(data->mic_iomux); in apq8016_sbc_platform_probe()
319 data->spkr_iomux = devm_platform_ioremap_resource_byname(pdev, "spkr-iomux"); in apq8016_sbc_platform_probe()
320 if (IS_ERR(data->spkr_iomux)) in apq8016_sbc_platform_probe()
321 return PTR_ERR(data->spkr_iomux); in apq8016_sbc_platform_probe()
326 return devm_snd_soc_register_card(&pdev->dev, card); in apq8016_sbc_platform_probe()
330 { .compatible = "qcom,apq8016-sbc-sndcard", .data = apq8016_sbc_add_ops },
331 { .compatible = "qcom,msm8916-qdsp6-sndcard", .data = msm8916_qdsp6_add_ops },
338 .name = "qcom-apq8016-sbc",