summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2019-07-25 18:02:08 -0400
committerPaul Burton <paul.burton@mips.com>2019-07-30 13:41:53 -0400
commit91c7db5e7c652108342e80cba4d924f091a92957 (patch)
tree5171016cb5b3fb164349ef80201d2b7d4b6d422b
parentfe9825146b2586f6747f1f91c5bde9ab7624dfc5 (diff)
ASoC: jz4740: Drop lb60 board code
The board now uses the simple-audio-card driver. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Tested-by: Artur Rojek <contact@artur-rojek.eu> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Paul Burton <paul.burton@mips.com>
-rw-r--r--sound/soc/jz4740/Kconfig25
-rw-r--r--sound/soc/jz4740/Makefile5
-rw-r--r--sound/soc/jz4740/qi_lb60.c106
3 files changed, 2 insertions, 134 deletions
diff --git a/sound/soc/jz4740/Kconfig b/sound/soc/jz4740/Kconfig
index 6b757168693e..e72f826062e9 100644
--- a/sound/soc/jz4740/Kconfig
+++ b/sound/soc/jz4740/Kconfig
@@ -1,30 +1,9 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2config SND_JZ4740_SOC
3 tristate "SoC Audio for Ingenic JZ4740 SoC"
4 depends on MIPS || COMPILE_TEST
5 select SND_SOC_GENERIC_DMAENGINE_PCM
6 help
7 Say Y or M if you want to add support for codecs attached to
8 the JZ4740 I2S interface. You will also need to select the audio
9 interfaces to support below.
10
11if SND_JZ4740_SOC
12
13config SND_JZ4740_SOC_I2S 2config SND_JZ4740_SOC_I2S
14 tristate "SoC Audio (I2S protocol) for Ingenic JZ4740 SoC" 3 tristate "SoC Audio (I2S protocol) for Ingenic JZ4740 SoC"
4 depends on MIPS || COMPILE_TEST
15 depends on HAS_IOMEM 5 depends on HAS_IOMEM
6 select SND_SOC_GENERIC_DMAENGINE_PCM
16 help 7 help
17 Say Y if you want to use I2S protocol and I2S codec on Ingenic JZ4740 8 Say Y if you want to use I2S protocol and I2S codec on Ingenic JZ4740
18 based boards. 9 based boards.
19
20config SND_JZ4740_SOC_QI_LB60
21 tristate "SoC Audio support for Qi LB60"
22 depends on HAS_IOMEM
23 depends on JZ4740_QI_LB60 || COMPILE_TEST
24 select SND_JZ4740_SOC_I2S
25 select SND_SOC_JZ4740_CODEC
26 help
27 Say Y if you want to add support for ASoC audio on the Qi LB60 board
28 a.k.a Qi Ben NanoNote.
29
30endif
diff --git a/sound/soc/jz4740/Makefile b/sound/soc/jz4740/Makefile
index fb10e9ad9ff7..f8701c9b09fe 100644
--- a/sound/soc/jz4740/Makefile
+++ b/sound/soc/jz4740/Makefile
@@ -5,8 +5,3 @@
5snd-soc-jz4740-i2s-objs := jz4740-i2s.o 5snd-soc-jz4740-i2s-objs := jz4740-i2s.o
6 6
7obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-soc-jz4740-i2s.o 7obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-soc-jz4740-i2s.o
8
9# Jz4740 Machine Support
10snd-soc-qi-lb60-objs := qi_lb60.o
11
12obj-$(CONFIG_SND_JZ4740_SOC_QI_LB60) += snd-soc-qi-lb60.o
diff --git a/sound/soc/jz4740/qi_lb60.c b/sound/soc/jz4740/qi_lb60.c
deleted file mode 100644
index 8ef6f41dcfbe..000000000000
--- a/sound/soc/jz4740/qi_lb60.c
+++ /dev/null
@@ -1,106 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
4 */
5
6#include <linux/module.h>
7#include <linux/moduleparam.h>
8#include <linux/timer.h>
9#include <linux/interrupt.h>
10#include <linux/platform_device.h>
11#include <sound/core.h>
12#include <sound/pcm.h>
13#include <sound/soc.h>
14#include <linux/gpio/consumer.h>
15
16struct qi_lb60 {
17 struct gpio_desc *snd_gpio;
18 struct gpio_desc *amp_gpio;
19};
20
21static int qi_lb60_spk_event(struct snd_soc_dapm_widget *widget,
22 struct snd_kcontrol *ctrl, int event)
23{
24 struct qi_lb60 *qi_lb60 = snd_soc_card_get_drvdata(widget->dapm->card);
25 int on = !SND_SOC_DAPM_EVENT_OFF(event);
26
27 gpiod_set_value_cansleep(qi_lb60->snd_gpio, on);
28 gpiod_set_value_cansleep(qi_lb60->amp_gpio, on);
29
30 return 0;
31}
32
33static const struct snd_soc_dapm_widget qi_lb60_widgets[] = {
34 SND_SOC_DAPM_SPK("Speaker", qi_lb60_spk_event),
35 SND_SOC_DAPM_MIC("Mic", NULL),
36};
37
38static const struct snd_soc_dapm_route qi_lb60_routes[] = {
39 {"Mic", NULL, "MIC"},
40 {"Speaker", NULL, "LOUT"},
41 {"Speaker", NULL, "ROUT"},
42};
43
44SND_SOC_DAILINK_DEFS(hifi,
45 DAILINK_COMP_ARRAY(COMP_CPU("jz4740-i2s")),
46 DAILINK_COMP_ARRAY(COMP_CODEC("jz4740-codec", "jz4740-hifi")),
47 DAILINK_COMP_ARRAY(COMP_PLATFORM("jz4740-i2s")));
48
49static struct snd_soc_dai_link qi_lb60_dai = {
50 .name = "jz4740",
51 .stream_name = "jz4740",
52 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
53 SND_SOC_DAIFMT_CBM_CFM,
54 SND_SOC_DAILINK_REG(hifi),
55};
56
57static struct snd_soc_card qi_lb60_card = {
58 .name = "QI LB60",
59 .owner = THIS_MODULE,
60 .dai_link = &qi_lb60_dai,
61 .num_links = 1,
62
63 .dapm_widgets = qi_lb60_widgets,
64 .num_dapm_widgets = ARRAY_SIZE(qi_lb60_widgets),
65 .dapm_routes = qi_lb60_routes,
66 .num_dapm_routes = ARRAY_SIZE(qi_lb60_routes),
67 .fully_routed = true,
68};
69
70static int qi_lb60_probe(struct platform_device *pdev)
71{
72 struct qi_lb60 *qi_lb60;
73 struct snd_soc_card *card = &qi_lb60_card;
74
75 qi_lb60 = devm_kzalloc(&pdev->dev, sizeof(*qi_lb60), GFP_KERNEL);
76 if (!qi_lb60)
77 return -ENOMEM;
78
79 qi_lb60->snd_gpio = devm_gpiod_get(&pdev->dev, "snd", GPIOD_OUT_LOW);
80 if (IS_ERR(qi_lb60->snd_gpio))
81 return PTR_ERR(qi_lb60->snd_gpio);
82
83 qi_lb60->amp_gpio = devm_gpiod_get(&pdev->dev, "amp", GPIOD_OUT_LOW);
84 if (IS_ERR(qi_lb60->amp_gpio))
85 return PTR_ERR(qi_lb60->amp_gpio);
86
87 card->dev = &pdev->dev;
88
89 snd_soc_card_set_drvdata(card, qi_lb60);
90
91 return devm_snd_soc_register_card(&pdev->dev, card);
92}
93
94static struct platform_driver qi_lb60_driver = {
95 .driver = {
96 .name = "qi-lb60-audio",
97 },
98 .probe = qi_lb60_probe,
99};
100
101module_platform_driver(qi_lb60_driver);
102
103MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
104MODULE_DESCRIPTION("ALSA SoC QI LB60 Audio support");
105MODULE_LICENSE("GPL v2");
106MODULE_ALIAS("platform:qi-lb60-audio");