Lines Matching +full:spk +full:- +full:mute

1 // SPDX-License-Identifier: GPL-2.0
15 #include <uapi/linux/input-event-codes.h>
53 struct sdm845_snd_data *pdata = snd_soc_card_get_drvdata(rtd->card); in sdm845_slim_snd_hw_params()
61 substream->stream); in sdm845_slim_snd_hw_params()
62 if (sruntime != ERR_PTR(-ENOTSUPP)) in sdm845_slim_snd_hw_params()
63 pdata->sruntime[cpu_dai->id] = sruntime; in sdm845_slim_snd_hw_params()
68 if (ret != 0 && ret != -ENOTSUPP) { in sdm845_slim_snd_hw_params()
71 } else if (ret == -ENOTSUPP) { in sdm845_slim_snd_hw_params()
76 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in sdm845_slim_snd_hw_params()
101 dev_err(rtd->dev, "%s: invalid param format 0x%x\n", in sdm845_tdm_snd_hw_params()
103 return -EINVAL; in sdm845_tdm_snd_hw_params()
107 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in sdm845_tdm_snd_hw_params()
111 dev_err(rtd->dev, "%s: failed to set tdm slot, err:%d\n", in sdm845_tdm_snd_hw_params()
119 dev_err(rtd->dev, "%s: failed to set channel map, err:%d\n", in sdm845_tdm_snd_hw_params()
127 dev_err(rtd->dev, "%s: failed to set tdm slot, err:%d\n", in sdm845_tdm_snd_hw_params()
135 dev_err(rtd->dev, "%s: failed to set channel map, err:%d\n", in sdm845_tdm_snd_hw_params()
143 if (!strcmp(codec_dai->component->name_prefix, "Left")) { in sdm845_tdm_snd_hw_params()
149 dev_err(rtd->dev, in sdm845_tdm_snd_hw_params()
155 if (!strcmp(codec_dai->component->name_prefix, "Right")) { in sdm845_tdm_snd_hw_params()
161 dev_err(rtd->dev, in sdm845_tdm_snd_hw_params()
180 switch (cpu_dai->id) { in sdm845_snd_hw_params()
188 codec_dai->component, in sdm845_snd_hw_params()
195 dev_err(rtd->dev, in sdm845_snd_hw_params()
208 pr_err("%s: invalid dai id 0x%x\n", __func__, cpu_dai->id); in sdm845_snd_hw_params()
216 struct snd_soc_component *component = jack->private_data; in sdm845_jack_free()
224 struct snd_soc_card *card = rtd->card; in sdm845_dai_init()
228 struct snd_soc_dai_link *link = rtd->dai_link; in sdm845_dai_init()
244 if (!pdata->jack_setup) { in sdm845_dai_init()
250 &pdata->jack); in sdm845_dai_init()
253 dev_err(card->dev, "Unable to add Headphone Jack\n"); in sdm845_dai_init()
257 jack = pdata->jack.jack; in sdm845_dai_init()
263 pdata->jack_setup = true; in sdm845_dai_init()
266 switch (cpu_dai->id) { in sdm845_dai_init()
268 jack = pdata->jack.jack; in sdm845_dai_init()
269 component = codec_dai->component; in sdm845_dai_init()
271 jack->private_data = component; in sdm845_dai_init()
272 jack->private_free = sdm845_jack_free; in sdm845_dai_init()
274 &pdata->jack, NULL); in sdm845_dai_init()
275 if (rval != 0 && rval != -ENOTSUPP) { in sdm845_dai_init()
276 dev_warn(card->dev, "Failed to set jack: %d\n", rval); in sdm845_dai_init()
282 if (pdata->slim_port_setup || !link->no_pcm) in sdm845_dai_init()
291 if (rval != 0 && rval != -ENOTSUPP) in sdm845_dai_init()
298 rval = snd_soc_component_set_jack(codec_dai->component, in sdm845_dai_init()
299 &pdata->jack, NULL); in sdm845_dai_init()
300 if (rval != 0 && rval != -ENOTSUPP) { in sdm845_dai_init()
301 dev_warn(card->dev, "Failed to set jack: %d\n", rval); in sdm845_dai_init()
306 pdata->slim_port_setup = true; in sdm845_dai_init()
322 struct snd_soc_card *card = rtd->card; in sdm845_snd_startup()
329 switch (cpu_dai->id) { in sdm845_snd_startup()
333 if (++(data->pri_mi2s_clk_count) == 1) { in sdm845_snd_startup()
347 if (++(data->sec_mi2s_clk_count) == 1) { in sdm845_snd_startup()
366 if (++(data->quat_tdm_clk_count) == 1) { in sdm845_snd_startup()
376 if (!strcmp(codec_dai->component->name_prefix, in sdm845_snd_startup()
381 dev_err(rtd->dev, in sdm845_snd_startup()
387 if (!strcmp(codec_dai->component->name_prefix, in sdm845_snd_startup()
392 dev_err(rtd->dev, in sdm845_snd_startup()
403 pr_err("%s: invalid dai id 0x%x\n", __func__, cpu_dai->id); in sdm845_snd_startup()
412 struct snd_soc_card *card = rtd->card; in sdm845_snd_shutdown()
416 switch (cpu_dai->id) { in sdm845_snd_shutdown()
419 if (--(data->pri_mi2s_clk_count) == 0) { in sdm845_snd_shutdown()
430 if (--(data->sec_mi2s_clk_count) == 0) { in sdm845_snd_shutdown()
439 if (--(data->quat_tdm_clk_count) == 0) { in sdm845_snd_shutdown()
450 pr_err("%s: invalid dai id 0x%x\n", __func__, cpu_dai->id); in sdm845_snd_shutdown()
458 struct sdm845_snd_data *data = snd_soc_card_get_drvdata(rtd->card); in sdm845_snd_prepare()
460 struct sdw_stream_runtime *sruntime = data->sruntime[cpu_dai->id]; in sdm845_snd_prepare()
466 if (data->stream_prepared[cpu_dai->id]) { in sdm845_snd_prepare()
469 data->stream_prepared[cpu_dai->id] = false; in sdm845_snd_prepare()
481 * PA enable/mute are handled as part of codec DAPM and digital mute. in sdm845_snd_prepare()
489 data->stream_prepared[cpu_dai->id] = true; in sdm845_snd_prepare()
497 struct sdm845_snd_data *data = snd_soc_card_get_drvdata(rtd->card); in sdm845_snd_hw_free()
499 struct sdw_stream_runtime *sruntime = data->sruntime[cpu_dai->id]; in sdm845_snd_hw_free()
501 if (sruntime && data->stream_prepared[cpu_dai->id]) { in sdm845_snd_hw_free()
504 data->stream_prepared[cpu_dai->id] = false; in sdm845_snd_hw_free()
527 rate->min = rate->max = DEFAULT_SAMPLE_RATE_48K; in sdm845_be_hw_params_fixup()
528 channels->min = channels->max = 2; in sdm845_be_hw_params_fixup()
537 SND_SOC_DAPM_SPK("Left Spk", NULL),
538 SND_SOC_DAPM_SPK("Right Spk", NULL),
548 if (link->no_pcm == 1) { in sdm845_add_ops()
549 link->ops = &sdm845_be_ops; in sdm845_add_ops()
550 link->be_hw_params_fixup = sdm845_be_hw_params_fixup; in sdm845_add_ops()
552 link->init = sdm845_dai_init; in sdm845_add_ops()
560 struct device *dev = &pdev->dev; in sdm845_snd_platform_probe()
565 return -ENOMEM; in sdm845_snd_platform_probe()
570 return -ENOMEM; in sdm845_snd_platform_probe()
572 card->driver_name = DRIVER_NAME; in sdm845_snd_platform_probe()
573 card->dapm_widgets = sdm845_snd_widgets; in sdm845_snd_platform_probe()
574 card->num_dapm_widgets = ARRAY_SIZE(sdm845_snd_widgets); in sdm845_snd_platform_probe()
575 card->dev = dev; in sdm845_snd_platform_probe()
576 card->owner = THIS_MODULE; in sdm845_snd_platform_probe()
582 data->card = card; in sdm845_snd_platform_probe()
590 { .compatible = "qcom,sdm845-sndcard" },
591 { .compatible = "qcom,db845c-sndcard" },
592 { .compatible = "lenovo,yoga-c630-sndcard" },
600 .name = "msm-snd-sdm845",