aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Belisko <marek@goldelico.com>2015-06-20 16:47:01 -0400
committerMark Brown <broonie@kernel.org>2015-07-06 15:29:43 -0400
commitefc4720dfbf737903ca4c1366bc45ca780d13412 (patch)
tree3fa12d54b5fb3f8ba048671db8b3e78c181f25b8
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff)
ASoC: Add gtm601 codec driver
This driver add PCM interface to a GTM601 UMTS modem chip. There is no configuration interface. Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/Kconfig4
-rw-r--r--sound/soc/codecs/Makefile2
-rw-r--r--sound/soc/codecs/gtm601.c98
3 files changed, 104 insertions, 0 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index efaafce8ba38..1b7c49214c25 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -62,6 +62,7 @@ config SND_SOC_ALL_CODECS
62 select SND_SOC_BT_SCO 62 select SND_SOC_BT_SCO
63 select SND_SOC_ES8328_SPI if SPI_MASTER 63 select SND_SOC_ES8328_SPI if SPI_MASTER
64 select SND_SOC_ES8328_I2C if I2C 64 select SND_SOC_ES8328_I2C if I2C
65 select SND_SOC_GTM601
65 select SND_SOC_ISABELLE if I2C 66 select SND_SOC_ISABELLE if I2C
66 select SND_SOC_JZ4740_CODEC 67 select SND_SOC_JZ4740_CODEC
67 select SND_SOC_LM4857 if I2C 68 select SND_SOC_LM4857 if I2C
@@ -446,6 +447,9 @@ config SND_SOC_ES8328_SPI
446 tristate 447 tristate
447 select SND_SOC_ES8328 448 select SND_SOC_ES8328
448 449
450config SND_SOC_GTM601
451 tristate 'GTM601 UMTS modem audio codec'
452
449config SND_SOC_ISABELLE 453config SND_SOC_ISABELLE
450 tristate 454 tristate
451 455
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index cf160d972cb3..365529d28465 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -55,6 +55,7 @@ snd-soc-dmic-objs := dmic.o
55snd-soc-es8328-objs := es8328.o 55snd-soc-es8328-objs := es8328.o
56snd-soc-es8328-i2c-objs := es8328-i2c.o 56snd-soc-es8328-i2c-objs := es8328-i2c.o
57snd-soc-es8328-spi-objs := es8328-spi.o 57snd-soc-es8328-spi-objs := es8328-spi.o
58snd-soc-gtm601-objs := gtm601.o
58snd-soc-isabelle-objs := isabelle.o 59snd-soc-isabelle-objs := isabelle.o
59snd-soc-jz4740-codec-objs := jz4740.o 60snd-soc-jz4740-codec-objs := jz4740.o
60snd-soc-l3-objs := l3.o 61snd-soc-l3-objs := l3.o
@@ -242,6 +243,7 @@ obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o
242obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o 243obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o
243obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o 244obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o
244obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o 245obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o
246obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o
245obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o 247obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o
246obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o 248obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o
247obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o 249obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c
new file mode 100644
index 000000000000..1b77ff2d6d14
--- /dev/null
+++ b/sound/soc/codecs/gtm601.c
@@ -0,0 +1,98 @@
1/*
2 * This is a simple driver for the GTM601 Voice PCM interface
3 *
4 * Copyright (C) 2015 Goldelico GmbH
5 *
6 * Author: Marek Belisko <marek@goldelico.com>
7 *
8 * Based on wm8727.c driver
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/slab.h>
17#include <linux/module.h>
18#include <linux/kernel.h>
19#include <linux/device.h>
20#include <sound/core.h>
21#include <sound/pcm.h>
22#include <sound/ac97_codec.h>
23#include <sound/initval.h>
24#include <sound/soc.h>
25
26static const struct snd_soc_dapm_widget gtm601_dapm_widgets[] = {
27 SND_SOC_DAPM_OUTPUT("AOUT"),
28 SND_SOC_DAPM_INPUT("AIN"),
29};
30
31static const struct snd_soc_dapm_route gtm601_dapm_routes[] = {
32 { "AOUT", NULL, "Playback" },
33 { "Capture", NULL, "AIN" },
34};
35
36struct snd_soc_dai_driver gtm601_dai = {
37 .name = "gtm601",
38 .playback = {
39 .stream_name = "Playback",
40 .channels_min = 1,
41 .channels_max = 1,
42 .rates = SNDRV_PCM_RATE_8000,
43 .formats = SNDRV_PCM_FMTBIT_S16_LE,
44 },
45 .capture = {
46 .stream_name = "Capture",
47 .channels_min = 1,
48 .channels_max = 1,
49 .rates = SNDRV_PCM_RATE_8000,
50 .formats = SNDRV_PCM_FMTBIT_S16_LE,
51 },
52};
53
54static struct snd_soc_codec_driver soc_codec_dev_gtm601 = {
55 .dapm_widgets = gtm601_dapm_widgets,
56 .num_dapm_widgets = ARRAY_SIZE(gtm601_dapm_widgets),
57 .dapm_routes = gtm601_dapm_routes,
58 .num_dapm_routes = ARRAY_SIZE(gtm601_dapm_routes),
59};
60
61static int gtm601_platform_probe(struct platform_device *pdev)
62{
63 return snd_soc_register_codec(&pdev->dev,
64 &soc_codec_dev_gtm601, &gtm601_dai, 1);
65}
66
67static int gtm601_platform_remove(struct platform_device *pdev)
68{
69 snd_soc_unregister_codec(&pdev->dev);
70 return 0;
71}
72
73MODULE_ALIAS("platform:gtm601_codec_audio");
74
75#if defined(CONFIG_OF)
76static const struct of_device_id gtm601_codec_of_match[] = {
77 { .compatible = "option,gtm601", },
78 {},
79};
80MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
81#endif
82
83static struct platform_driver gtm601_codec_driver = {
84 .driver = {
85 .name = "gtm601",
86 .owner = THIS_MODULE,
87 .of_match_table = of_match_ptr(gtm601_codec_of_match),
88 },
89
90 .probe = gtm601_platform_probe,
91 .remove = gtm601_platform_remove,
92};
93
94module_platform_driver(gtm601_codec_driver);
95
96MODULE_DESCRIPTION("ASoC gtm601 driver");
97MODULE_AUTHOR("Marek Belisko <marek@goldelico.com>");
98MODULE_LICENSE("GPL");