Lines Matching +full:aif1 +full:- +full:pins
1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation
15 #include <sound/soc-acpi.h>
19 #define RT298_CODEC_DAI "rt298-aif1"
44 /* HP jack connectors - unknown if we have jack detect */
65 struct snd_soc_card *card = runtime->card; in avs_rt298_codec_init()
66 struct snd_soc_jack_pin *pins; in avs_rt298_codec_init() local
73 pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); in avs_rt298_codec_init()
74 if (!pins) in avs_rt298_codec_init()
75 return -ENOMEM; in avs_rt298_codec_init()
78 jack, pins, num_pins); in avs_rt298_codec_init()
82 return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL); in avs_rt298_codec_init()
87 snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL); in avs_rt298_codec_exit()
100 rate->min = rate->max = 48000; in avs_rt298_be_fixup()
101 channels->min = channels->max = 2; in avs_rt298_be_fixup()
125 dev_err(rtd->dev, "Set codec sysclk failed: %d\n", ret); in avs_rt298_hw_params()
143 return -ENOMEM; in avs_create_dai_link()
145 platform->name = platform_name; in avs_create_dai_link()
147 dl->name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
148 AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot)); in avs_create_dai_link()
149 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
150 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL); in avs_create_dai_link()
151 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
152 return -ENOMEM; in avs_create_dai_link()
154 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
156 dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343A:00"); in avs_create_dai_link()
157 dl->codecs->dai_name = devm_kasprintf(dev, GFP_KERNEL, RT298_CODEC_DAI); in avs_create_dai_link()
158 if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) in avs_create_dai_link()
159 return -ENOMEM; in avs_create_dai_link()
161 dl->num_cpus = 1; in avs_create_dai_link()
162 dl->num_codecs = 1; in avs_create_dai_link()
163 dl->platforms = platform; in avs_create_dai_link()
164 dl->num_platforms = 1; in avs_create_dai_link()
165 dl->id = 0; in avs_create_dai_link()
167 dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
169 dl->dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
170 dl->init = avs_rt298_codec_init; in avs_create_dai_link()
171 dl->exit = avs_rt298_codec_exit; in avs_create_dai_link()
172 dl->be_hw_params_fixup = avs_rt298_be_fixup; in avs_create_dai_link()
173 dl->ops = &avs_rt298_ops; in avs_create_dai_link()
174 dl->nonatomic = 1; in avs_create_dai_link()
175 dl->no_pcm = 1; in avs_create_dai_link()
176 dl->dpcm_capture = 1; in avs_create_dai_link()
177 dl->dpcm_playback = 1; in avs_create_dai_link()
188 return snd_soc_component_set_jack(codec_dai->component, NULL, NULL); in avs_card_suspend_pre()
196 return snd_soc_component_set_jack(codec_dai->component, jack, NULL); in avs_card_resume_post()
205 struct device *dev = &pdev->dev; in avs_rt298_probe()
210 pname = mach->mach_params.platform; in avs_rt298_probe()
225 return -ENOMEM; in avs_rt298_probe()
227 card->name = "avs_rt298"; in avs_rt298_probe()
228 card->dev = dev; in avs_rt298_probe()
229 card->owner = THIS_MODULE; in avs_rt298_probe()
230 card->suspend_pre = avs_card_suspend_pre; in avs_rt298_probe()
231 card->resume_post = avs_card_resume_post; in avs_rt298_probe()
232 card->dai_link = dai_link; in avs_rt298_probe()
233 card->num_links = 1; in avs_rt298_probe()
234 card->controls = card_controls; in avs_rt298_probe()
235 card->num_controls = ARRAY_SIZE(card_controls); in avs_rt298_probe()
236 card->dapm_widgets = card_widgets; in avs_rt298_probe()
237 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_rt298_probe()
238 card->dapm_routes = card_base_routes; in avs_rt298_probe()
239 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_rt298_probe()
240 card->fully_routed = true; in avs_rt298_probe()