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>
17 #define RT286_CODEC_DAI "rt286-aif1"
32 /* HP jack connectors - unknown if we have jack detect */
53 struct snd_soc_card *card = runtime->card; in avs_rt286_codec_init()
54 struct snd_soc_jack_pin *pins; in avs_rt286_codec_init() local
61 pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); in avs_rt286_codec_init()
62 if (!pins) in avs_rt286_codec_init()
63 return -ENOMEM; in avs_rt286_codec_init()
66 pins, num_pins); in avs_rt286_codec_init()
70 return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL); in avs_rt286_codec_init()
75 snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL); in avs_rt286_codec_exit()
88 rate->min = rate->max = 48000; in avs_rt286_be_fixup()
89 channels->min = channels->max = 2; in avs_rt286_be_fixup()
107 dev_err(runtime->dev, "Set codec sysclk failed: %d\n", ret); in avs_rt286_hw_params()
125 return -ENOMEM; in avs_create_dai_link()
127 platform->name = platform_name; in avs_create_dai_link()
129 dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", ssp_port); in avs_create_dai_link()
130 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
131 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL); in avs_create_dai_link()
132 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
133 return -ENOMEM; in avs_create_dai_link()
135 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port); in avs_create_dai_link()
136 dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343A:00"); in avs_create_dai_link()
137 dl->codecs->dai_name = devm_kasprintf(dev, GFP_KERNEL, RT286_CODEC_DAI); in avs_create_dai_link()
138 if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name) in avs_create_dai_link()
139 return -ENOMEM; in avs_create_dai_link()
141 dl->num_cpus = 1; in avs_create_dai_link()
142 dl->num_codecs = 1; in avs_create_dai_link()
143 dl->platforms = platform; in avs_create_dai_link()
144 dl->num_platforms = 1; in avs_create_dai_link()
145 dl->id = 0; in avs_create_dai_link()
146 dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
147 dl->init = avs_rt286_codec_init; in avs_create_dai_link()
148 dl->exit = avs_rt286_codec_exit; in avs_create_dai_link()
149 dl->be_hw_params_fixup = avs_rt286_be_fixup; in avs_create_dai_link()
150 dl->ops = &avs_rt286_ops; in avs_create_dai_link()
151 dl->nonatomic = 1; in avs_create_dai_link()
152 dl->no_pcm = 1; in avs_create_dai_link()
153 dl->dpcm_capture = 1; in avs_create_dai_link()
154 dl->dpcm_playback = 1; in avs_create_dai_link()
165 return snd_soc_component_set_jack(codec_dai->component, NULL, NULL); in avs_card_suspend_pre()
173 return snd_soc_component_set_jack(codec_dai->component, jack, NULL); in avs_card_resume_post()
182 struct device *dev = &pdev->dev; in avs_rt286_probe()
187 pname = mach->mach_params.platform; in avs_rt286_probe()
188 ssp_port = __ffs(mach->mach_params.i2s_link_mask); in avs_rt286_probe()
199 return -ENOMEM; in avs_rt286_probe()
201 card->name = "avs_rt286"; in avs_rt286_probe()
202 card->dev = dev; in avs_rt286_probe()
203 card->owner = THIS_MODULE; in avs_rt286_probe()
204 card->suspend_pre = avs_card_suspend_pre; in avs_rt286_probe()
205 card->resume_post = avs_card_resume_post; in avs_rt286_probe()
206 card->dai_link = dai_link; in avs_rt286_probe()
207 card->num_links = 1; in avs_rt286_probe()
208 card->controls = card_controls; in avs_rt286_probe()
209 card->num_controls = ARRAY_SIZE(card_controls); in avs_rt286_probe()
210 card->dapm_widgets = card_widgets; in avs_rt286_probe()
211 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_rt286_probe()
212 card->dapm_routes = card_base_routes; in avs_rt286_probe()
213 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_rt286_probe()
214 card->fully_routed = true; in avs_rt286_probe()