Lines Matching +full:modem +full:- +full:init
2 * ams-delta.c -- SoC audio for Amstrad E3 (Delta) videophone
21 * 02110-1301 USA
33 #include <asm/mach-types.h>
35 #include <linux/platform_data/asoc-ti-mcbsp.h>
37 #include "omap-mcbsp.h"
60 * Controls, functional after the modem line discipline is activated.
67 /* Selection <-> pin translation */
101 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_set_audio_mode()
102 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; in ams_delta_set_audio_mode()
107 if (!cx20442_codec->card->pop_time) in ams_delta_set_audio_mode()
108 return -EUNATCH; in ams_delta_set_audio_mode()
110 if (ucontrol->value.enumerated.item[0] >= control->items) in ams_delta_set_audio_mode()
111 return -EINVAL; in ams_delta_set_audio_mode()
116 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]]; in ams_delta_set_audio_mode()
174 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_get_audio_mode()
196 return -EINVAL; in ams_delta_get_audio_mode()
198 ucontrol->value.enumerated.item[0] = mode; in ams_delta_get_audio_mode()
222 /* After we are able to control the codec over the modem,
249 * Modem line discipline, required for making above controls functional.
253 /* To actually apply any modem controlled configuration changes to the codec,
254 * we must connect codec DAI pins to the modem for a moment. Be careful not
271 /* Reconnect the codec DAI back from the modem to the CPU DAI in cx81801_timeout()
283 return -ENODEV; in cx81801_open()
289 tty->disc_data = cx20442_codec; in cx81801_open()
294 tty->disc_data = NULL; in cx81801_open()
302 struct snd_soc_component *component = tty->disc_data; in cx81801_close()
303 struct snd_soc_dapm_context *dapm = &component->card->dapm; in cx81801_close()
340 struct snd_soc_component *component = tty->disc_data; in cx81801_receive()
347 if (!component->card->pop_time) { in cx81801_receive()
348 /* First modem response, complete setup procedure */ in cx81801_receive()
360 dev_warn(component->dev, in cx81801_receive()
369 for (c = &cp[count - 1]; c >= cp; c--) { in cx81801_receive()
372 /* Complete modem response received, apply config to codec */ in cx81801_receive()
380 /* Apply config pulse by connecting the codec to the modem in cx81801_receive()
410 * over the modem port.
416 /* Digital mute implemented using modem/CPU multiplexer.
460 struct snd_soc_dai *codec_dai = rtd->codec_dai; in ams_delta_cx20442_init()
461 struct snd_soc_card *card = rtd->card; in ams_delta_cx20442_init()
462 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_cx20442_init()
467 cx20442_codec = rtd->codec_dai->component; in ams_delta_cx20442_init()
469 /* Add hook switch - can be used to control the codec from userspace in ams_delta_cx20442_init()
474 dev_warn(card->dev, in ams_delta_cx20442_init()
478 ret = snd_soc_jack_add_gpiods(card->dev, &ams_delta_hook_switch, in ams_delta_cx20442_init()
482 dev_warn(card->dev, in ams_delta_cx20442_init()
487 gpiod_modem_codec = devm_gpiod_get(card->dev, "modem_codec", in ams_delta_cx20442_init()
490 dev_warn(card->dev, "Failed to obtain modem_codec GPIO\n"); in ams_delta_cx20442_init()
495 if (!codec_dai->driver->ops) { in ams_delta_cx20442_init()
496 codec_dai->driver->ops = &ams_delta_dai_ops; in ams_delta_cx20442_init()
502 /* Register optional line discipline for over the modem control */ in ams_delta_cx20442_init()
505 dev_warn(card->dev, in ams_delta_cx20442_init()
520 /* DAI glue - connects codec <--> CPU */
524 .cpu_dai_name = "omap-mcbsp.1",
525 .codec_dai_name = "cx20442-voice",
526 .init = ams_delta_cx20442_init,
527 .platform_name = "omap-mcbsp.1",
528 .codec_name = "cx20442-codec",
549 /* Module init/exit */
555 card->dev = &pdev->dev; in ams_delta_probe()
559 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); in ams_delta_probe()
560 card->dev = NULL; in ams_delta_probe()
571 dev_warn(&pdev->dev, in ams_delta_remove()
575 card->dev = NULL; in ams_delta_remove()
579 #define DRV_NAME "ams-delta-audio"