Lines Matching +full:spk +full:- +full:fmt

1 // SPDX-License-Identifier: GPL-2.0-only
13 #include <sound/soc-acpi.h>
14 #include <sound/soc-dapm.h>
17 #define MAX98373_DEV0_NAME "i2c-MX98373:00"
18 #define MAX98373_DEV1_NAME "i2c-MX98373:01"
19 #define MAX98373_CODEC_NAME "max98373-aif1"
33 SOC_DAPM_PIN_SWITCH("Left Spk"),
34 SOC_DAPM_PIN_SWITCH("Right Spk"),
38 SND_SOC_DAPM_SPK("Left Spk", NULL),
39 SND_SOC_DAPM_SPK("Right Spk", NULL),
43 { "Left Spk", NULL, "Left BE_OUT" },
44 { "Right Spk", NULL, "Right BE_OUT" },
51 struct snd_mask *fmt; in avs_max98373_be_fixup() local
55 fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); in avs_max98373_be_fixup()
58 rate->min = rate->max = 48000; in avs_max98373_be_fixup()
59 channels->min = channels->max = 2; in avs_max98373_be_fixup()
62 snd_mask_none(fmt); in avs_max98373_be_fixup()
63 snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); in avs_max98373_be_fixup()
75 if (!strcmp(codec_dai->component->name, MAX98373_DEV0_NAME)) { in avs_max98373_hw_params()
78 dev_err(runtime->dev, "DEV0 TDM slot err:%d\n", ret); in avs_max98373_hw_params()
82 if (!strcmp(codec_dai->component->name, MAX98373_DEV1_NAME)) { in avs_max98373_hw_params()
85 dev_err(runtime->dev, "DEV1 TDM slot err:%d\n", ret); in avs_max98373_hw_params()
107 return -ENOMEM; in avs_create_dai_link()
109 platform->name = platform_name; in avs_create_dai_link()
111 dl->name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
112 AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot)); in avs_create_dai_link()
113 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
114 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs) * 2, GFP_KERNEL); in avs_create_dai_link()
115 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
116 return -ENOMEM; in avs_create_dai_link()
118 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
120 dl->codecs[0].name = devm_kasprintf(dev, GFP_KERNEL, MAX98373_DEV0_NAME); in avs_create_dai_link()
121 dl->codecs[0].dai_name = devm_kasprintf(dev, GFP_KERNEL, MAX98373_CODEC_NAME); in avs_create_dai_link()
122 dl->codecs[1].name = devm_kasprintf(dev, GFP_KERNEL, MAX98373_DEV1_NAME); in avs_create_dai_link()
123 dl->codecs[1].dai_name = devm_kasprintf(dev, GFP_KERNEL, MAX98373_CODEC_NAME); in avs_create_dai_link()
124 if (!dl->cpus->dai_name || !dl->codecs[0].name || !dl->codecs[0].dai_name || in avs_create_dai_link()
125 !dl->codecs[1].name || !dl->codecs[1].dai_name) in avs_create_dai_link()
126 return -ENOMEM; in avs_create_dai_link()
128 dl->num_cpus = 1; in avs_create_dai_link()
129 dl->num_codecs = 2; in avs_create_dai_link()
130 dl->platforms = platform; in avs_create_dai_link()
131 dl->num_platforms = 1; in avs_create_dai_link()
132 dl->id = 0; in avs_create_dai_link()
133 dl->dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBC_CFC; in avs_create_dai_link()
134 dl->be_hw_params_fixup = avs_max98373_be_fixup; in avs_create_dai_link()
135 dl->nonatomic = 1; in avs_create_dai_link()
136 dl->no_pcm = 1; in avs_create_dai_link()
137 dl->dpcm_capture = 1; in avs_create_dai_link()
138 dl->dpcm_playback = 1; in avs_create_dai_link()
139 dl->ignore_pmdown_time = 1; in avs_create_dai_link()
140 dl->ops = &avs_max98373_ops; in avs_create_dai_link()
152 struct device *dev = &pdev->dev; in avs_max98373_probe()
157 pname = mach->mach_params.platform; in avs_max98373_probe()
171 return -ENOMEM; in avs_max98373_probe()
173 card->name = "avs_max98373"; in avs_max98373_probe()
174 card->dev = dev; in avs_max98373_probe()
175 card->owner = THIS_MODULE; in avs_max98373_probe()
176 card->dai_link = dai_link; in avs_max98373_probe()
177 card->num_links = 1; in avs_max98373_probe()
178 card->codec_conf = card_codec_conf; in avs_max98373_probe()
179 card->num_configs = ARRAY_SIZE(card_codec_conf); in avs_max98373_probe()
180 card->controls = card_controls; in avs_max98373_probe()
181 card->num_controls = ARRAY_SIZE(card_controls); in avs_max98373_probe()
182 card->dapm_widgets = card_widgets; in avs_max98373_probe()
183 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_max98373_probe()
184 card->dapm_routes = card_base_routes; in avs_max98373_probe()
185 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_max98373_probe()
186 card->fully_routed = true; in avs_max98373_probe()