Lines Matching +full:modem +full:- +full:init

1 // SPDX-License-Identifier: GPL-2.0+
5 #include <linux/input-event-codes.h>
100 if (!gpiod_get_value(priv->gpio_headset_detect)) { in headset_det_irq_thread()
103 gpiod_set_value(priv->gpio_earpath_sel, 0); in headset_det_irq_thread()
107 time_left_ms -= 20; in headset_det_irq_thread()
111 ret = regulator_enable(priv->reg_headset_micbias); in headset_det_irq_thread()
115 gpiod_set_value(priv->gpio_earpath_sel, 1); in headset_det_irq_thread()
117 ret = iio_read_channel_processed(priv->adc, &adc); in headset_det_irq_thread()
129 ret = regulator_disable(priv->reg_headset_micbias); in headset_det_irq_thread()
135 gpiod_set_value(priv->gpio_earpath_sel, 0); in headset_det_irq_thread()
145 if (gpiod_get_value_cansleep(priv->gpio_headset_key) && in headset_button_check()
164 struct snd_soc_card *card = w->dapm->card; in aries_spk_cfg()
169 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); in aries_spk_cfg()
170 component = asoc_rtd_to_codec(rtd, 0)->component; in aries_spk_cfg()
173 * We have an odd setup - the SPKMODE pin is pulled up so in aries_spk_cfg()
199 struct snd_soc_card *card = w->dapm->card; in aries_main_bias()
205 ret = regulator_enable(priv->reg_main_micbias); in aries_main_bias()
208 ret = regulator_disable(priv->reg_main_micbias); in aries_main_bias()
218 struct snd_soc_card *card = w->dapm->card; in aries_headset_bias()
224 ret = regulator_enable(priv->reg_headset_micbias); in aries_headset_bias()
227 ret = regulator_disable(priv->reg_headset_micbias); in aries_headset_bias()
235 SOC_DAPM_PIN_SWITCH("Modem In"),
236 SOC_DAPM_PIN_SWITCH("Modem Out"),
253 SND_SOC_DAPM_LINE("Modem In", NULL),
254 SND_SOC_DAPM_LINE("Modem Out", NULL),
351 ret = devm_extcon_register_notifier(card->dev, in aries_late_probe()
352 priv->usb_extcon, EXTCON_JACK_LINE_OUT, in aries_late_probe()
357 if (extcon_get_state(priv->usb_extcon, in aries_late_probe()
376 irq = gpiod_to_irq(priv->gpio_headset_detect); in aries_late_probe()
378 dev_err(card->dev, "Failed to map headset detect gpio to irq"); in aries_late_probe()
379 return -EINVAL; in aries_late_probe()
382 ret = devm_request_threaded_irq(card->dev, irq, NULL, in aries_late_probe()
387 dev_err(card->dev, "Failed to request headset detect irq"); in aries_late_probe()
392 headset_button_gpio[0].desc = priv->gpio_headset_key; in aries_late_probe()
417 SND_SOC_DAPM_INPUT("Modem RX"),
418 SND_SOC_DAPM_OUTPUT("Modem TX"),
422 { "Modem Capture", NULL, "Modem RX" },
423 { "Modem TX", NULL, "Modem Playback" },
427 .name = "aries-audio",
442 .stream_name = "Modem Playback",
451 .stream_name = "Modem Capture",
464 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif1")),
469 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif2")));
472 DAILINK_COMP_ARRAY(COMP_CPU("bt-sco-pcm")),
473 DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "wm8994-aif3")));
487 .init = &aries_baseband_init,
527 .compatible = "samsung,fascinate4g-wm8994",
531 .compatible = "samsung,aries-wm8994",
540 struct device_node *np = pdev->dev.of_node; in aries_audio_probe()
542 struct device *dev = &pdev->dev; in aries_audio_probe()
550 return -EINVAL; in aries_audio_probe()
552 card->dev = dev; in aries_audio_probe()
556 return -ENOMEM; in aries_audio_probe()
561 priv->variant = match->data; in aries_audio_probe()
564 if (!priv->variant->has_fm_radio) in aries_audio_probe()
565 card->num_dapm_widgets--; in aries_audio_probe()
567 priv->reg_main_micbias = devm_regulator_get(dev, "main-micbias"); in aries_audio_probe()
568 if (IS_ERR(priv->reg_main_micbias)) { in aries_audio_probe()
570 return PTR_ERR(priv->reg_main_micbias); in aries_audio_probe()
573 priv->reg_headset_micbias = devm_regulator_get(dev, "headset-micbias"); in aries_audio_probe()
574 if (IS_ERR(priv->reg_headset_micbias)) { in aries_audio_probe()
576 return PTR_ERR(priv->reg_headset_micbias); in aries_audio_probe()
579 priv->gpio_earpath_sel = devm_gpiod_get(dev, "earpath-sel", in aries_audio_probe()
581 if (IS_ERR(priv->gpio_earpath_sel)) { in aries_audio_probe()
583 return PTR_ERR(priv->gpio_earpath_sel); in aries_audio_probe()
587 priv->usb_extcon = extcon_find_edev_by_node(extcon_np); in aries_audio_probe()
588 if (IS_ERR(priv->usb_extcon)) { in aries_audio_probe()
589 if (PTR_ERR(priv->usb_extcon) != -EPROBE_DEFER) in aries_audio_probe()
591 return PTR_ERR(priv->usb_extcon); in aries_audio_probe()
595 priv->adc = devm_iio_channel_get(dev, "headset-detect"); in aries_audio_probe()
596 if (IS_ERR(priv->adc)) { in aries_audio_probe()
597 if (PTR_ERR(priv->adc) != -EPROBE_DEFER) in aries_audio_probe()
599 return PTR_ERR(priv->adc); in aries_audio_probe()
601 if (priv->adc->channel->type != IIO_VOLTAGE) in aries_audio_probe()
602 return -EINVAL; in aries_audio_probe()
604 priv->gpio_headset_key = devm_gpiod_get(dev, "headset-key", in aries_audio_probe()
606 if (IS_ERR(priv->gpio_headset_key)) { in aries_audio_probe()
608 return PTR_ERR(priv->gpio_headset_key); in aries_audio_probe()
611 priv->gpio_headset_detect = devm_gpiod_get(dev, in aries_audio_probe()
612 "headset-detect", GPIOD_IN); in aries_audio_probe()
613 if (IS_ERR(priv->gpio_headset_detect)) { in aries_audio_probe()
615 return PTR_ERR(priv->gpio_headset_detect); in aries_audio_probe()
618 /* Update card-name if provided through DT, else use default name */ in aries_audio_probe()
621 ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); in aries_audio_probe()
627 aries_dai[1].dai_fmt = priv->variant->modem_dai_fmt; in aries_audio_probe()
629 cpu = of_get_child_by_name(dev->of_node, "cpu"); in aries_audio_probe()
631 return -EINVAL; in aries_audio_probe()
633 codec = of_get_child_by_name(dev->of_node, "codec"); in aries_audio_probe()
635 return -EINVAL; in aries_audio_probe()
638 dai_link->codecs->of_node = of_parse_phandle(codec, in aries_audio_probe()
639 "sound-dai", 0); in aries_audio_probe()
640 if (!dai_link->codecs->of_node) { in aries_audio_probe()
641 ret = -EINVAL; in aries_audio_probe()
647 aries_dai[0].cpus->of_node = of_parse_phandle(cpu, in aries_audio_probe()
648 "sound-dai", 0); in aries_audio_probe()
649 if (!aries_dai[0].cpus->of_node) { in aries_audio_probe()
650 ret = -EINVAL; in aries_audio_probe()
654 aries_dai[0].platforms->of_node = aries_dai[0].cpus->of_node; in aries_audio_probe()
657 aries_dai[2].cpus->of_node = of_parse_phandle(cpu, in aries_audio_probe()
658 "sound-dai", 1); in aries_audio_probe()
659 if (!aries_dai[2].cpus->of_node) { in aries_audio_probe()
660 ret = -EINVAL; in aries_audio_probe()
684 .name = "aries-audio-wm8994",
695 MODULE_ALIAS("platform:aries-audio-wm8994");