Lines Matching +full:mic +full:- +full:int
1 // SPDX-License-Identifier: GPL-2.0+
11 #include <sound/soc-dapm.h>
37 .pin = "Headset Mic",
53 static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd) in acp3x_5682_init()
55 int ret; in acp3x_5682_init()
56 struct snd_soc_card *card = rtd->card; in acp3x_5682_init()
58 struct snd_soc_component *component = codec_dai->component; in acp3x_5682_init()
60 dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name); in acp3x_5682_init()
67 dev_err(rtd->card->dev, in acp3x_5682_init()
76 dev_err(rtd->dev, "can't set rt5682 PLL: %d\n", ret); in acp3x_5682_init()
84 dev_err(rtd->dev, in acp3x_5682_init()
92 dev_err(rtd->dev, in acp3x_5682_init()
97 rt5682_dai_wclk = clk_get(component->dev, "rt5682-dai-wclk"); in acp3x_5682_init()
98 rt5682_dai_bclk = clk_get(component->dev, "rt5682-dai-bclk"); in acp3x_5682_init()
108 dev_err(card->dev, "HP jack creation failed %d\n", ret); in acp3x_5682_init()
119 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); in acp3x_5682_init()
126 static int rt5682_clk_enable(struct snd_pcm_substream *substream) in rt5682_clk_enable()
128 int ret = 0; in rt5682_clk_enable()
136 dev_err(rtd->dev, "can't enable wclk %d\n", ret); in rt5682_clk_enable()
143 static int acp3x_1015_hw_params(struct snd_pcm_substream *substream, in acp3x_1015_hw_params()
148 int srate, i, ret; in acp3x_1015_hw_params()
154 if (strcmp(codec_dai->name, "rt1015-aif")) in acp3x_1015_hw_params()
174 static const unsigned int channels[] = {
178 static const unsigned int rates[] = {
194 static int acp3x_5682_startup(struct snd_pcm_substream *substream) in acp3x_5682_startup()
196 struct snd_pcm_runtime *runtime = substream->runtime; in acp3x_5682_startup()
198 struct snd_soc_card *card = rtd->card; in acp3x_5682_startup()
201 machine->play_i2s_instance = I2S_SP_INSTANCE; in acp3x_5682_startup()
202 machine->cap_i2s_instance = I2S_SP_INSTANCE; in acp3x_5682_startup()
204 runtime->hw.channels_max = DUAL_CHANNEL; in acp3x_5682_startup()
212 static int acp3x_max_startup(struct snd_pcm_substream *substream) in acp3x_max_startup()
214 struct snd_pcm_runtime *runtime = substream->runtime; in acp3x_max_startup()
216 struct snd_soc_card *card = rtd->card; in acp3x_max_startup()
219 machine->play_i2s_instance = I2S_BT_INSTANCE; in acp3x_max_startup()
221 runtime->hw.channels_max = DUAL_CHANNEL; in acp3x_max_startup()
229 static int acp3x_ec_dmic0_startup(struct snd_pcm_substream *substream) in acp3x_ec_dmic0_startup()
232 struct snd_soc_card *card = rtd->card; in acp3x_ec_dmic0_startup()
236 machine->cap_i2s_instance = I2S_BT_INSTANCE; in acp3x_ec_dmic0_startup()
242 static int dmic_switch;
244 static int dmic_get(struct snd_kcontrol *kcontrol, in dmic_get()
247 ucontrol->value.integer.value[0] = dmic_switch; in dmic_get()
251 static int dmic_set(struct snd_kcontrol *kcontrol, in dmic_set()
255 dmic_switch = ucontrol->value.integer.value[0]; in dmic_set()
288 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));
294 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC1015:00", "rt1015-aif"),
295 COMP_CODEC("i2c-10EC1015:01", "rt1015-aif")));
304 .dlc = COMP_CODEC_CONF("i2c-10EC1015:00"),
308 .dlc = COMP_CODEC_CONF("i2c-10EC1015:01"),
315 .name = "acp3x-5682-play",
324 .name = "acp3x-max98357-play",
336 .name = "acp3x-ec-dmic0-capture",
347 "Front Mic",
348 "Rear Mic",
361 SND_SOC_DAPM_MIC("Headset Mic", NULL),
369 {"IN1P", NULL, "Headset Mic"},
371 {"Dmic Mux", "Front Mic", "DMIC"},
372 {"Dmic Mux", "Rear Mic", "DMIC"},
378 SOC_DAPM_PIN_SWITCH("Headset Mic"),
396 SND_SOC_DAPM_MIC("Headset Mic", NULL),
406 {"IN1P", NULL, "Headset Mic"},
407 {"Dmic Mux", "Front Mic", "DMIC"},
408 {"Dmic Mux", "Rear Mic", "DMIC"},
415 SOC_DAPM_PIN_SWITCH("Headset Mic"),
437 SND_SOC_DAPM_MIC("Headset Mic", NULL),
446 {"IN1P", NULL, "Headset Mic"},
447 {"Dmic Mux", "Front Mic", "DMIC"},
448 {"Dmic Mux", "Rear Mic", "DMIC"},
456 SOC_DAPM_PIN_SWITCH("Headset Mic"),
476 match = acpi_match_device(dev->driver->acpi_match_table, dev); in soc_is_rltk_max()
479 return (void *)match->driver_data; in soc_is_rltk_max()
497 static int acp3x_probe(struct platform_device *pdev) in acp3x_probe()
499 int ret; in acp3x_probe()
502 struct device *dev = &pdev->dev; in acp3x_probe()
506 return -ENODEV; in acp3x_probe()
508 machine = devm_kzalloc(&pdev->dev, sizeof(*machine), GFP_KERNEL); in acp3x_probe()
510 return -ENOMEM; in acp3x_probe()
512 card_spk_dai_link_present(card->dai_link, card->name); in acp3x_probe()
513 card->dev = &pdev->dev; in acp3x_probe()
517 dmic_sel = devm_gpiod_get(&pdev->dev, "dmic", GPIOD_OUT_LOW); in acp3x_probe()
519 dev_err(&pdev->dev, "DMIC gpio failed err=%ld\n", in acp3x_probe()
524 ret = devm_snd_soc_register_card(&pdev->dev, card); in acp3x_probe()
526 return dev_err_probe(&pdev->dev, ret, in acp3x_probe()
528 card->name); in acp3x_probe()
543 .name = "acp3x-alc5682-max98357",