Lines Matching +full:imon +full:- +full:slot +full:- +full:no

1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <sound/soc-acpi.h>
10 #include <sound/soc-dai.h>
11 #include <sound/soc-dapm.h>
14 #include "../common/soc-intel-quirks.h"
37 for_each_acpi_dev_match(adev, hid, NULL, -1) in get_num_codecs()
89 * The tx mask indicates which channel(s) contains output IV-sense data and
90 * others should set to Hi-Z. Here we get the channel number from codec's ACPI
91 * device property "maxim,vmon-slot-no" and "maxim,imon-slot-no" to generate the
99 if (device_property_read_u32(dev, "maxim,vmon-slot-no", &vmon_slot)) in max_98373_get_tx_mask()
102 if (device_property_read_u32(dev, "maxim,imon-slot-no", &imon_slot)) in max_98373_get_tx_mask()
114 struct snd_soc_dai_link *dai_link = rtd->dai_link; in max_98373_hw_params()
124 dev_err(codec_dai->dev, "only 2 amps are supported\n"); in max_98373_hw_params()
125 return -EINVAL; in max_98373_hw_params()
128 switch (dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in max_98373_hw_params()
131 /* get the tplg configured tdm slot number */ in max_98373_hw_params()
134 dev_err(rtd->dev, "invalid tdm slots %d\n", in max_98373_hw_params()
136 return -EINVAL; in max_98373_hw_params()
140 tx_mask = max_98373_get_tx_mask(codec_dai->dev); in max_98373_hw_params()
142 return -EINVAL; in max_98373_hw_params()
145 dev_err(codec_dai->dev, "invalid tx mask 0x%x, used 0x%x\n", in max_98373_hw_params()
147 return -EINVAL; in max_98373_hw_params()
153 * check if tdm slot number is too small for channel in max_98373_hw_params()
157 dev_err(codec_dai->dev, "slot mismatch, tx %d slots %d\n", in max_98373_hw_params()
159 return -EINVAL; in max_98373_hw_params()
163 dev_err(codec_dai->dev, "slot mismatch, rx %d slots %d\n", in max_98373_hw_params()
165 return -EINVAL; in max_98373_hw_params()
168 dev_dbg(codec_dai->dev, "set tdm slot: tx 0x%x rx 0x%x slots %d width %d\n", in max_98373_hw_params()
177 dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n", in max_98373_hw_params()
183 dev_dbg(codec_dai->dev, "codec is in I2S mode\n"); in max_98373_hw_params()
199 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) in max_98373_trigger()
205 snd_soc_component_get_dapm(cpu_dai->component); in max_98373_trigger()
209 codec_dai->component->name_prefix); in max_98373_trigger()
241 struct snd_soc_card *card = rtd->card; in max_98373_spk_codec_init()
247 ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets, in max_98373_spk_codec_init()
250 dev_err(rtd->dev, "fail to add max98373 widgets, ret %d\n", in max_98373_spk_codec_init()
258 dev_err(rtd->dev, "fail to add max98373 kcontrols, ret %d\n", in max_98373_spk_codec_init()
263 ret = snd_soc_dapm_add_routes(&card->dapm, max_98373_dapm_routes, in max_98373_spk_codec_init()
266 dev_err(rtd->dev, "fail to add max98373 routes, ret %d\n", in max_98373_spk_codec_init()
272 dev_err(rtd->dev, "max98373: invalid num_codecs %d\n", num_codecs); in max_98373_spk_codec_init()
273 return -EINVAL; in max_98373_spk_codec_init()
281 link->codecs = max_98373_components; in max_98373_dai_link()
282 link->num_codecs = ARRAY_SIZE(max_98373_components); in max_98373_dai_link()
283 link->init = max_98373_spk_codec_init; in max_98373_dai_link()
284 link->ops = &max_98373_ops; in max_98373_dai_link()
290 card->codec_conf = max_98373_codec_conf; in max_98373_set_codec_conf()
291 card->num_configs = ARRAY_SIZE(max_98373_codec_conf); in max_98373_set_codec_conf()
383 struct snd_soc_dai_link *dai_link = rtd->dai_link; in max_98390_hw_params()
389 dev_err(codec_dai->dev, "invalid codec index %d\n", i); in max_98390_hw_params()
390 return -ENODEV; in max_98390_hw_params()
393 switch (dai_link->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in max_98390_hw_params()
396 /* 4-slot TDM */ in max_98390_hw_params()
403 dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n", in max_98390_hw_params()
409 dev_dbg(codec_dai->dev, "codec is in I2S mode\n"); in max_98390_hw_params()
418 struct snd_soc_card *card = rtd->card; in max_98390_init()
425 ret = snd_soc_dapm_new_controls(&card->dapm, max_98390_tt_dapm_widgets, in max_98390_init()
428 dev_err(rtd->dev, "unable to add tweeter dapm widgets, ret %d\n", in max_98390_init()
437 dev_err(rtd->dev, "unable to add tweeter controls, ret %d\n", in max_98390_init()
442 ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_tt_dapm_routes, in max_98390_init()
445 dev_err(rtd->dev, "unable to add tweeter dapm routes, ret %d\n", in max_98390_init()
453 ret = snd_soc_dapm_new_controls(&card->dapm, maxim_2spk_widgets, in max_98390_init()
456 dev_err(rtd->dev, "fail to add max98390 woofer widgets, ret %d\n", in max_98390_init()
464 dev_err(rtd->dev, "fail to add max98390 woofer kcontrols, ret %d\n", in max_98390_init()
469 ret = snd_soc_dapm_add_routes(&card->dapm, max_98390_dapm_routes, in max_98390_init()
472 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", in max_98390_init()
478 dev_err(rtd->dev, "invalid codec number %d\n", num_codecs); in max_98390_init()
479 return -EINVAL; in max_98390_init()
493 link->codecs = max_98390_components; in max_98390_dai_link()
498 link->num_codecs = num_codecs; in max_98390_dai_link()
506 link->init = max_98390_init; in max_98390_dai_link()
507 link->ops = &max_98390_ops; in max_98390_dai_link()
515 card->codec_conf = max_98390_codec_conf; in max_98390_set_codec_conf()
520 card->codec_conf = max_98390_cml_codec_conf; in max_98390_set_codec_conf()
524 card->num_configs = num_codecs; in max_98390_set_codec_conf()
566 struct snd_soc_card *card = rtd->card; in max_98357a_init()
569 ret = snd_soc_dapm_new_controls(&card->dapm, max_98357a_dapm_widgets, in max_98357a_init()
572 dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret); in max_98357a_init()
580 dev_err(rtd->dev, "unable to add card controls, ret %d\n", ret); in max_98357a_init()
584 ret = snd_soc_dapm_add_routes(&card->dapm, max_98357a_dapm_routes, in max_98357a_init()
588 dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); in max_98357a_init()
595 link->codecs = max_98357a_components; in max_98357a_dai_link()
596 link->num_codecs = ARRAY_SIZE(max_98357a_components); in max_98357a_dai_link()
597 link->init = max_98357a_init; in max_98357a_dai_link()
603 link->codecs = max_98360a_components; in max_98360a_dai_link()
604 link->num_codecs = ARRAY_SIZE(max_98360a_components); in max_98360a_dai_link()
605 link->init = max_98357a_init; in max_98360a_dai_link()