Lines Matching +full:mute +full:- +full:gpios
1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright(c) 2018-19 Canonical Corporation.
27 #define KBL_RT5660_CODEC_DAI "rt5660-aif1"
64 { "lineout-mute-gpios", &lineout_mute_gpio, 1 },
65 { "lineout-det-gpios", &lineout_det_gpio, 1 },
66 { "mic-det-gpios", &mic_det_gpio, 1 },
81 .name = "lineout-det",
87 .name = "mic-det",
95 struct snd_soc_dapm_context *dapm = w->dapm; in kabylake_5660_event_lineout()
96 struct kbl_codec_private *priv = snd_soc_card_get_drvdata(dapm->card); in kabylake_5660_event_lineout()
98 gpiod_set_value_cansleep(priv->gpio_lo_mute, in kabylake_5660_event_lineout()
146 rate->min = rate->max = 48000; in kabylake_ssp0_fixup()
147 chan->min = chan->max = DUAL_CHANNEL; in kabylake_ssp0_fixup()
159 struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); in kabylake_rt5660_codec_init()
160 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; in kabylake_rt5660_codec_init()
163 ret = devm_acpi_dev_add_driver_gpios(component->dev, acpi_rt5660_gpios); in kabylake_rt5660_codec_init()
165 dev_warn(component->dev, "Failed to add driver gpios\n"); in kabylake_rt5660_codec_init()
167 /* Request rt5660 GPIO for lineout mute control, return if fails */ in kabylake_rt5660_codec_init()
168 ctx->gpio_lo_mute = gpiod_get(component->dev, "lineout-mute", in kabylake_rt5660_codec_init()
170 if (IS_ERR(ctx->gpio_lo_mute)) { in kabylake_rt5660_codec_init()
171 dev_err(component->dev, "Can't find GPIO_MUTE# gpio\n"); in kabylake_rt5660_codec_init()
172 return PTR_ERR(ctx->gpio_lo_mute); in kabylake_rt5660_codec_init()
176 ret = snd_soc_card_jack_new(rtd->card, "Lineout Jack", in kabylake_rt5660_codec_init()
180 dev_warn(component->dev, "Can't create Lineout jack\n"); in kabylake_rt5660_codec_init()
182 lineout_jack_gpio.gpiod_dev = component->dev; in kabylake_rt5660_codec_init()
186 dev_warn(component->dev, "Can't add Lineout jack gpio\n"); in kabylake_rt5660_codec_init()
190 ret = snd_soc_card_jack_new(rtd->card, "Mic Jack", in kabylake_rt5660_codec_init()
194 dev_warn(component->dev, "Can't create mic jack\n"); in kabylake_rt5660_codec_init()
196 mic_jack_gpio.gpiod_dev = component->dev; in kabylake_rt5660_codec_init()
199 dev_warn(component->dev, "Can't add mic jack gpio\n"); in kabylake_rt5660_codec_init()
202 /* Here we enable some dapms in advance to reduce the pop noise for recording via line-in */ in kabylake_rt5660_codec_init()
212 struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); in kabylake_rt5660_codec_exit()
218 if (!IS_ERR_OR_NULL(ctx->gpio_lo_mute)) in kabylake_rt5660_codec_exit()
219 gpiod_put(ctx->gpio_lo_mute); in kabylake_rt5660_codec_exit()
224 struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); in kabylake_hdmi_init()
228 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in kabylake_hdmi_init()
230 return -ENOMEM; in kabylake_hdmi_init()
232 pcm->device = device; in kabylake_hdmi_init()
233 pcm->codec_dai = dai; in kabylake_hdmi_init()
235 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in kabylake_hdmi_init()
266 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret); in kabylake_rt5660_hw_params()
275 dev_err(codec_dai->dev, "can't set codec pll: %d\n", ret); in kabylake_rt5660_hw_params()
306 struct snd_pcm_runtime *runtime = substream->runtime; in kbl_fe_startup()
315 runtime->hw.channels_max = DUAL_CHANNEL; in kbl_fe_startup()
319 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; in kbl_fe_startup()
350 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC3277:00", KBL_RT5660_CODEC_DAI)));
355 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1")));
360 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2")));
365 DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3")));
370 /* kabylake digital audio interface glue - connects rt5660 codec <--> CPU */
431 /* SSP0 - Codec */
432 .name = "SSP0-Codec",
483 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { in kabylake_card_late_probe()
484 component = pcm->codec_dai->component; in kabylake_card_late_probe()
486 "HDMI/DP, pcm=%d Jack", pcm->device); in kabylake_card_late_probe()
494 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, in kabylake_card_late_probe()
504 return -EINVAL; in kabylake_card_late_probe()
506 return hdac_hdmi_jack_port_init(component, &card->dapm); in kabylake_card_late_probe()
529 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in kabylake_audio_probe()
531 return -ENOMEM; in kabylake_audio_probe()
533 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in kabylake_audio_probe()
536 (struct snd_soc_card *)pdev->id_entry->driver_data; in kabylake_audio_probe()
538 kabylake_audio_card->dev = &pdev->dev; in kabylake_audio_probe()
540 return devm_snd_soc_register_card(&pdev->dev, kabylake_audio_card); in kabylake_audio_probe()
564 MODULE_DESCRIPTION("Audio Machine driver-RT5660 in I2S mode");