#include <linux/gpio/consumer.h>
#include <linux/spinlock.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <linux/platform_data/asoc-ti-mcbsp.h>
#include "omap-mcbsp.h"
#include "../codecs/cx20442.h"
static struct gpio_desc *handset_mute;
static struct gpio_desc *handsfree_mute;
static int ams_delta_event_handset(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{ … }
static int ams_delta_event_handsfree(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{ … }
static const struct snd_soc_dapm_widget ams_delta_dapm_widgets[] = …;
static const struct snd_soc_dapm_route ams_delta_audio_map[] = …;
static const char *ams_delta_audio_mode[] = …;
#define AMS_DELTA_MOUTHPIECE …
#define AMS_DELTA_EARPIECE …
#define AMS_DELTA_MICROPHONE …
#define AMS_DELTA_SPEAKER …
#define AMS_DELTA_AGC …
#define AMS_DELTA_MIXED …
#define AMS_DELTA_HANDSET …
#define AMS_DELTA_HANDSFREE …
#define AMS_DELTA_SPEAKERPHONE …
static const unsigned short ams_delta_audio_mode_pins[] = …;
static unsigned short ams_delta_audio_agc;
static struct snd_soc_component *cx20442_codec;
static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int ams_delta_get_audio_mode(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static SOC_ENUM_SINGLE_EXT_DECL(ams_delta_audio_enum,
ams_delta_audio_mode);
static const struct snd_kcontrol_new ams_delta_audio_controls[] = …;
static struct snd_soc_jack ams_delta_hook_switch;
static struct snd_soc_jack_gpio ams_delta_hook_switch_gpios[] = …;
static struct snd_soc_jack_pin ams_delta_hook_switch_pins[] = …;
static struct timer_list cx81801_timer;
static bool cx81801_cmd_pending;
static bool ams_delta_muted;
static DEFINE_SPINLOCK(ams_delta_lock);
static struct gpio_desc *gpiod_modem_codec;
static void cx81801_timeout(struct timer_list *unused)
{ … }
static int cx81801_open(struct tty_struct *tty)
{ … }
static void cx81801_close(struct tty_struct *tty)
{ … }
static void cx81801_hangup(struct tty_struct *tty)
{ … }
static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
size_t count)
{ … }
static void cx81801_wakeup(struct tty_struct *tty)
{ … }
static struct tty_ldisc_ops cx81801_ops = …;
static struct snd_soc_ops ams_delta_ops;
static bool ams_delta_muted = …;
static int ams_delta_mute(struct snd_soc_dai *dai, int mute, int direction)
{ … }
static const struct snd_soc_dai_ops ams_delta_dai_ops = …;
static int ams_delta_startup(struct snd_pcm_substream *substream)
{ … }
static void ams_delta_shutdown(struct snd_pcm_substream *substream)
{ … }
static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
{ … }
SND_SOC_DAILINK_DEFS(…);
static struct snd_soc_dai_link ams_delta_dai_link = …;
static struct snd_soc_card ams_delta_audio_card = …;
static int ams_delta_probe(struct platform_device *pdev)
{ … }
static void ams_delta_remove(struct platform_device *pdev)
{ … }
#define DRV_NAME …
static struct platform_driver ams_delta_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;