Lines Matching +full:convert +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0-only
3 // Copyright(c) 2021-2022 Intel Corporation. All rights reserved.
15 #include <sound/soc-acpi.h>
18 #define SKL_SSM_CODEC_DAI "ssm4567-hifi"
22 .dlc = COMP_CODEC_CONF("i2c-INT343B:00"),
26 .dlc = COMP_CODEC_CONF("i2c-INT343B:01"),
68 struct snd_interval *rate, *channels; in avs_ssm4567_be_fixup() local
72 channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); in avs_ssm4567_be_fixup()
75 /* The ADSP will convert the FE rate to 48k, stereo */ in avs_ssm4567_be_fixup()
76 rate->min = rate->max = 48000; in avs_ssm4567_be_fixup()
77 channels->min = channels->max = 2; in avs_ssm4567_be_fixup()
94 return -ENOMEM; in avs_create_dai_link()
96 platform->name = platform_name; in avs_create_dai_link()
98 dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", ssp_port); in avs_create_dai_link()
99 dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL); in avs_create_dai_link()
100 dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs) * 2, GFP_KERNEL); in avs_create_dai_link()
101 if (!dl->name || !dl->cpus || !dl->codecs) in avs_create_dai_link()
102 return -ENOMEM; in avs_create_dai_link()
104 dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port); in avs_create_dai_link()
105 dl->codecs[0].name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343B:00"); in avs_create_dai_link()
106 dl->codecs[0].dai_name = devm_kasprintf(dev, GFP_KERNEL, "ssm4567-hifi"); in avs_create_dai_link()
107 dl->codecs[1].name = devm_kasprintf(dev, GFP_KERNEL, "i2c-INT343B:01"); in avs_create_dai_link()
108 dl->codecs[1].dai_name = devm_kasprintf(dev, GFP_KERNEL, "ssm4567-hifi"); in avs_create_dai_link()
109 if (!dl->cpus->dai_name || !dl->codecs[0].name || !dl->codecs[0].dai_name || in avs_create_dai_link()
110 !dl->codecs[1].name || !dl->codecs[1].dai_name) in avs_create_dai_link()
111 return -ENOMEM; in avs_create_dai_link()
113 dl->num_cpus = 1; in avs_create_dai_link()
114 dl->num_codecs = 2; in avs_create_dai_link()
115 dl->platforms = platform; in avs_create_dai_link()
116 dl->num_platforms = 1; in avs_create_dai_link()
117 dl->id = 0; in avs_create_dai_link()
118 dl->dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBS_CFS; in avs_create_dai_link()
119 dl->init = avs_ssm4567_codec_init; in avs_create_dai_link()
120 dl->be_hw_params_fixup = avs_ssm4567_be_fixup; in avs_create_dai_link()
121 dl->nonatomic = 1; in avs_create_dai_link()
122 dl->no_pcm = 1; in avs_create_dai_link()
123 dl->dpcm_capture = 1; in avs_create_dai_link()
124 dl->dpcm_playback = 1; in avs_create_dai_link()
125 dl->ignore_pmdown_time = 1; in avs_create_dai_link()
137 struct device *dev = &pdev->dev; in avs_ssm4567_probe()
142 pname = mach->mach_params.platform; in avs_ssm4567_probe()
143 ssp_port = __ffs(mach->mach_params.i2s_link_mask); in avs_ssm4567_probe()
153 return -ENOMEM; in avs_ssm4567_probe()
155 card->name = "avs_ssm4567-adi"; in avs_ssm4567_probe()
156 card->dev = dev; in avs_ssm4567_probe()
157 card->owner = THIS_MODULE; in avs_ssm4567_probe()
158 card->dai_link = dai_link; in avs_ssm4567_probe()
159 card->num_links = 1; in avs_ssm4567_probe()
160 card->codec_conf = card_codec_conf; in avs_ssm4567_probe()
161 card->num_configs = ARRAY_SIZE(card_codec_conf); in avs_ssm4567_probe()
162 card->controls = card_controls; in avs_ssm4567_probe()
163 card->num_controls = ARRAY_SIZE(card_controls); in avs_ssm4567_probe()
164 card->dapm_widgets = card_widgets; in avs_ssm4567_probe()
165 card->num_dapm_widgets = ARRAY_SIZE(card_widgets); in avs_ssm4567_probe()
166 card->dapm_routes = card_base_routes; in avs_ssm4567_probe()
167 card->num_dapm_routes = ARRAY_SIZE(card_base_routes); in avs_ssm4567_probe()
168 card->fully_routed = true; in avs_ssm4567_probe()