Lines Matching +full:jack +full:- +full:det +full:- +full:rate
1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <sound/jack.h>
18 #include <sound/soc-acpi.h>
30 struct snd_soc_dapm_context *dapm = w->dapm; in bdw_rt5677_event_hp()
31 struct snd_soc_card *card = dapm->card; in bdw_rt5677_event_hp()
37 gpiod_set_value_cansleep(bdw_rt5677->gpio_hp_en, in bdw_rt5677_event_hp()
56 /* Headset jack connectors */
104 .name = "plug-det",
110 .name = "mic-present",
130 { "plug-det-gpios", &plug_det_gpio, 1 },
131 { "mic-present-gpios", &mic_present_gpio, 1 },
132 { "headphone-enable-gpios", &headphone_enable_gpio, 1 },
139 struct snd_interval *rate = hw_param_interval(params, in broadwell_ssp0_fixup() local
144 /* The ADSP will convert the FE rate to 48k, stereo */ in broadwell_ssp0_fixup()
145 rate->min = rate->max = 48000; in broadwell_ssp0_fixup()
146 chan->min = chan->max = 2; in broadwell_ssp0_fixup()
163 dev_err(rtd->dev, "can't set codec sysclk configuration\n"); in bdw_rt5677_hw_params()
180 dev_err(rtd->dev, "can't set codec sysclk configuration\n"); in bdw_rt5677_dsp_hw_params()
186 dev_err(rtd->dev, "can't set codec pll configuration\n"); in bdw_rt5677_dsp_hw_params()
213 struct snd_pcm_runtime *runtime = substream->runtime; in bdw_rt5677_fe_startup()
216 runtime->hw.channels_max = 2; in bdw_rt5677_fe_startup()
229 snd_soc_card_get_drvdata(rtd->card); in bdw_rt5677_init()
230 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; in bdw_rt5677_init()
234 ret = devm_acpi_dev_add_driver_gpios(component->dev, bdw_rt5677_gpios); in bdw_rt5677_init()
236 dev_warn(component->dev, "Failed to add driver gpios\n"); in bdw_rt5677_init()
251 bdw_rt5677->gpio_hp_en = gpiod_get(component->dev, "headphone-enable", in bdw_rt5677_init()
253 if (IS_ERR(bdw_rt5677->gpio_hp_en)) { in bdw_rt5677_init()
254 dev_err(component->dev, "Can't find HP_AMP_SHDN_L gpio\n"); in bdw_rt5677_init()
255 return PTR_ERR(bdw_rt5677->gpio_hp_en); in bdw_rt5677_init()
258 /* Create and initialize headphone jack */ in bdw_rt5677_init()
259 if (!snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack", in bdw_rt5677_init()
262 headphone_jack_gpio.gpiod_dev = component->dev; in bdw_rt5677_init()
265 dev_err(component->dev, "Can't add headphone jack gpio\n"); in bdw_rt5677_init()
267 dev_err(component->dev, "Can't create headphone jack\n"); in bdw_rt5677_init()
270 /* Create and initialize mic jack */ in bdw_rt5677_init()
271 if (!snd_soc_card_jack_new_pins(rtd->card, "Mic Jack", in bdw_rt5677_init()
274 mic_jack_gpio.gpiod_dev = component->dev; in bdw_rt5677_init()
276 dev_err(component->dev, "Can't add mic jack gpio\n"); in bdw_rt5677_init()
278 dev_err(component->dev, "Can't create mic jack\n"); in bdw_rt5677_init()
280 bdw_rt5677->component = component; in bdw_rt5677_init()
289 snd_soc_card_get_drvdata(rtd->card); in bdw_rt5677_exit()
295 if (!IS_ERR_OR_NULL(bdw_rt5677->gpio_hp_en)) in bdw_rt5677_exit()
296 gpiod_put(bdw_rt5677->gpio_hp_en); in bdw_rt5677_exit()
299 /* broadwell digital audio interface glue - connects codec <--> CPU */
307 DAILINK_COMP_ARRAY(COMP_PLATFORM("haswell-pcm-audio")));
310 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RT5677CE:00", "rt5677-aif1")));
313 DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
317 DAILINK_COMP_ARRAY(COMP_CPU("spi-RT5677AA:00")),
318 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RT5677CE:00", "rt5677-dspbuffer")),
319 DAILINK_COMP_ARRAY(COMP_PLATFORM("spi-RT5677AA:00")));
338 /* Non-DPCM links */
349 /* SSP0 - Codec */
372 if (bdw_rt5677->component) { in bdw_rt5677_suspend_pre()
373 dapm = snd_soc_component_get_dapm(bdw_rt5677->component); in bdw_rt5677_suspend_pre()
384 if (bdw_rt5677->component) { in bdw_rt5677_resume_post()
385 dapm = snd_soc_component_get_dapm(bdw_rt5677->component); in bdw_rt5677_resume_post()
392 #define SOF_CARD_NAME "bdw rt5677" /* card name will be 'sof-bdw rt5677' */
395 #define CARD_NAME "bdw-rt5677"
422 bdw_rt5677_card.dev = &pdev->dev; in bdw_rt5677_probe()
425 bdw_rt5677 = devm_kzalloc(&pdev->dev, sizeof(struct bdw_rt5677_priv), in bdw_rt5677_probe()
428 return -ENOMEM; in bdw_rt5677_probe()
431 mach = pdev->dev.platform_data; in bdw_rt5677_probe()
433 mach->mach_params.platform); in bdw_rt5677_probe()
438 if (snd_soc_acpi_sof_parent(&pdev->dev)) { in bdw_rt5677_probe()
448 return devm_snd_soc_register_card(&pdev->dev, &bdw_rt5677_card); in bdw_rt5677_probe()
454 .name = "bdw-rt5677",
465 MODULE_ALIAS("platform:bdw-rt5677");