Lines Matching +full:aif1 +full:- +full:pins
1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation. All rights reserved.
14 #include <sound/soc-acpi.h>
30 /* HP jack connectors - unknown if we have jack detect */
51 struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component; in avs_rt286_codec_init()
52 struct snd_soc_jack_pin *pins; in avs_rt286_codec_init() local
54 struct snd_soc_card *card = runtime->card; in avs_rt286_codec_init()
60 pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); in avs_rt286_codec_init()
61 if (!pins) in avs_rt286_codec_init()
62 return -ENOMEM; in avs_rt286_codec_init()
65 pins, num_pins); in avs_rt286_codec_init()
84 rate->min = rate->max = 48000; in avs_rt286_be_fixup()
85 channels->min = channels->max = 2; in avs_rt286_be_fixup()
97 struct snd_soc_pcm_runtime *runtime = substream->private_data; in avs_rt286_hw_params()
103 dev_err(runtime->dev, "Set codec sysclk failed: %d\n", ret); in avs_rt286_hw_params()
121 return -ENOMEM; in avs_create_dai_link()
123 platform->name = platform_name; in avs_create_dai_link()
125 dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", ssp_port); in avs_create_dai_link()
126 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
127 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL); in avs_create_dai_link()
128 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
129 return -ENOMEM; in avs_create_dai_link()
131 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port); in avs_create_dai_link()
132 dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343A:00"); in avs_create_dai_link()
133 dl->codecs->dai_name = devm_kasprintf(dev, GFP_KERNEL, "rt286-aif1"); in avs_create_dai_link()
134 if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) in avs_create_dai_link()
135 return -ENOMEM; in avs_create_dai_link()
137 dl->num_cpus = 1; in avs_create_dai_link()
138 dl->num_codecs = 1; in avs_create_dai_link()
139 dl->platforms = platform; in avs_create_dai_link()
140 dl->num_platforms = 1; in avs_create_dai_link()
141 dl->id = 0; in avs_create_dai_link()
142 dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
143 dl->init = avs_rt286_codec_init; in avs_create_dai_link()
144 dl->be_hw_params_fixup = avs_rt286_be_fixup; in avs_create_dai_link()
145 dl->ops = &avs_rt286_ops; in avs_create_dai_link()
146 dl->nonatomic = 1; in avs_create_dai_link()
147 dl->no_pcm = 1; in avs_create_dai_link()
148 dl->dpcm_capture = 1; in avs_create_dai_link()
149 dl->dpcm_playback = 1; in avs_create_dai_link()
166 return -ENOMEM; in avs_create_dapm_routes()
171 dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Playback"); in avs_create_dapm_routes()
174 return -ENOMEM; in avs_create_dapm_routes()
178 dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Capture"); in avs_create_dapm_routes()
180 return -ENOMEM; in avs_create_dapm_routes()
221 struct device *dev = &pdev->dev; in avs_rt286_probe()
226 pname = mach->mach_params.platform; in avs_rt286_probe()
227 ssp_port = __ffs(mach->mach_params.i2s_link_mask); in avs_rt286_probe()
244 return -ENOMEM; in avs_rt286_probe()
246 card->name = "avs_rt286"; in avs_rt286_probe()
247 card->dev = dev; in avs_rt286_probe()
248 card->owner = THIS_MODULE; in avs_rt286_probe()
249 card->remove = avs_card_remove; in avs_rt286_probe()
250 card->suspend_pre = avs_card_suspend_pre; in avs_rt286_probe()
251 card->resume_post = avs_card_resume_post; in avs_rt286_probe()
252 card->dai_link = dai_link; in avs_rt286_probe()
253 card->num_links = 1; in avs_rt286_probe()
254 card->controls = card_controls; in avs_rt286_probe()
255 card->num_controls = ARRAY_SIZE(card_controls); in avs_rt286_probe()
256 card->dapm_widgets = card_widgets; in avs_rt286_probe()
257 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_rt286_probe()
258 card->dapm_routes = routes; in avs_rt286_probe()
259 card->num_dapm_routes = num_routes; in avs_rt286_probe()
260 card->fully_routed = true; in avs_rt286_probe()