Lines Matching +full:aif1 +full:- +full:pins

1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation
14 #include <sound/soc-acpi.h>
18 #define RT286_CODEC_DAI "rt286-aif1"
33 /* HP jack connectors - unknown if we have jack detect */
54 struct snd_soc_card *card = runtime->card; in avs_rt286_codec_init()
55 struct snd_soc_jack_pin *pins; in avs_rt286_codec_init() local
62 pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); in avs_rt286_codec_init()
63 if (!pins) in avs_rt286_codec_init()
64 return -ENOMEM; in avs_rt286_codec_init()
67 jack, pins, num_pins); in avs_rt286_codec_init()
71 return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL); in avs_rt286_codec_init()
76 snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL); in avs_rt286_codec_exit()
89 rate->min = rate->max = 48000; in avs_rt286_be_fixup()
90 channels->min = channels->max = 2; in avs_rt286_be_fixup()
108 dev_err(runtime->dev, "Set codec sysclk failed: %d\n", ret); in avs_rt286_hw_params()
126 return -ENOMEM; in avs_create_dai_link()
128 platform->name = platform_name; in avs_create_dai_link()
130 dl->name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
131 AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot)); in avs_create_dai_link()
132 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
133 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL); in avs_create_dai_link()
134 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
135 return -ENOMEM; in avs_create_dai_link()
137 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in avs_create_dai_link()
139 dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343A:00"); in avs_create_dai_link()
140 dl->codecs->dai_name = devm_kasprintf(dev, GFP_KERNEL, RT286_CODEC_DAI); in avs_create_dai_link()
141 if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) in avs_create_dai_link()
142 return -ENOMEM; in avs_create_dai_link()
144 dl->num_cpus = 1; in avs_create_dai_link()
145 dl->num_codecs = 1; in avs_create_dai_link()
146 dl->platforms = platform; in avs_create_dai_link()
147 dl->num_platforms = 1; in avs_create_dai_link()
148 dl->id = 0; in avs_create_dai_link()
149 dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
150 dl->init = avs_rt286_codec_init; in avs_create_dai_link()
151 dl->exit = avs_rt286_codec_exit; in avs_create_dai_link()
152 dl->be_hw_params_fixup = avs_rt286_be_fixup; in avs_create_dai_link()
153 dl->ops = &avs_rt286_ops; in avs_create_dai_link()
154 dl->nonatomic = 1; in avs_create_dai_link()
155 dl->no_pcm = 1; in avs_create_dai_link()
156 dl->dpcm_capture = 1; in avs_create_dai_link()
157 dl->dpcm_playback = 1; in avs_create_dai_link()
168 return snd_soc_component_set_jack(codec_dai->component, NULL, NULL); in avs_card_suspend_pre()
176 return snd_soc_component_set_jack(codec_dai->component, jack, NULL); in avs_card_resume_post()
185 struct device *dev = &pdev->dev; in avs_rt286_probe()
190 pname = mach->mach_params.platform; in avs_rt286_probe()
206 return -ENOMEM; in avs_rt286_probe()
208 card->name = "avs_rt286"; in avs_rt286_probe()
209 card->dev = dev; in avs_rt286_probe()
210 card->owner = THIS_MODULE; in avs_rt286_probe()
211 card->suspend_pre = avs_card_suspend_pre; in avs_rt286_probe()
212 card->resume_post = avs_card_resume_post; in avs_rt286_probe()
213 card->dai_link = dai_link; in avs_rt286_probe()
214 card->num_links = 1; in avs_rt286_probe()
215 card->controls = card_controls; in avs_rt286_probe()
216 card->num_controls = ARRAY_SIZE(card_controls); in avs_rt286_probe()
217 card->dapm_widgets = card_widgets; in avs_rt286_probe()
218 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_rt286_probe()
219 card->dapm_routes = card_base_routes; in avs_rt286_probe()
220 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_rt286_probe()
221 card->fully_routed = true; in avs_rt286_probe()