Lines Matching +full:ams +full:- +full:pl

1 // SPDX-License-Identifier: GPL-2.0-only
3 * ams-delta.c -- SoC audio for Amstrad E3 (Delta) videophone
5 * Copyright (C) 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
19 #include <asm/mach-types.h>
21 #include <linux/platform_data/asoc-ti-mcbsp.h>
23 #include "omap-mcbsp.h"
70 /* Selection <-> pin translation */
104 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_set_audio_mode()
105 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; in ams_delta_set_audio_mode()
110 if (!cx20442_codec->card->pop_time) in ams_delta_set_audio_mode()
111 return -EUNATCH; in ams_delta_set_audio_mode()
113 if (ucontrol->value.enumerated.item[0] >= control->items) in ams_delta_set_audio_mode()
114 return -EINVAL; in ams_delta_set_audio_mode()
119 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]]; in ams_delta_set_audio_mode()
177 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_get_audio_mode()
199 return -EINVAL; in ams_delta_get_audio_mode()
201 ucontrol->value.enumerated.item[0] = mode; in ams_delta_get_audio_mode()
286 return -ENODEV; in cx81801_open()
292 tty->disc_data = cx20442_codec; in cx81801_open()
297 tty->disc_data = NULL; in cx81801_open()
305 struct snd_soc_component *component = tty->disc_data; in cx81801_close()
318 dapm = &component->card->dapm; in cx81801_close()
344 struct snd_soc_component *component = tty->disc_data; in cx81801_receive()
351 if (!component->card->pop_time) { in cx81801_receive()
364 dev_warn(component->dev, in cx81801_receive()
373 for (c = &cp[count - 1]; c >= cp; c--) { in cx81801_receive()
450 return ams_delta_mute(NULL, 0, substream->stream); in ams_delta_startup()
455 ams_delta_mute(NULL, 1, substream->stream); in ams_delta_shutdown()
466 struct snd_soc_card *card = rtd->card; in ams_delta_cx20442_init()
467 struct snd_soc_dapm_context *dapm = &card->dapm; in ams_delta_cx20442_init()
472 cx20442_codec = asoc_rtd_to_codec(rtd, 0)->component; in ams_delta_cx20442_init()
474 /* Add hook switch - can be used to control the codec from userspace in ams_delta_cx20442_init()
479 dev_warn(card->dev, in ams_delta_cx20442_init()
483 ret = snd_soc_jack_add_gpiods(card->dev, &ams_delta_hook_switch, in ams_delta_cx20442_init()
487 dev_warn(card->dev, in ams_delta_cx20442_init()
492 gpiod_modem_codec = devm_gpiod_get(card->dev, "modem_codec", in ams_delta_cx20442_init()
495 dev_warn(card->dev, "Failed to obtain modem_codec GPIO\n"); in ams_delta_cx20442_init()
500 if (!codec_dai->driver->ops) { in ams_delta_cx20442_init()
501 codec_dai->driver->ops = &ams_delta_dai_ops; in ams_delta_cx20442_init()
510 dev_warn(card->dev, in ams_delta_cx20442_init()
525 /* DAI glue - connects codec <--> CPU */
527 DAILINK_COMP_ARRAY(COMP_CPU("omap-mcbsp.1")),
528 DAILINK_COMP_ARRAY(COMP_CODEC("cx20442-codec", "cx20442-voice")),
529 DAILINK_COMP_ARRAY(COMP_PLATFORM("omap-mcbsp.1")));
562 card->dev = &pdev->dev; in ams_delta_probe()
564 handset_mute = devm_gpiod_get(card->dev, "handset_mute", in ams_delta_probe()
569 handsfree_mute = devm_gpiod_get(card->dev, "handsfree_mute", in ams_delta_probe()
576 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); in ams_delta_probe()
577 card->dev = NULL; in ams_delta_probe()
590 card->dev = NULL; in ams_delta_remove()
593 #define DRV_NAME "ams-delta-audio"
605 MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>");