Lines Matching +full:spk +full:- +full:fmt
1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation
13 #include <sound/soc-acpi.h>
14 #include <sound/soc-dapm.h>
18 SOC_DAPM_PIN_SWITCH("Spk"),
22 SND_SOC_DAPM_SPK("Spk", NULL),
26 { "Spk", NULL, "Speaker" },
33 struct snd_mask *fmt; in avs_max98357a_be_fixup() local
37 fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); in avs_max98357a_be_fixup()
40 rate->min = rate->max = 48000; in avs_max98357a_be_fixup()
41 channels->min = channels->max = 2; in avs_max98357a_be_fixup()
44 snd_mask_none(fmt); in avs_max98357a_be_fixup()
45 snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); in avs_max98357a_be_fixup()
58 return -ENOMEM; in avs_create_dai_link()
60 platform->name = platform_name; in avs_create_dai_link()
62 dl->name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
63 AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot)); in avs_create_dai_link()
64 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
65 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL); in avs_create_dai_link()
66 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
67 return -ENOMEM; in avs_create_dai_link()
69 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
71 dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL, "MX98357A:00"); in avs_create_dai_link()
72 dl->codecs->dai_name = devm_kasprintf(dev, GFP_KERNEL, "HiFi"); in avs_create_dai_link()
73 if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) in avs_create_dai_link()
74 return -ENOMEM; in avs_create_dai_link()
76 dl->num_cpus = 1; in avs_create_dai_link()
77 dl->num_codecs = 1; in avs_create_dai_link()
78 dl->platforms = platform; in avs_create_dai_link()
79 dl->num_platforms = 1; in avs_create_dai_link()
80 dl->id = 0; in avs_create_dai_link()
81 dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
82 dl->be_hw_params_fixup = avs_max98357a_be_fixup; in avs_create_dai_link()
83 dl->nonatomic = 1; in avs_create_dai_link()
84 dl->no_pcm = 1; in avs_create_dai_link()
85 dl->dpcm_playback = 1; in avs_create_dai_link()
97 struct device *dev = &pdev->dev; in avs_max98357a_probe()
102 pname = mach->mach_params.platform; in avs_max98357a_probe()
116 return -ENOMEM; in avs_max98357a_probe()
118 card->name = "avs_max98357a"; in avs_max98357a_probe()
119 card->dev = dev; in avs_max98357a_probe()
120 card->owner = THIS_MODULE; in avs_max98357a_probe()
121 card->dai_link = dai_link; in avs_max98357a_probe()
122 card->num_links = 1; in avs_max98357a_probe()
123 card->controls = card_controls; in avs_max98357a_probe()
124 card->num_controls = ARRAY_SIZE(card_controls); in avs_max98357a_probe()
125 card->dapm_widgets = card_widgets; in avs_max98357a_probe()
126 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_max98357a_probe()
127 card->dapm_routes = card_base_routes; in avs_max98357a_probe()
128 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_max98357a_probe()
129 card->fully_routed = true; in avs_max98357a_probe()