Lines Matching +full:headset +full:- +full:codec

1 // SPDX-License-Identifier: GPL-2.0-only
4 // CX2072X codec
17 #include <sound/soc-acpi.h>
19 #include "../atom/sst-atom-controls.h"
23 SND_SOC_DAPM_MIC("Headset Mic", NULL),
33 {"PORTD", NULL, "Headset Mic"},
45 SOC_DAPM_PIN_SWITCH("Headset Mic"),
52 /* Headset jack detection DAPM pins */
55 .pin = "Headset Mic",
66 { "headset-gpios", &byt_cht_cx2072x_headset_gpios, 1 },
72 struct snd_soc_card *card = rtd->card;
73 struct snd_soc_component *codec = snd_soc_rtd_to_codec(rtd, 0)->component;
76 if (devm_acpi_dev_add_driver_gpios(codec->dev,
78 dev_warn(rtd->dev, "Unable to add GPIO mapping table\n");
80 card->dapm.idle_bias = false;
82 /* set the default PLL rate, the clock is handled by the codec driver */
86 dev_err(rtd->dev, "Could not set sysclk\n");
90 ret = snd_soc_card_jack_new_pins(card, "Headset",
98 snd_soc_component_set_jack(codec, &byt_cht_cx2072x_headset, NULL);
115 rate->min = rate->max = 48000;
116 channels->min = channels->max = 2;
118 /* set SSP2 to 24-bit */
123 * with explicit setting to I2S 2ch 24-bit. The word length is set with
131 dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret);
137 dev_err(rtd->dev, "can't set I2S config, err %d\n", ret);
146 return snd_pcm_hw_constraint_single(substream->runtime,
158 DAILINK_COMP_ARRAY(COMP_CPU("media-cpu-dai")));
161 DAILINK_COMP_ARRAY(COMP_CPU("deepbuffer-cpu-dai")));
164 DAILINK_COMP_ARRAY(COMP_CPU("ssp2-port")));
167 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-14F10720:00", "cx2072x-hifi")));
170 DAILINK_COMP_ARRAY(COMP_PLATFORM("sst-mfld-platform")));
182 .name = "Deep-Buffer Audio Port",
183 .stream_name = "Deep-Buffer Audio",
192 .name = "SSP2-Codec",
203 /* use space before codec name to simplify card ID, and simplify driver name */
204 #define SOF_CARD_NAME "bytcht cx2072x" /* card name will be 'sof-bytcht cx2072x' */
207 #define CARD_NAME "bytcht-cx2072x"
235 byt_cht_cx2072x_card.dev = &pdev->dev;
236 mach = dev_get_platdata(&pdev->dev);
238 /* fix index of codec dai */
241 !strcmp(byt_cht_cx2072x_dais[i].codecs->name,
242 "i2c-14F10720:00")) {
248 /* fixup codec name based on HID */
249 adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);
251 snprintf(codec_name, sizeof(codec_name), "i2c-%s",
253 byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
255 dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id);
256 return -ENOENT;
263 mach->mach_params.platform);
267 sof_parent = snd_soc_acpi_sof_parent(&pdev->dev);
280 pdev->dev.driver->pm = &snd_soc_pm_ops;
282 return devm_snd_soc_register_card(&pdev->dev, &byt_cht_cx2072x_card);