aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/pxa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/Kconfig196
-rw-r--r--sound/soc/pxa/Makefile47
-rw-r--r--sound/soc/pxa/brownstone.c133
-rw-r--r--sound/soc/pxa/corgi.c317
-rw-r--r--sound/soc/pxa/e740_wm9705.c167
-rw-r--r--sound/soc/pxa/e750_wm9705.c150
-rw-r--r--sound/soc/pxa/e800_wm9712.c150
-rw-r--r--sound/soc/pxa/em-x270.c92
-rw-r--r--sound/soc/pxa/hx4700.c214
-rw-r--r--sound/soc/pxa/imote2.c99
-rw-r--r--sound/soc/pxa/magician.c433
-rw-r--r--sound/soc/pxa/mioa701_wm9713.c201
-rw-r--r--sound/soc/pxa/mmp-pcm.c267
-rw-r--r--sound/soc/pxa/mmp-sspa.c29
-rw-r--r--sound/soc/pxa/palm27x.c161
-rw-r--r--sound/soc/pxa/poodle.c288
-rw-r--r--sound/soc/pxa/pxa-ssp.c82
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c36
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c145
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c3
-rw-r--r--sound/soc/pxa/spitz.c74
-rw-r--r--sound/soc/pxa/tosa.c262
-rw-r--r--sound/soc/pxa/ttc-dkb.c141
-rw-r--r--sound/soc/pxa/z2.c219
-rw-r--r--sound/soc/pxa/zylonite.c266
25 files changed, 178 insertions, 3994 deletions
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 0ac85eada75c..e026f9912a6d 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
+menu "PXA"
+
config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip"
depends on ARCH_PXA || COMPILE_TEST
@@ -8,15 +10,11 @@ config SND_PXA2XX_SOC
the PXA2xx AC97, I2S or SSP interface. You will also need
to select the audio interfaces to support below.
-config SND_MMP_SOC
- bool
- select MMP_SRAM
-
-config SND_PXA2XX_AC97
- tristate
-
config SND_PXA2XX_SOC_AC97
- tristate
+ tristate "SoC AC97 support for PXA2xx"
+ depends on SND_PXA2XX_SOC
+ depends on AC97_BUS=n
+ default y
select AC97_BUS_NEW
select SND_PXA2XX_LIB
select SND_PXA2XX_LIB_AC97
@@ -36,20 +34,10 @@ config SND_MMP_SOC_SSPA
tristate "SoC Audio via MMP SSPA ports"
depends on ARCH_MMP
select SND_SOC_GENERIC_DMAENGINE_PCM
- select SND_ARM
help
Say Y if you want to add support for codecs attached to
the MMP SSPA interface.
-config SND_PXA2XX_SOC_CORGI
- tristate "SoC Audio support for Sharp Zaurus SL-C7x0"
- depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_SOC_WM8731
- help
- Say Y if you want to add support for SoC audio on Sharp
- Zaurus SL-C7x0 models (Corgi, Shepherd, Husky).
-
config SND_PXA2XX_SOC_SPITZ
tristate "SoC Audio support for Sharp Zaurus SL-Cxx00"
depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 && I2C
@@ -59,101 +47,6 @@ config SND_PXA2XX_SOC_SPITZ
Say Y if you want to add support for SoC audio on Sharp
Zaurus SL-Cxx00 models (Spitz, Borzoi and Akita).
-config SND_PXA2XX_SOC_Z2
- tristate "SoC Audio support for Zipit Z2"
- depends on SND_PXA2XX_SOC && MACH_ZIPIT2 && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_SOC_WM8750
- help
- Say Y if you want to add support for SoC audio on Zipit Z2.
-
-config SND_PXA2XX_SOC_POODLE
- tristate "SoC Audio support for Poodle"
- depends on SND_PXA2XX_SOC && MACH_POODLE && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_SOC_WM8731
- help
- Say Y if you want to add support for SoC audio on Sharp
- Zaurus SL-5600 model (Poodle).
-
-config SND_PXA2XX_SOC_TOSA
- tristate "SoC AC97 Audio support for Tosa"
- depends on SND_PXA2XX_SOC && MACH_TOSA
- depends on MFD_TC6393XB
- depends on AC97_BUS=n
- select REGMAP
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- select SND_SOC_WM9712
- help
- Say Y if you want to add support for SoC audio on Sharp
- Zaurus SL-C6000x models (Tosa).
-
-config SND_PXA2XX_SOC_E740
- tristate "SoC AC97 Audio support for e740"
- depends on SND_PXA2XX_SOC && MACH_E740
- depends on AC97_BUS=n
- select REGMAP
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_SOC_WM9705
- select SND_PXA2XX_SOC_AC97
- help
- Say Y if you want to add support for SoC audio on the
- toshiba e740 PDA
-
-config SND_PXA2XX_SOC_E750
- tristate "SoC AC97 Audio support for e750"
- depends on SND_PXA2XX_SOC && MACH_E750
- depends on AC97_BUS=n
- select REGMAP
- select SND_SOC_WM9705
- select SND_PXA2XX_SOC_AC97
- help
- Say Y if you want to add support for SoC audio on the
- toshiba e750 PDA
-
-config SND_PXA2XX_SOC_E800
- tristate "SoC AC97 Audio support for e800"
- depends on SND_PXA2XX_SOC && MACH_E800
- depends on AC97_BUS=n
- select REGMAP
- select SND_SOC_WM9712
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- help
- Say Y if you want to add support for SoC audio on the
- Toshiba e800 PDA
-
-config SND_PXA2XX_SOC_EM_X270
- tristate "SoC Audio support for CompuLab CM-X300"
- depends on SND_PXA2XX_SOC && MACH_CM_X300
- depends on AC97_BUS=n
- select REGMAP
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- select SND_SOC_WM9712
- help
- Say Y if you want to add support for SoC audio on
- CompuLab EM-x270, eXeda and CM-X300 machines.
-
-config SND_PXA2XX_SOC_PALM27X
- bool "SoC Audio support for Palm T|X, T5, E2 and LifeDrive"
- depends on SND_PXA2XX_SOC && (MACH_PALMLD || MACH_PALMTX || \
- MACH_PALMT5 || MACH_PALMTE2)
- depends on AC97_BUS=n
- select REGMAP
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- select SND_SOC_WM9712
- help
- Say Y if you want to add support for SoC audio on
- Palm T|X, T5, E2 or LifeDrive handheld computer.
-
config SND_PXA910_SOC
tristate "SoC Audio for Marvell PXA910 chip"
depends on ARCH_MMP && SND
@@ -162,79 +55,4 @@ config SND_PXA910_SOC
Say Y if you want to add support for SoC audio on the
Marvell PXA910 reference platform.
-config SND_SOC_TTC_DKB
- tristate "SoC Audio support for TTC DKB"
- depends on SND_PXA910_SOC && MACH_TTC_DKB && I2C=y
- select PXA_SSP
- select SND_PXA_SOC_SSP
- select SND_MMP_SOC
- select MFD_88PM860X
- select SND_SOC_88PM860X
- help
- Say Y if you want to add support for SoC audio on TTC DKB
-
-
-config SND_SOC_ZYLONITE
- tristate "SoC Audio support for Marvell Zylonite"
- depends on SND_PXA2XX_SOC && MACH_ZYLONITE
- depends on AC97_BUS=n
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- select REGMAP
- select SND_PXA_SOC_SSP
- select SND_SOC_WM9713
- help
- Say Y if you want to add support for SoC audio on the
- Marvell Zylonite reference platform.
-
-config SND_PXA2XX_SOC_HX4700
- tristate "SoC Audio support for HP iPAQ hx4700"
- depends on SND_PXA2XX_SOC && MACH_H4700 && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_SOC_AK4641
- help
- Say Y if you want to add support for SoC audio on the
- HP iPAQ hx4700.
-
-config SND_PXA2XX_SOC_MAGICIAN
- tristate "SoC Audio support for HTC Magician"
- depends on SND_PXA2XX_SOC && MACH_MAGICIAN && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_PXA_SOC_SSP
- select SND_SOC_UDA1380
- help
- Say Y if you want to add support for SoC audio on the
- HTC Magician.
-
-config SND_PXA2XX_SOC_MIOA701
- tristate "SoC Audio support for MIO A701"
- depends on SND_PXA2XX_SOC && MACH_MIOA701
- depends on AC97_BUS=n
- select REGMAP
- select AC97_BUS_NEW
- select AC97_BUS_COMPAT
- select SND_PXA2XX_SOC_AC97
- select SND_SOC_WM9713
- help
- Say Y if you want to add support for SoC audio on the
- MIO A701.
-
-config SND_PXA2XX_SOC_IMOTE2
- tristate "SoC Audio support for IMote 2"
- depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 && I2C
- select SND_PXA2XX_SOC_I2S
- select SND_SOC_WM8940
- help
- Say Y if you want to add support for SoC audio on the
- IMote 2.
-
-config SND_MMP_SOC_BROWNSTONE
- tristate "SoC Audio support for Marvell Brownstone"
- depends on SND_MMP_SOC_SSPA && MACH_BROWNSTONE && I2C
- select SND_MMP_SOC
- select MFD_WM8994
- select SND_SOC_WM8994
- help
- Say Y if you want to add support for SoC audio on the
- Marvell Brownstone reference platform.
+endmenu
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index ea4929d73318..93b4e57eaa5c 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -1,52 +1,17 @@
# SPDX-License-Identifier: GPL-2.0
# PXA Platform Support
-snd-soc-pxa2xx-objs := pxa2xx-pcm.o
-snd-soc-pxa2xx-ac97-objs := pxa2xx-ac97.o
-snd-soc-pxa2xx-i2s-objs := pxa2xx-i2s.o
-snd-soc-pxa-ssp-objs := pxa-ssp.o
-snd-soc-mmp-objs := mmp-pcm.o
-snd-soc-mmp-sspa-objs := mmp-sspa.o
+snd-soc-pxa2xx-y := pxa2xx-pcm.o
+snd-soc-pxa2xx-ac97-y := pxa2xx-ac97.o
+snd-soc-pxa2xx-i2s-y := pxa2xx-i2s.o
+snd-soc-pxa-ssp-y := pxa-ssp.o
+snd-soc-mmp-sspa-y := mmp-sspa.o
obj-$(CONFIG_SND_PXA2XX_SOC) += snd-soc-pxa2xx.o
obj-$(CONFIG_SND_PXA2XX_SOC_AC97) += snd-soc-pxa2xx-ac97.o
obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o
obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o
-obj-$(CONFIG_SND_MMP_SOC) += snd-soc-mmp.o
obj-$(CONFIG_SND_MMP_SOC_SSPA) += snd-soc-mmp-sspa.o
# PXA Machine Support
-snd-soc-corgi-objs := corgi.o
-snd-soc-poodle-objs := poodle.o
-snd-soc-tosa-objs := tosa.o
-snd-soc-e740-objs := e740_wm9705.o
-snd-soc-e750-objs := e750_wm9705.o
-snd-soc-e800-objs := e800_wm9712.o
-snd-soc-spitz-objs := spitz.o
-snd-soc-em-x270-objs := em-x270.o
-snd-soc-palm27x-objs := palm27x.o
-snd-soc-zylonite-objs := zylonite.o
-snd-soc-hx4700-objs := hx4700.o
-snd-soc-magician-objs := magician.o
-snd-soc-mioa701-objs := mioa701_wm9713.o
-snd-soc-z2-objs := z2.o
-snd-soc-imote2-objs := imote2.o
-snd-soc-brownstone-objs := brownstone.o
-snd-soc-ttc-dkb-objs := ttc-dkb.o
-
-obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
-obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
-obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o
-obj-$(CONFIG_SND_PXA2XX_SOC_E740) += snd-soc-e740.o
-obj-$(CONFIG_SND_PXA2XX_SOC_E750) += snd-soc-e750.o
-obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
+snd-soc-spitz-y := spitz.o
obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
-obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o
-obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o
-obj-$(CONFIG_SND_PXA2XX_SOC_HX4700) += snd-soc-hx4700.o
-obj-$(CONFIG_SND_PXA2XX_SOC_MAGICIAN) += snd-soc-magician.o
-obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o
-obj-$(CONFIG_SND_PXA2XX_SOC_Z2) += snd-soc-z2.o
-obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
-obj-$(CONFIG_SND_PXA2XX_SOC_IMOTE2) += snd-soc-imote2.o
-obj-$(CONFIG_SND_MMP_SOC_BROWNSTONE) += snd-soc-brownstone.o
-obj-$(CONFIG_SND_SOC_TTC_DKB) += snd-soc-ttc-dkb.o
diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
deleted file mode 100644
index f310a8e91bbf..000000000000
--- a/sound/soc/pxa/brownstone.c
+++ /dev/null
@@ -1,133 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * linux/sound/soc/pxa/brownstone.c
- *
- * Copyright (C) 2011 Marvell International Ltd.
- */
-
-#include <linux/module.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <sound/jack.h>
-
-#include "../codecs/wm8994.h"
-#include "mmp-sspa.h"
-
-static const struct snd_kcontrol_new brownstone_dapm_control[] = {
- SOC_DAPM_PIN_SWITCH("Ext Spk"),
-};
-
-static const struct snd_soc_dapm_widget brownstone_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Ext Spk", NULL),
- SND_SOC_DAPM_HP("Headset Stereophone", NULL),
- SND_SOC_DAPM_MIC("Headset Mic", NULL),
- SND_SOC_DAPM_MIC("Main Mic", NULL),
-};
-
-static const struct snd_soc_dapm_route brownstone_audio_map[] = {
- {"Ext Spk", NULL, "SPKOUTLP"},
- {"Ext Spk", NULL, "SPKOUTLN"},
- {"Ext Spk", NULL, "SPKOUTRP"},
- {"Ext Spk", NULL, "SPKOUTRN"},
-
- {"Headset Stereophone", NULL, "HPOUT1L"},
- {"Headset Stereophone", NULL, "HPOUT1R"},
-
- {"IN1RN", NULL, "Headset Mic"},
-
- {"DMIC1DAT", NULL, "MICBIAS1"},
- {"MICBIAS1", NULL, "Main Mic"},
-};
-
-static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- int freq_out, sspa_mclk, sysclk;
-
- if (params_rate(params) > 11025) {
- freq_out = params_rate(params) * 512;
- sysclk = params_rate(params) * 256;
- sspa_mclk = params_rate(params) * 64;
- } else {
- freq_out = params_rate(params) * 1024;
- sysclk = params_rate(params) * 512;
- sspa_mclk = params_rate(params) * 64;
- }
-
- snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
- snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
- snd_soc_dai_set_pll(cpu_dai, MMP_SSPA_CLK, 0, freq_out, sspa_mclk);
-
- /* set wm8994 sysclk */
- snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_MCLK1, sysclk, 0);
-
- return 0;
-}
-
-/* machine stream operations */
-static const struct snd_soc_ops brownstone_ops = {
- .hw_params = brownstone_wm8994_hw_params,
-};
-
-SND_SOC_DAILINK_DEFS(wm8994,
- DAILINK_COMP_ARRAY(COMP_CPU("mmp-sspa-dai.0")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8994-codec", "wm8994-aif1")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("mmp-pcm-audio")));
-
-static struct snd_soc_dai_link brownstone_wm8994_dai[] = {
-{
- .name = "WM8994",
- .stream_name = "WM8994 HiFi",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &brownstone_ops,
- SND_SOC_DAILINK_REG(wm8994),
-},
-};
-
-/* audio machine driver */
-static struct snd_soc_card brownstone = {
- .name = "brownstone",
- .owner = THIS_MODULE,
- .dai_link = brownstone_wm8994_dai,
- .num_links = ARRAY_SIZE(brownstone_wm8994_dai),
-
- .controls = brownstone_dapm_control,
- .num_controls = ARRAY_SIZE(brownstone_dapm_control),
- .dapm_widgets = brownstone_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(brownstone_dapm_widgets),
- .dapm_routes = brownstone_audio_map,
- .num_dapm_routes = ARRAY_SIZE(brownstone_audio_map),
- .fully_routed = true,
-};
-
-static int brownstone_probe(struct platform_device *pdev)
-{
- int ret;
-
- brownstone.dev = &pdev->dev;
- ret = devm_snd_soc_register_card(&pdev->dev, &brownstone);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- return ret;
-}
-
-static struct platform_driver mmp_driver = {
- .driver = {
- .name = "brownstone-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = brownstone_probe,
-};
-
-module_platform_driver(mmp_driver);
-
-MODULE_AUTHOR("Leo Yan <leoy@marvell.com>");
-MODULE_DESCRIPTION("ALSA SoC Brownstone");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:brownstone-audio");
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
deleted file mode 100644
index 8ee2dea25a8d..000000000000
--- a/sound/soc/pxa/corgi.c
+++ /dev/null
@@ -1,317 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * corgi.c -- SoC audio for Corgi
- *
- * Copyright 2005 Wolfson Microelectronics PLC.
- * Copyright 2005 Openedhand Ltd.
- *
- * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
- * Richard Purdie <richard@openedhand.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/timer.h>
-#include <linux/i2c.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <mach/corgi.h>
-#include <mach/audio.h>
-
-#include "../codecs/wm8731.h"
-#include "pxa2xx-i2s.h"
-
-#define CORGI_HP 0
-#define CORGI_MIC 1
-#define CORGI_LINE 2
-#define CORGI_HEADSET 3
-#define CORGI_HP_OFF 4
-#define CORGI_SPK_ON 0
-#define CORGI_SPK_OFF 1
-
- /* audio clock in Hz - rounded from 12.235MHz */
-#define CORGI_AUDIO_CLOCK 12288000
-
-static int corgi_jack_func;
-static int corgi_spk_func;
-
-static void corgi_ext_control(struct snd_soc_dapm_context *dapm)
-{
- snd_soc_dapm_mutex_lock(dapm);
-
- /* set up jack connection */
- switch (corgi_jack_func) {
- case CORGI_HP:
- /* set = unmute headphone */
- gpio_set_value(CORGI_GPIO_MUTE_L, 1);
- gpio_set_value(CORGI_GPIO_MUTE_R, 1);
- snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
- break;
- case CORGI_MIC:
- /* reset = mute headphone */
- gpio_set_value(CORGI_GPIO_MUTE_L, 0);
- gpio_set_value(CORGI_GPIO_MUTE_R, 0);
- snd_soc_dapm_enable_pin_unlocked(dapm, "Mic Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
- break;
- case CORGI_LINE:
- gpio_set_value(CORGI_GPIO_MUTE_L, 0);
- gpio_set_value(CORGI_GPIO_MUTE_R, 0);
- snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Jack");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Line Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
- break;
- case CORGI_HEADSET:
- gpio_set_value(CORGI_GPIO_MUTE_L, 0);
- gpio_set_value(CORGI_GPIO_MUTE_R, 1);
- snd_soc_dapm_enable_pin_unlocked(dapm, "Mic Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headset Jack");
- break;
- }
-
- if (corgi_spk_func == CORGI_SPK_ON)
- snd_soc_dapm_enable_pin_unlocked(dapm, "Ext Spk");
- else
- snd_soc_dapm_disable_pin_unlocked(dapm, "Ext Spk");
-
- /* signal a DAPM event */
- snd_soc_dapm_sync_unlocked(dapm);
-
- snd_soc_dapm_mutex_unlock(dapm);
-}
-
-static int corgi_startup(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
-
- /* check the jack status at stream startup */
- corgi_ext_control(&rtd->card->dapm);
-
- return 0;
-}
-
-/* we need to unmute the HP at shutdown as the mute burns power on corgi */
-static void corgi_shutdown(struct snd_pcm_substream *substream)
-{
- /* set = unmute headphone */
- gpio_set_value(CORGI_GPIO_MUTE_L, 1);
- gpio_set_value(CORGI_GPIO_MUTE_R, 1);
-}
-
-static int corgi_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int clk = 0;
- int ret = 0;
-
- switch (params_rate(params)) {
- case 8000:
- case 16000:
- case 48000:
- case 96000:
- clk = 12288000;
- break;
- case 11025:
- case 22050:
- case 44100:
- clk = 11289600;
- break;
- }
-
- /* set the codec system clock for DAC and ADC */
- ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- /* set the I2S system clock as input (unused) */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static const struct snd_soc_ops corgi_ops = {
- .startup = corgi_startup,
- .hw_params = corgi_hw_params,
- .shutdown = corgi_shutdown,
-};
-
-static int corgi_get_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = corgi_jack_func;
- return 0;
-}
-
-static int corgi_set_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (corgi_jack_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- corgi_jack_func = ucontrol->value.enumerated.item[0];
- corgi_ext_control(&card->dapm);
- return 1;
-}
-
-static int corgi_get_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = corgi_spk_func;
- return 0;
-}
-
-static int corgi_set_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (corgi_spk_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- corgi_spk_func = ucontrol->value.enumerated.item[0];
- corgi_ext_control(&card->dapm);
- return 1;
-}
-
-static int corgi_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-static int corgi_mic_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(CORGI_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-/* corgi machine dapm widgets */
-static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
-SND_SOC_DAPM_HP("Headphone Jack", NULL),
-SND_SOC_DAPM_MIC("Mic Jack", corgi_mic_event),
-SND_SOC_DAPM_SPK("Ext Spk", corgi_amp_event),
-SND_SOC_DAPM_LINE("Line Jack", NULL),
-SND_SOC_DAPM_HP("Headset Jack", NULL),
-};
-
-/* Corgi machine audio map (connections to the codec pins) */
-static const struct snd_soc_dapm_route corgi_audio_map[] = {
-
- /* headset Jack - in = micin, out = LHPOUT*/
- {"Headset Jack", NULL, "LHPOUT"},
-
- /* headphone connected to LHPOUT1, RHPOUT1 */
- {"Headphone Jack", NULL, "LHPOUT"},
- {"Headphone Jack", NULL, "RHPOUT"},
-
- /* speaker connected to LOUT, ROUT */
- {"Ext Spk", NULL, "ROUT"},
- {"Ext Spk", NULL, "LOUT"},
-
- /* mic is connected to MICIN (via right channel of headphone jack) */
- {"MICIN", NULL, "Mic Jack"},
-
- /* Same as the above but no mic bias for line signals */
- {"MICIN", NULL, "Line Jack"},
-};
-
-static const char * const jack_function[] = {"Headphone", "Mic", "Line",
- "Headset", "Off"};
-static const char * const spk_function[] = {"On", "Off"};
-static const struct soc_enum corgi_enum[] = {
- SOC_ENUM_SINGLE_EXT(5, jack_function),
- SOC_ENUM_SINGLE_EXT(2, spk_function),
-};
-
-static const struct snd_kcontrol_new wm8731_corgi_controls[] = {
- SOC_ENUM_EXT("Jack Function", corgi_enum[0], corgi_get_jack,
- corgi_set_jack),
- SOC_ENUM_EXT("Speaker Function", corgi_enum[1], corgi_get_spk,
- corgi_set_spk),
-};
-
-/* corgi digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(wm8731,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link corgi_dai = {
- .name = "WM8731",
- .stream_name = "WM8731",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &corgi_ops,
- SND_SOC_DAILINK_REG(wm8731),
-};
-
-/* corgi audio machine driver */
-static struct snd_soc_card corgi = {
- .name = "Corgi",
- .owner = THIS_MODULE,
- .dai_link = &corgi_dai,
- .num_links = 1,
-
- .controls = wm8731_corgi_controls,
- .num_controls = ARRAY_SIZE(wm8731_corgi_controls),
- .dapm_widgets = wm8731_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
- .dapm_routes = corgi_audio_map,
- .num_dapm_routes = ARRAY_SIZE(corgi_audio_map),
- .fully_routed = true,
-};
-
-static int corgi_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &corgi;
- int ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- return ret;
-}
-
-static struct platform_driver corgi_driver = {
- .driver = {
- .name = "corgi-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = corgi_probe,
-};
-
-module_platform_driver(corgi_driver);
-
-/* Module information */
-MODULE_AUTHOR("Richard Purdie");
-MODULE_DESCRIPTION("ALSA SoC Corgi");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:corgi-audio");
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c
deleted file mode 100644
index eafa1482afbe..000000000000
--- a/sound/soc/pxa/e740_wm9705.c
+++ /dev/null
@@ -1,167 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * e740-wm9705.c -- SoC audio for e740
- *
- * Copyright 2007 (c) Ian Molton <spyro@f2s.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <mach/audio.h>
-#include <mach/eseries-gpio.h>
-
-#include <asm/mach-types.h>
-
-#define E740_AUDIO_OUT 1
-#define E740_AUDIO_IN 2
-
-static int e740_audio_power;
-
-static void e740_sync_audio_power(int status)
-{
- gpio_set_value(GPIO_E740_WM9705_nAVDD2, !status);
- gpio_set_value(GPIO_E740_AMP_ON, (status & E740_AUDIO_OUT) ? 1 : 0);
- gpio_set_value(GPIO_E740_MIC_ON, (status & E740_AUDIO_IN) ? 1 : 0);
-}
-
-static int e740_mic_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- e740_audio_power |= E740_AUDIO_IN;
- else if (event & SND_SOC_DAPM_POST_PMD)
- e740_audio_power &= ~E740_AUDIO_IN;
-
- e740_sync_audio_power(e740_audio_power);
-
- return 0;
-}
-
-static int e740_output_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- e740_audio_power |= E740_AUDIO_OUT;
- else if (event & SND_SOC_DAPM_POST_PMD)
- e740_audio_power &= ~E740_AUDIO_OUT;
-
- e740_sync_audio_power(e740_audio_power);
-
- return 0;
-}
-
-static const struct snd_soc_dapm_widget e740_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", NULL),
- SND_SOC_DAPM_SPK("Speaker", NULL),
- SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
- SND_SOC_DAPM_PGA_E("Output Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e740_output_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
- SND_SOC_DAPM_PGA_E("Mic Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e740_mic_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
-};
-
-static const struct snd_soc_dapm_route audio_map[] = {
- {"Output Amp", NULL, "LOUT"},
- {"Output Amp", NULL, "ROUT"},
- {"Output Amp", NULL, "MONOOUT"},
-
- {"Speaker", NULL, "Output Amp"},
- {"Headphone Jack", NULL, "Output Amp"},
-
- {"MIC1", NULL, "Mic Amp"},
- {"Mic Amp", NULL, "Mic (Internal)"},
-};
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9705-codec", "wm9705-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9705-codec", "wm9705-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link e740_dai[] = {
- {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- SND_SOC_DAILINK_REG(ac97),
- },
- {
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(ac97_aux),
- },
-};
-
-static struct snd_soc_card e740 = {
- .name = "Toshiba e740",
- .owner = THIS_MODULE,
- .dai_link = e740_dai,
- .num_links = ARRAY_SIZE(e740_dai),
-
- .dapm_widgets = e740_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(e740_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
- .fully_routed = true,
-};
-
-static struct gpio e740_audio_gpios[] = {
- { GPIO_E740_MIC_ON, GPIOF_OUT_INIT_LOW, "Mic amp" },
- { GPIO_E740_AMP_ON, GPIOF_OUT_INIT_LOW, "Output amp" },
- { GPIO_E740_WM9705_nAVDD2, GPIOF_OUT_INIT_HIGH, "Audio power" },
-};
-
-static int e740_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &e740;
- int ret;
-
- ret = gpio_request_array(e740_audio_gpios,
- ARRAY_SIZE(e740_audio_gpios));
- if (ret)
- return ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios));
- }
- return ret;
-}
-
-static int e740_remove(struct platform_device *pdev)
-{
- gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios));
- return 0;
-}
-
-static struct platform_driver e740_driver = {
- .driver = {
- .name = "e740-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = e740_probe,
- .remove = e740_remove,
-};
-
-module_platform_driver(e740_driver);
-
-/* Module information */
-MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
-MODULE_DESCRIPTION("ALSA SoC driver for e740");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:e740-audio");
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c
deleted file mode 100644
index d75510d7b16b..000000000000
--- a/sound/soc/pxa/e750_wm9705.c
+++ /dev/null
@@ -1,150 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * e750-wm9705.c -- SoC audio for e750
- *
- * Copyright 2007 (c) Ian Molton <spyro@f2s.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <mach/audio.h>
-#include <mach/eseries-gpio.h>
-
-#include <asm/mach-types.h>
-
-static int e750_spk_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- gpio_set_value(GPIO_E750_SPK_AMP_OFF, 0);
- else if (event & SND_SOC_DAPM_POST_PMD)
- gpio_set_value(GPIO_E750_SPK_AMP_OFF, 1);
-
- return 0;
-}
-
-static int e750_hp_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- gpio_set_value(GPIO_E750_HP_AMP_OFF, 0);
- else if (event & SND_SOC_DAPM_POST_PMD)
- gpio_set_value(GPIO_E750_HP_AMP_OFF, 1);
-
- return 0;
-}
-
-static const struct snd_soc_dapm_widget e750_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", NULL),
- SND_SOC_DAPM_SPK("Speaker", NULL),
- SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
- SND_SOC_DAPM_PGA_E("Headphone Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e750_hp_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
- SND_SOC_DAPM_PGA_E("Speaker Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e750_spk_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
-};
-
-static const struct snd_soc_dapm_route audio_map[] = {
- {"Headphone Amp", NULL, "HPOUTL"},
- {"Headphone Amp", NULL, "HPOUTR"},
- {"Headphone Jack", NULL, "Headphone Amp"},
-
- {"Speaker Amp", NULL, "MONOOUT"},
- {"Speaker", NULL, "Speaker Amp"},
-
- {"MIC1", NULL, "Mic (Internal)"},
-};
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9705-codec", "wm9705-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9705-codec", "wm9705-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link e750_dai[] = {
- {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- SND_SOC_DAILINK_REG(ac97),
- /* use ops to check startup state */
- },
- {
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(ac97_aux),
- },
-};
-
-static struct snd_soc_card e750 = {
- .name = "Toshiba e750",
- .owner = THIS_MODULE,
- .dai_link = e750_dai,
- .num_links = ARRAY_SIZE(e750_dai),
-
- .dapm_widgets = e750_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(e750_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
- .fully_routed = true,
-};
-
-static struct gpio e750_audio_gpios[] = {
- { GPIO_E750_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Headphone amp" },
- { GPIO_E750_SPK_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Speaker amp" },
-};
-
-static int e750_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &e750;
- int ret;
-
- ret = gpio_request_array(e750_audio_gpios,
- ARRAY_SIZE(e750_audio_gpios));
- if (ret)
- return ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
- }
- return ret;
-}
-
-static int e750_remove(struct platform_device *pdev)
-{
- gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
- return 0;
-}
-
-static struct platform_driver e750_driver = {
- .driver = {
- .name = "e750-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = e750_probe,
- .remove = e750_remove,
-};
-
-module_platform_driver(e750_driver);
-
-/* Module information */
-MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
-MODULE_DESCRIPTION("ALSA SoC driver for e750");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:e750-audio");
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
deleted file mode 100644
index 56d543da938a..000000000000
--- a/sound/soc/pxa/e800_wm9712.c
+++ /dev/null
@@ -1,150 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * e800-wm9712.c -- SoC audio for e800
- *
- * Copyright 2007 (c) Ian Molton <spyro@f2s.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <mach/audio.h>
-#include <mach/eseries-gpio.h>
-
-static int e800_spk_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- gpio_set_value(GPIO_E800_SPK_AMP_ON, 1);
- else if (event & SND_SOC_DAPM_POST_PMD)
- gpio_set_value(GPIO_E800_SPK_AMP_ON, 0);
-
- return 0;
-}
-
-static int e800_hp_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- if (event & SND_SOC_DAPM_PRE_PMU)
- gpio_set_value(GPIO_E800_HP_AMP_OFF, 0);
- else if (event & SND_SOC_DAPM_POST_PMD)
- gpio_set_value(GPIO_E800_HP_AMP_OFF, 1);
-
- return 0;
-}
-
-static const struct snd_soc_dapm_widget e800_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", NULL),
- SND_SOC_DAPM_MIC("Mic (Internal1)", NULL),
- SND_SOC_DAPM_MIC("Mic (Internal2)", NULL),
- SND_SOC_DAPM_SPK("Speaker", NULL),
- SND_SOC_DAPM_PGA_E("Headphone Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e800_hp_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
- SND_SOC_DAPM_PGA_E("Speaker Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
- e800_spk_amp_event, SND_SOC_DAPM_PRE_PMU |
- SND_SOC_DAPM_POST_PMD),
-};
-
-static const struct snd_soc_dapm_route audio_map[] = {
- {"Headphone Jack", NULL, "HPOUTL"},
- {"Headphone Jack", NULL, "HPOUTR"},
- {"Headphone Jack", NULL, "Headphone Amp"},
-
- {"Speaker Amp", NULL, "MONOOUT"},
- {"Speaker", NULL, "Speaker Amp"},
-
- {"MIC1", NULL, "Mic (Internal1)"},
- {"MIC2", NULL, "Mic (Internal2)"},
-};
-
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link e800_dai[] = {
- {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- SND_SOC_DAILINK_REG(ac97),
- },
- {
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(ac97_aux),
- },
-};
-
-static struct snd_soc_card e800 = {
- .name = "Toshiba e800",
- .owner = THIS_MODULE,
- .dai_link = e800_dai,
- .num_links = ARRAY_SIZE(e800_dai),
-
- .dapm_widgets = e800_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(e800_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
-};
-
-static struct gpio e800_audio_gpios[] = {
- { GPIO_E800_SPK_AMP_ON, GPIOF_OUT_INIT_HIGH, "Headphone amp" },
- { GPIO_E800_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Speaker amp" },
-};
-
-static int e800_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &e800;
- int ret;
-
- ret = gpio_request_array(e800_audio_gpios,
- ARRAY_SIZE(e800_audio_gpios));
- if (ret)
- return ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios));
- }
- return ret;
-}
-
-static int e800_remove(struct platform_device *pdev)
-{
- gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios));
- return 0;
-}
-
-static struct platform_driver e800_driver = {
- .driver = {
- .name = "e800-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = e800_probe,
- .remove = e800_remove,
-};
-
-module_platform_driver(e800_driver);
-
-/* Module information */
-MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
-MODULE_DESCRIPTION("ALSA SoC driver for e800");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:e800-audio");
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c
deleted file mode 100644
index 9076ea7e9339..000000000000
--- a/sound/soc/pxa/em-x270.c
+++ /dev/null
@@ -1,92 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * SoC audio driver for EM-X270, eXeda and CM-X300
- *
- * Copyright 2007, 2009 CompuLab, Ltd.
- *
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Copied from tosa.c:
- * Copyright 2005 Wolfson Microelectronics PLC.
- * Copyright 2005 Openedhand Ltd.
- *
- * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
- * Richard Purdie <richard@openedhand.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/device.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <mach/audio.h>
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link em_x270_dai[] = {
- {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- SND_SOC_DAILINK_REG(ac97),
- },
- {
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(ac97_aux),
- },
-};
-
-static struct snd_soc_card em_x270 = {
- .name = "EM-X270",
- .owner = THIS_MODULE,
- .dai_link = em_x270_dai,
- .num_links = ARRAY_SIZE(em_x270_dai),
-};
-
-static struct platform_device *em_x270_snd_device;
-
-static int __init em_x270_init(void)
-{
- int ret;
-
- if (!(machine_is_em_x270() || machine_is_exeda()
- || machine_is_cm_x300()))
- return -ENODEV;
-
- em_x270_snd_device = platform_device_alloc("soc-audio", -1);
- if (!em_x270_snd_device)
- return -ENOMEM;
-
- platform_set_drvdata(em_x270_snd_device, &em_x270);
- ret = platform_device_add(em_x270_snd_device);
-
- if (ret)
- platform_device_put(em_x270_snd_device);
-
- return ret;
-}
-
-static void __exit em_x270_exit(void)
-{
- platform_device_unregister(em_x270_snd_device);
-}
-
-module_init(em_x270_init);
-module_exit(em_x270_exit);
-
-/* Module information */
-MODULE_AUTHOR("Mike Rapoport");
-MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c
deleted file mode 100644
index 7334fac758de..000000000000
--- a/sound/soc/pxa/hx4700.c
+++ /dev/null
@@ -1,214 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * SoC audio for HP iPAQ hx4700
- *
- * Copyright (c) 2009 Philipp Zabel
- */
-
-#include <linux/module.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/jack.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include <mach/hx4700.h>
-#include <asm/mach-types.h>
-#include "pxa2xx-i2s.h"
-
-static struct snd_soc_jack hs_jack;
-
-/* Headphones jack detection DAPM pin */
-static struct snd_soc_jack_pin hs_jack_pin[] = {
- {
- .pin = "Headphone Jack",
- .mask = SND_JACK_HEADPHONE,
- },
- {
- .pin = "Speaker",
- /* disable speaker when hp jack is inserted */
- .mask = SND_JACK_HEADPHONE,
- .invert = 1,
- },
-};
-
-/* Headphones jack detection GPIO */
-static struct snd_soc_jack_gpio hs_jack_gpio = {
- .gpio = GPIO75_HX4700_EARPHONE_nDET,
- .invert = true,
- .name = "hp-gpio",
- .report = SND_JACK_HEADPHONE,
- .debounce_time = 200,
-};
-
-/*
- * iPAQ hx4700 uses I2S for capture and playback.
- */
-static int hx4700_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- int ret = 0;
-
- /* set the I2S system clock as output */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
- SND_SOC_CLOCK_OUT);
- if (ret < 0)
- return ret;
-
- /* inform codec driver about clock freq *
- * (PXA I2S always uses divider 256) */
- ret = snd_soc_dai_set_sysclk(codec_dai, 0, 256 * params_rate(params),
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static const struct snd_soc_ops hx4700_ops = {
- .hw_params = hx4700_hw_params,
-};
-
-static int hx4700_spk_power(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-static int hx4700_hp_power(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(GPIO92_HX4700_HP_DRIVER, !!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-/* hx4700 machine dapm widgets */
-static const struct snd_soc_dapm_widget hx4700_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", hx4700_hp_power),
- SND_SOC_DAPM_SPK("Speaker", hx4700_spk_power),
- SND_SOC_DAPM_MIC("Built-in Microphone", NULL),
-};
-
-/* hx4700 machine audio_map */
-static const struct snd_soc_dapm_route hx4700_audio_map[] = {
-
- /* Headphone connected to LOUT, ROUT */
- {"Headphone Jack", NULL, "LOUT"},
- {"Headphone Jack", NULL, "ROUT"},
-
- /* Speaker connected to MOUT2 */
- {"Speaker", NULL, "MOUT2"},
-
- /* Microphone connected to MICIN */
- {"MICIN", NULL, "Built-in Microphone"},
- {"AIN", NULL, "MICOUT"},
-};
-
-/*
- * Logic for a ak4641 as connected on a HP iPAQ hx4700
- */
-static int hx4700_ak4641_init(struct snd_soc_pcm_runtime *rtd)
-{
- int err;
-
- /* Jack detection API stuff */
- err = snd_soc_card_jack_new(rtd->card, "Headphone Jack",
- SND_JACK_HEADPHONE, &hs_jack, hs_jack_pin,
- ARRAY_SIZE(hs_jack_pin));
- if (err)
- return err;
-
- err = snd_soc_jack_add_gpios(&hs_jack, 1, &hs_jack_gpio);
-
- return err;
-}
-
-/* hx4700 digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(ak4641,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("ak4641.0-0012", "ak4641-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link hx4700_dai = {
- .name = "ak4641",
- .stream_name = "AK4641",
- .init = hx4700_ak4641_init,
- .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &hx4700_ops,
- SND_SOC_DAILINK_REG(ak4641),
-};
-
-/* hx4700 audio machine driver */
-static struct snd_soc_card snd_soc_card_hx4700 = {
- .name = "iPAQ hx4700",
- .owner = THIS_MODULE,
- .dai_link = &hx4700_dai,
- .num_links = 1,
- .dapm_widgets = hx4700_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(hx4700_dapm_widgets),
- .dapm_routes = hx4700_audio_map,
- .num_dapm_routes = ARRAY_SIZE(hx4700_audio_map),
- .fully_routed = true,
-};
-
-static struct gpio hx4700_audio_gpios[] = {
- { GPIO107_HX4700_SPK_nSD, GPIOF_OUT_INIT_HIGH, "SPK_POWER" },
- { GPIO92_HX4700_HP_DRIVER, GPIOF_OUT_INIT_LOW, "EP_POWER" },
-};
-
-static int hx4700_audio_probe(struct platform_device *pdev)
-{
- int ret;
-
- if (!machine_is_h4700())
- return -ENODEV;
-
- ret = gpio_request_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
- if (ret)
- return ret;
-
- snd_soc_card_hx4700.dev = &pdev->dev;
- ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_hx4700);
- if (ret)
- gpio_free_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
-
- return ret;
-}
-
-static int hx4700_audio_remove(struct platform_device *pdev)
-{
- gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
- gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);
-
- gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
- return 0;
-}
-
-static struct platform_driver hx4700_audio_driver = {
- .driver = {
- .name = "hx4700-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = hx4700_audio_probe,
- .remove = hx4700_audio_remove,
-};
-
-module_platform_driver(hx4700_audio_driver);
-
-MODULE_AUTHOR("Philipp Zabel");
-MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:hx4700-audio");
diff --git a/sound/soc/pxa/imote2.c b/sound/soc/pxa/imote2.c
deleted file mode 100644
index a575676508b3..000000000000
--- a/sound/soc/pxa/imote2.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <linux/module.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-
-#include "../codecs/wm8940.h"
-#include "pxa2xx-i2s.h"
-
-static int imote2_asoc_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int clk = 0;
- int ret;
-
- switch (params_rate(params)) {
- case 8000:
- case 16000:
- case 48000:
- case 96000:
- clk = 12288000;
- break;
- case 11025:
- case 22050:
- case 44100:
- clk = 11289600;
- break;
- }
-
- ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- /* set the I2S system clock as input (unused) */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, clk,
- SND_SOC_CLOCK_OUT);
-
- return ret;
-}
-
-static const struct snd_soc_ops imote2_asoc_ops = {
- .hw_params = imote2_asoc_hw_params,
-};
-
-SND_SOC_DAILINK_DEFS(wm8940,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8940-codec.0-0034",
- "wm8940-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link imote2_dai = {
- .name = "WM8940",
- .stream_name = "WM8940",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &imote2_asoc_ops,
- SND_SOC_DAILINK_REG(wm8940),
-};
-
-static struct snd_soc_card imote2 = {
- .name = "Imote2",
- .owner = THIS_MODULE,
- .dai_link = &imote2_dai,
- .num_links = 1,
-};
-
-static int imote2_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &imote2;
- int ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- return ret;
-}
-
-static struct platform_driver imote2_driver = {
- .driver = {
- .name = "imote2-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = imote2_probe,
-};
-
-module_platform_driver(imote2_driver);
-
-MODULE_AUTHOR("Jonathan Cameron");
-MODULE_DESCRIPTION("ALSA SoC Imote 2");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:imote2-audio");
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c
deleted file mode 100644
index a5f326c97af2..000000000000
--- a/sound/soc/pxa/magician.c
+++ /dev/null
@@ -1,433 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * SoC audio for HTC Magician
- *
- * Copyright (c) 2006 Philipp Zabel <philipp.zabel@gmail.com>
- *
- * based on spitz.c,
- * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
- * Richard Purdie <richard@openedhand.com>
- */
-
-#include <linux/module.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/i2c.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-#include <sound/uda1380.h>
-
-#include <mach/magician.h>
-#include <asm/mach-types.h>
-#include "../codecs/uda1380.h"
-#include "pxa2xx-i2s.h"
-#include "pxa-ssp.h"
-
-#define MAGICIAN_MIC 0
-#define MAGICIAN_MIC_EXT 1
-
-static int magician_hp_switch;
-static int magician_spk_switch = 1;
-static int magician_in_sel = MAGICIAN_MIC;
-
-static void magician_ext_control(struct snd_soc_dapm_context *dapm)
-{
-
- snd_soc_dapm_mutex_lock(dapm);
-
- if (magician_spk_switch)
- snd_soc_dapm_enable_pin_unlocked(dapm, "Speaker");
- else
- snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
- if (magician_hp_switch)
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
- else
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
-
- switch (magician_in_sel) {
- case MAGICIAN_MIC:
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Mic");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Call Mic");
- break;
- case MAGICIAN_MIC_EXT:
- snd_soc_dapm_disable_pin_unlocked(dapm, "Call Mic");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headset Mic");
- break;
- }
-
- snd_soc_dapm_sync_unlocked(dapm);
-
- snd_soc_dapm_mutex_unlock(dapm);
-}
-
-static int magician_startup(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
-
- /* check the jack status at stream startup */
- magician_ext_control(&rtd->card->dapm);
-
- return 0;
-}
-
-/*
- * Magician uses SSP port for playback.
- */
-static int magician_playback_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int width;
- int ret = 0;
-
- /* set codec DAI configuration */
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_MSB |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
- /* set cpu DAI configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
- SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
- width = snd_pcm_format_physical_width(params_format(params));
- ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 0, 1, width);
- if (ret < 0)
- return ret;
-
- /* set audio clock as clock source */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA_SSP_CLK_AUDIO, 0,
- SND_SOC_CLOCK_OUT);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-/*
- * Magician uses I2S for capture.
- */
-static int magician_capture_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- int ret = 0;
-
- /* set codec DAI configuration */
- ret = snd_soc_dai_set_fmt(codec_dai,
- SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
- /* set cpu DAI configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai,
- SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
-
- /* set the I2S system clock as output */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
- SND_SOC_CLOCK_OUT);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static const struct snd_soc_ops magician_capture_ops = {
- .startup = magician_startup,
- .hw_params = magician_capture_hw_params,
-};
-
-static const struct snd_soc_ops magician_playback_ops = {
- .startup = magician_startup,
- .hw_params = magician_playback_hw_params,
-};
-
-static int magician_get_hp(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.integer.value[0] = magician_hp_switch;
- return 0;
-}
-
-static int magician_set_hp(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (magician_hp_switch == ucontrol->value.integer.value[0])
- return 0;
-
- magician_hp_switch = ucontrol->value.integer.value[0];
- magician_ext_control(&card->dapm);
- return 1;
-}
-
-static int magician_get_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.integer.value[0] = magician_spk_switch;
- return 0;
-}
-
-static int magician_set_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (magician_spk_switch == ucontrol->value.integer.value[0])
- return 0;
-
- magician_spk_switch = ucontrol->value.integer.value[0];
- magician_ext_control(&card->dapm);
- return 1;
-}
-
-static int magician_get_input(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = magician_in_sel;
- return 0;
-}
-
-static int magician_set_input(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- if (magician_in_sel == ucontrol->value.enumerated.item[0])
- return 0;
-
- magician_in_sel = ucontrol->value.enumerated.item[0];
-
- switch (magician_in_sel) {
- case MAGICIAN_MIC:
- gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 1);
- break;
- case MAGICIAN_MIC_EXT:
- gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 0);
- }
-
- return 1;
-}
-
-static int magician_spk_power(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-static int magician_hp_power(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(EGPIO_MAGICIAN_EP_POWER, SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-static int magician_mic_bias(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, SND_SOC_DAPM_EVENT_ON(event));
- return 0;
-}
-
-/* magician machine dapm widgets */
-static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", magician_hp_power),
- SND_SOC_DAPM_SPK("Speaker", magician_spk_power),
- SND_SOC_DAPM_MIC("Call Mic", magician_mic_bias),
- SND_SOC_DAPM_MIC("Headset Mic", magician_mic_bias),
-};
-
-/* magician machine audio_map */
-static const struct snd_soc_dapm_route audio_map[] = {
-
- /* Headphone connected to VOUTL, VOUTR */
- {"Headphone Jack", NULL, "VOUTL"},
- {"Headphone Jack", NULL, "VOUTR"},
-
- /* Speaker connected to VOUTL, VOUTR */
- {"Speaker", NULL, "VOUTL"},
- {"Speaker", NULL, "VOUTR"},
-
- /* Mics are connected to VINM */
- {"VINM", NULL, "Headset Mic"},
- {"VINM", NULL, "Call Mic"},
-};
-
-static const char * const input_select[] = {"Call Mic", "Headset Mic"};
-static const struct soc_enum magician_in_sel_enum =
- SOC_ENUM_SINGLE_EXT(2, input_select);
-
-static const struct snd_kcontrol_new uda1380_magician_controls[] = {
- SOC_SINGLE_BOOL_EXT("Headphone Switch",
- (unsigned long)&magician_hp_switch,
- magician_get_hp, magician_set_hp),
- SOC_SINGLE_BOOL_EXT("Speaker Switch",
- (unsigned long)&magician_spk_switch,
- magician_get_spk, magician_set_spk),
- SOC_ENUM_EXT("Input Select", magician_in_sel_enum,
- magician_get_input, magician_set_input),
-};
-
-/* magician digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(playback,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa-ssp-dai.0")),
- DAILINK_COMP_ARRAY(COMP_CODEC("uda1380-codec.0-0018",
- "uda1380-hifi-playback")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(capture,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("uda1380-codec.0-0018",
- "uda1380-hifi-capture")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link magician_dai[] = {
-{
- .name = "uda1380",
- .stream_name = "UDA1380 Playback",
- .ops = &magician_playback_ops,
- SND_SOC_DAILINK_REG(playback),
-},
-{
- .name = "uda1380",
- .stream_name = "UDA1380 Capture",
- .ops = &magician_capture_ops,
- SND_SOC_DAILINK_REG(capture),
-}
-};
-
-/* magician audio machine driver */
-static struct snd_soc_card snd_soc_card_magician = {
- .name = "Magician",
- .owner = THIS_MODULE,
- .dai_link = magician_dai,
- .num_links = ARRAY_SIZE(magician_dai),
-
- .controls = uda1380_magician_controls,
- .num_controls = ARRAY_SIZE(uda1380_magician_controls),
- .dapm_widgets = uda1380_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
- .fully_routed = true,
-};
-
-static struct platform_device *magician_snd_device;
-
-/*
- * FIXME: move into magician board file once merged into the pxa tree
- */
-static struct uda1380_platform_data uda1380_info = {
- .gpio_power = EGPIO_MAGICIAN_CODEC_POWER,
- .gpio_reset = EGPIO_MAGICIAN_CODEC_RESET,
- .dac_clk = UDA1380_DAC_CLK_WSPLL,
-};
-
-static struct i2c_board_info i2c_board_info[] = {
- {
- I2C_BOARD_INFO("uda1380", 0x18),
- .platform_data = &uda1380_info,
- },
-};
-
-static int __init magician_init(void)
-{
- int ret;
- struct i2c_adapter *adapter;
- struct i2c_client *client;
-
- if (!machine_is_magician())
- return -ENODEV;
-
- adapter = i2c_get_adapter(0);
- if (!adapter)
- return -ENODEV;
- client = i2c_new_client_device(adapter, i2c_board_info);
- i2c_put_adapter(adapter);
- if (IS_ERR(client))
- return PTR_ERR(client);
-
- ret = gpio_request(EGPIO_MAGICIAN_SPK_POWER, "SPK_POWER");
- if (ret)
- goto err_request_spk;
- ret = gpio_request(EGPIO_MAGICIAN_EP_POWER, "EP_POWER");
- if (ret)
- goto err_request_ep;
- ret = gpio_request(EGPIO_MAGICIAN_MIC_POWER, "MIC_POWER");
- if (ret)
- goto err_request_mic;
- ret = gpio_request(EGPIO_MAGICIAN_IN_SEL0, "IN_SEL0");
- if (ret)
- goto err_request_in_sel0;
- ret = gpio_request(EGPIO_MAGICIAN_IN_SEL1, "IN_SEL1");
- if (ret)
- goto err_request_in_sel1;
-
- gpio_set_value(EGPIO_MAGICIAN_IN_SEL0, 0);
-
- magician_snd_device = platform_device_alloc("soc-audio", -1);
- if (!magician_snd_device) {
- ret = -ENOMEM;
- goto err_pdev;
- }
-
- platform_set_drvdata(magician_snd_device, &snd_soc_card_magician);
- ret = platform_device_add(magician_snd_device);
- if (ret) {
- platform_device_put(magician_snd_device);
- goto err_pdev;
- }
-
- return 0;
-
-err_pdev:
- gpio_free(EGPIO_MAGICIAN_IN_SEL1);
-err_request_in_sel1:
- gpio_free(EGPIO_MAGICIAN_IN_SEL0);
-err_request_in_sel0:
- gpio_free(EGPIO_MAGICIAN_MIC_POWER);
-err_request_mic:
- gpio_free(EGPIO_MAGICIAN_EP_POWER);
-err_request_ep:
- gpio_free(EGPIO_MAGICIAN_SPK_POWER);
-err_request_spk:
- return ret;
-}
-
-static void __exit magician_exit(void)
-{
- platform_device_unregister(magician_snd_device);
-
- gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, 0);
- gpio_set_value(EGPIO_MAGICIAN_EP_POWER, 0);
- gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, 0);
-
- gpio_free(EGPIO_MAGICIAN_IN_SEL1);
- gpio_free(EGPIO_MAGICIAN_IN_SEL0);
- gpio_free(EGPIO_MAGICIAN_MIC_POWER);
- gpio_free(EGPIO_MAGICIAN_EP_POWER);
- gpio_free(EGPIO_MAGICIAN_SPK_POWER);
-}
-
-module_init(magician_init);
-module_exit(magician_exit);
-
-MODULE_AUTHOR("Philipp Zabel");
-MODULE_DESCRIPTION("ALSA SoC Magician");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c
deleted file mode 100644
index 763db7bbd9bb..000000000000
--- a/sound/soc/pxa/mioa701_wm9713.c
+++ /dev/null
@@ -1,201 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Handles the Mitac mioa701 SoC system
- *
- * Copyright (C) 2008 Robert Jarzmik
- *
- * This is a little schema of the sound interconnections :
- *
- * Sagem X200 Wolfson WM9713
- * +--------+ +-------------------+ Rear Speaker
- * | | | | /-+
- * | +--->----->---+MONOIN SPKL+--->----+-+ |
- * | GSM | | | | | |
- * | +--->----->---+PCBEEP SPKR+--->----+-+ |
- * | CHIP | | | \-+
- * | +---<-----<---+MONO |
- * | | | | Front Speaker
- * +--------+ | | /-+
- * | HPL+--->----+-+ |
- * | | | | |
- * | OUT3+--->----+-+ |
- * | | \-+
- * | |
- * | | Front Micro
- * | | +
- * | MIC1+-----<--+o+
- * | | +
- * +-------------------+ ---
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach-types.h>
-#include <mach/audio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <sound/initval.h>
-#include <sound/ac97_codec.h>
-
-#include "../codecs/wm9713.h"
-
-#define AC97_GPIO_PULL 0x58
-
-/* Use GPIO8 for rear speaker amplifier */
-static int rear_amp_power(struct snd_soc_component *component, int power)
-{
- unsigned short reg;
-
- if (power) {
- reg = snd_soc_component_read(component, AC97_GPIO_CFG);
- snd_soc_component_write(component, AC97_GPIO_CFG, reg | 0x0100);
- reg = snd_soc_component_read(component, AC97_GPIO_PULL);
- snd_soc_component_write(component, AC97_GPIO_PULL, reg | (1<<15));
- } else {
- reg = snd_soc_component_read(component, AC97_GPIO_CFG);
- snd_soc_component_write(component, AC97_GPIO_CFG, reg & ~0x0100);
- reg = snd_soc_component_read(component, AC97_GPIO_PULL);
- snd_soc_component_write(component, AC97_GPIO_PULL, reg & ~(1<<15));
- }
-
- return 0;
-}
-
-static int rear_amp_event(struct snd_soc_dapm_widget *widget,
- struct snd_kcontrol *kctl, int event)
-{
- struct snd_soc_card *card = widget->dapm->card;
- struct snd_soc_pcm_runtime *rtd;
- struct snd_soc_component *component;
-
- rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
- component = asoc_rtd_to_codec(rtd, 0)->component;
- return rear_amp_power(component, SND_SOC_DAPM_EVENT_ON(event));
-}
-
-/* mioa701 machine dapm widgets */
-static const struct snd_soc_dapm_widget mioa701_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Front Speaker", NULL),
- SND_SOC_DAPM_SPK("Rear Speaker", rear_amp_event),
- SND_SOC_DAPM_MIC("Headset", NULL),
- SND_SOC_DAPM_LINE("GSM Line Out", NULL),
- SND_SOC_DAPM_LINE("GSM Line In", NULL),
- SND_SOC_DAPM_MIC("Headset Mic", NULL),
- SND_SOC_DAPM_MIC("Front Mic", NULL),
-};
-
-static const struct snd_soc_dapm_route audio_map[] = {
- /* Call Mic */
- {"Mic Bias", NULL, "Front Mic"},
- {"MIC1", NULL, "Mic Bias"},
-
- /* Headset Mic */
- {"LINEL", NULL, "Headset Mic"},
- {"LINER", NULL, "Headset Mic"},
-
- /* GSM Module */
- {"MONOIN", NULL, "GSM Line Out"},
- {"PCBEEP", NULL, "GSM Line Out"},
- {"GSM Line In", NULL, "MONO"},
-
- /* headphone connected to HPL, HPR */
- {"Headset", NULL, "HPL"},
- {"Headset", NULL, "HPR"},
-
- /* front speaker connected to HPL, OUT3 */
- {"Front Speaker", NULL, "HPL"},
- {"Front Speaker", NULL, "OUT3"},
-
- /* rear speaker connected to SPKL, SPKR */
- {"Rear Speaker", NULL, "SPKL"},
- {"Rear Speaker", NULL, "SPKR"},
-};
-
-static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd)
-{
- struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
-
- /* Prepare GPIO8 for rear speaker amplifier */
- snd_soc_component_update_bits(component, AC97_GPIO_CFG, 0x100, 0x100);
-
- /* Prepare MIC input */
- snd_soc_component_update_bits(component, AC97_3D_CONTROL, 0xc000, 0xc000);
-
- return 0;
-}
-
-static struct snd_soc_ops mioa701_ops;
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link mioa701_dai[] = {
- {
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- .init = mioa701_wm9713_init,
- .ops = &mioa701_ops,
- SND_SOC_DAILINK_REG(ac97),
- },
- {
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- .ops = &mioa701_ops,
- SND_SOC_DAILINK_REG(ac97_aux),
- },
-};
-
-static struct snd_soc_card mioa701 = {
- .name = "MioA701",
- .owner = THIS_MODULE,
- .dai_link = mioa701_dai,
- .num_links = ARRAY_SIZE(mioa701_dai),
-
- .dapm_widgets = mioa701_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(mioa701_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
-};
-
-static int mioa701_wm9713_probe(struct platform_device *pdev)
-{
- int rc;
-
- if (!machine_is_mioa701())
- return -ENODEV;
-
- mioa701.dev = &pdev->dev;
- rc = devm_snd_soc_register_card(&pdev->dev, &mioa701);
- if (!rc)
- dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will "
- "lead to overheating and possible destruction of your device."
- " Do not use without a good knowledge of mio's board design!\n");
- return rc;
-}
-
-static struct platform_driver mioa701_wm9713_driver = {
- .probe = mioa701_wm9713_probe,
- .driver = {
- .name = "mioa701-wm9713",
- .pm = &snd_soc_pm_ops,
- },
-};
-
-module_platform_driver(mioa701_wm9713_driver);
-
-/* Module information */
-MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)");
-MODULE_DESCRIPTION("ALSA SoC WM9713 MIO A701");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:mioa701-wm9713");
diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c
deleted file mode 100644
index 53fc49e32fbc..000000000000
--- a/sound/soc/pxa/mmp-pcm.c
+++ /dev/null
@@ -1,267 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * linux/sound/soc/pxa/mmp-pcm.c
- *
- * Copyright (C) 2011 Marvell International Ltd.
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/dma-mapping.h>
-#include <linux/dmaengine.h>
-#include <linux/platform_data/dma-mmp_tdma.h>
-#include <linux/platform_data/mmp_audio.h>
-
-#include <sound/pxa2xx-lib.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-#include <sound/dmaengine_pcm.h>
-
-#define DRV_NAME "mmp-pcm"
-
-struct mmp_dma_data {
- int ssp_id;
- struct resource *dma_res;
-};
-
-#define MMP_PCM_INFO (SNDRV_PCM_INFO_MMAP | \
- SNDRV_PCM_INFO_MMAP_VALID | \
- SNDRV_PCM_INFO_INTERLEAVED | \
- SNDRV_PCM_INFO_PAUSE | \
- SNDRV_PCM_INFO_RESUME | \
- SNDRV_PCM_INFO_NO_PERIOD_WAKEUP)
-
-static struct snd_pcm_hardware mmp_pcm_hardware[] = {
- {
- .info = MMP_PCM_INFO,
- .period_bytes_min = 1024,
- .period_bytes_max = 2048,
- .periods_min = 2,
- .periods_max = 32,
- .buffer_bytes_max = 4096,
- .fifo_size = 32,
- },
- {
- .info = MMP_PCM_INFO,
- .period_bytes_min = 1024,
- .period_bytes_max = 2048,
- .periods_min = 2,
- .periods_max = 32,
- .buffer_bytes_max = 4096,
- .fifo_size = 32,
- },
-};
-
-static int mmp_pcm_hw_params(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
- struct dma_slave_config slave_config;
- int ret;
-
- ret =
- snd_dmaengine_pcm_prepare_slave_config(substream, params,
- &slave_config);
- if (ret)
- return ret;
-
- ret = dmaengine_slave_config(chan, &slave_config);
- if (ret)
- return ret;
-
- snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
-
- return 0;
-}
-
-static int mmp_pcm_trigger(struct snd_soc_component *component,
- struct snd_pcm_substream *substream, int cmd)
-{
- return snd_dmaengine_pcm_trigger(substream, cmd);
-}
-
-static snd_pcm_uframes_t mmp_pcm_pointer(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- return snd_dmaengine_pcm_pointer(substream);
-}
-
-static bool filter(struct dma_chan *chan, void *param)
-{
- struct mmp_dma_data *dma_data = param;
- bool found = false;
- char *devname;
-
- devname = kasprintf(GFP_KERNEL, "%s.%d", dma_data->dma_res->name,
- dma_data->ssp_id);
- if ((strcmp(dev_name(chan->device->dev), devname) == 0) &&
- (chan->chan_id == dma_data->dma_res->start)) {
- found = true;
- }
-
- kfree(devname);
- return found;
-}
-
-static int mmp_pcm_open(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct platform_device *pdev = to_platform_device(component->dev);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- struct mmp_dma_data dma_data;
- struct resource *r;
-
- r = platform_get_resource(pdev, IORESOURCE_DMA, substream->stream);
- if (!r)
- return -EBUSY;
-
- snd_soc_set_runtime_hwparams(substream,
- &mmp_pcm_hardware[substream->stream]);
-
- dma_data.dma_res = r;
- dma_data.ssp_id = cpu_dai->id;
-
- return snd_dmaengine_pcm_open_request_chan(substream, filter,
- &dma_data);
-}
-
-static int mmp_pcm_close(struct snd_soc_component *component,
- struct snd_pcm_substream *substream)
-{
- return snd_dmaengine_pcm_close_release_chan(substream);
-}
-
-static int mmp_pcm_mmap(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- struct vm_area_struct *vma)
-{
- struct snd_pcm_runtime *runtime = substream->runtime;
- unsigned long off = vma->vm_pgoff;
-
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- return remap_pfn_range(vma, vma->vm_start,
- __phys_to_pfn(runtime->dma_addr) + off,
- vma->vm_end - vma->vm_start, vma->vm_page_prot);
-}
-
-static void mmp_pcm_free_dma_buffers(struct snd_soc_component *component,
- struct snd_pcm *pcm)
-{
- struct snd_pcm_substream *substream;
- struct snd_dma_buffer *buf;
- int stream;
- struct gen_pool *gpool;
-
- gpool = sram_get_gpool("asram");
- if (!gpool)
- return;
-
- for (stream = 0; stream < 2; stream++) {
- size_t size = mmp_pcm_hardware[stream].buffer_bytes_max;
-
- substream = pcm->streams[stream].substream;
- if (!substream)
- continue;
-
- buf = &substream->dma_buffer;
- if (!buf->area)
- continue;
- gen_pool_free(gpool, (unsigned long)buf->area, size);
- buf->area = NULL;
- }
-
-}
-
-static int mmp_pcm_preallocate_dma_buffer(struct snd_pcm_substream *substream,
- int stream)
-{
- struct snd_dma_buffer *buf = &substream->dma_buffer;
- size_t size = mmp_pcm_hardware[stream].buffer_bytes_max;
- struct gen_pool *gpool;
-
- buf->dev.type = SNDRV_DMA_TYPE_DEV;
- buf->dev.dev = substream->pcm->card->dev;
- buf->private_data = NULL;
-
- gpool = sram_get_gpool("asram");
- if (!gpool)
- return -ENOMEM;
-
- buf->area = gen_pool_dma_alloc(gpool, size, &buf->addr);
- if (!buf->area)
- return -ENOMEM;
- buf->bytes = size;
- return 0;
-}
-
-static int mmp_pcm_new(struct snd_soc_component *component,
- struct snd_soc_pcm_runtime *rtd)
-{
- struct snd_pcm_substream *substream;
- struct snd_pcm *pcm = rtd->pcm;
- int ret = 0, stream;
-
- for (stream = 0; stream < 2; stream++) {
- substream = pcm->streams[stream].substream;
-
- ret = mmp_pcm_preallocate_dma_buffer(substream, stream);
- if (ret)
- goto err;
- }
-
- return 0;
-
-err:
- mmp_pcm_free_dma_buffers(component, pcm);
- return ret;
-}
-
-static const struct snd_soc_component_driver mmp_soc_component = {
- .name = DRV_NAME,
- .open = mmp_pcm_open,
- .close = mmp_pcm_close,
- .hw_params = mmp_pcm_hw_params,
- .trigger = mmp_pcm_trigger,
- .pointer = mmp_pcm_pointer,
- .mmap = mmp_pcm_mmap,
- .pcm_construct = mmp_pcm_new,
- .pcm_destruct = mmp_pcm_free_dma_buffers,
-};
-
-static int mmp_pcm_probe(struct platform_device *pdev)
-{
- struct mmp_audio_platdata *pdata = pdev->dev.platform_data;
-
- if (pdata) {
- mmp_pcm_hardware[SNDRV_PCM_STREAM_PLAYBACK].buffer_bytes_max =
- pdata->buffer_max_playback;
- mmp_pcm_hardware[SNDRV_PCM_STREAM_PLAYBACK].period_bytes_max =
- pdata->period_max_playback;
- mmp_pcm_hardware[SNDRV_PCM_STREAM_CAPTURE].buffer_bytes_max =
- pdata->buffer_max_capture;
- mmp_pcm_hardware[SNDRV_PCM_STREAM_CAPTURE].period_bytes_max =
- pdata->period_max_capture;
- }
- return devm_snd_soc_register_component(&pdev->dev, &mmp_soc_component,
- NULL, 0);
-}
-
-static struct platform_driver mmp_pcm_driver = {
- .driver = {
- .name = "mmp-pcm-audio",
- },
-
- .probe = mmp_pcm_probe,
-};
-
-module_platform_driver(mmp_pcm_driver);
-
-MODULE_AUTHOR("Leo Yan <leoy@marvell.com>");
-MODULE_DESCRIPTION("MMP Soc Audio DMA module");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:mmp-pcm-audio");
diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index 4255851c71c1..73f36c9dd35c 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -171,11 +171,11 @@ static int mmp_sspa_set_dai_fmt(struct snd_soc_dai *cpu_dai,
sspa->sp = SSPA_SP_WEN | SSPA_SP_S_RST | SSPA_SP_FFLUSH;
sspa->ctrl = 0;
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBS_CFS:
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BP_FP:
sspa->sp |= SSPA_SP_MSL;
break;
- case SND_SOC_DAIFMT_CBM_CFM:
+ case SND_SOC_DAIFMT_BC_FC:
break;
default:
return -EINVAL;
@@ -239,12 +239,16 @@ static int mmp_sspa_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
+ sspa_ctrl &= ~SSPA_CTL_XPH;
if (dev->of_node || params_channels(params) == 2)
sspa_ctrl |= SSPA_CTL_XPH;
sspa_ctrl &= ~SSPA_CTL_XWDLEN1_MASK;
sspa_ctrl |= SSPA_CTL_XWDLEN1(bitval);
+ sspa_ctrl &= ~SSPA_CTL_XWDLEN2_MASK;
+ sspa_ctrl |= SSPA_CTL_XWDLEN2(bitval);
+
sspa_ctrl &= ~SSPA_CTL_XSSZ1_MASK;
sspa_ctrl |= SSPA_CTL_XSSZ1(bitval);
@@ -326,7 +330,6 @@ static int mmp_sspa_probe(struct snd_soc_dai *dai)
&sspa->playback_dma_data,
&sspa->capture_dma_data);
- snd_soc_dai_set_drvdata(dai, sspa);
return 0;
}
@@ -337,6 +340,7 @@ static int mmp_sspa_probe(struct snd_soc_dai *dai)
SNDRV_PCM_FMTBIT_S32_LE)
static const struct snd_soc_dai_ops mmp_sspa_dai_ops = {
+ .probe = mmp_sspa_probe,
.startup = mmp_sspa_startup,
.shutdown = mmp_sspa_shutdown,
.trigger = mmp_sspa_trigger,
@@ -347,7 +351,6 @@ static const struct snd_soc_dai_ops mmp_sspa_dai_ops = {
};
static struct snd_soc_dai_driver mmp_sspa_dai = {
- .probe = mmp_sspa_probe,
.playback = {
.channels_min = 1,
.channels_max = 128,
@@ -401,7 +404,7 @@ static int mmp_pcm_mmap(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
- vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+ vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
return remap_pfn_range(vma, vma->vm_start,
substream->dma_buffer.addr >> PAGE_SHIFT,
@@ -453,10 +456,11 @@ static int mmp_sspa_close(struct snd_soc_component *component,
}
static const struct snd_soc_component_driver mmp_sspa_component = {
- .name = "mmp-sspa",
- .mmap = mmp_pcm_mmap,
- .open = mmp_sspa_open,
- .close = mmp_sspa_close,
+ .name = "mmp-sspa",
+ .mmap = mmp_pcm_mmap,
+ .open = mmp_sspa_open,
+ .close = mmp_sspa_close,
+ .legacy_dai_naming = 1,
};
static int asoc_mmp_sspa_probe(struct platform_device *pdev)
@@ -541,7 +545,7 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
return 0;
}
-static int asoc_mmp_sspa_remove(struct platform_device *pdev)
+static void asoc_mmp_sspa_remove(struct platform_device *pdev)
{
struct sspa_priv *sspa = platform_get_drvdata(pdev);
@@ -549,11 +553,10 @@ static int asoc_mmp_sspa_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
if (pdev->dev.of_node)
- return 0;
+ return;
clk_put(sspa->audio_clk);
clk_put(sspa->sysclk);
- return 0;
}
#ifdef CONFIG_OF
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
deleted file mode 100644
index b92ea1a0453f..000000000000
--- a/sound/soc/pxa/palm27x.c
+++ /dev/null
@@ -1,161 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/sound/soc/pxa/palm27x.c
- *
- * SoC Audio driver for Palm T|X, T5 and LifeDrive
- *
- * based on tosa.c
- *
- * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/device.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <sound/jack.h>
-
-#include <asm/mach-types.h>
-#include <mach/audio.h>
-#include <linux/platform_data/asoc-palm27x.h>
-
-static struct snd_soc_jack hs_jack;
-
-/* Headphones jack detection DAPM pins */
-static struct snd_soc_jack_pin hs_jack_pins[] = {
- {
- .pin = "Headphone Jack",
- .mask = SND_JACK_HEADPHONE,
- },
-};
-
-/* Headphones jack detection gpios */
-static struct snd_soc_jack_gpio hs_jack_gpios[] = {
- [0] = {
- /* gpio is set on per-platform basis */
- .name = "hp-gpio",
- .report = SND_JACK_HEADPHONE,
- .debounce_time = 200,
- },
-};
-
-/* Palm27x machine dapm widgets */
-static const struct snd_soc_dapm_widget palm27x_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", NULL),
- SND_SOC_DAPM_SPK("Ext. Speaker", NULL),
- SND_SOC_DAPM_MIC("Ext. Microphone", NULL),
-};
-
-/* PalmTX audio map */
-static const struct snd_soc_dapm_route audio_map[] = {
- /* headphone connected to HPOUTL, HPOUTR */
- {"Headphone Jack", NULL, "HPOUTL"},
- {"Headphone Jack", NULL, "HPOUTR"},
-
- /* ext speaker connected to ROUT2, LOUT2 */
- {"Ext. Speaker", NULL, "LOUT2"},
- {"Ext. Speaker", NULL, "ROUT2"},
-
- /* mic connected to MIC1 */
- {"MIC1", NULL, "Ext. Microphone"},
-};
-
-static struct snd_soc_card palm27x_asoc;
-
-static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd)
-{
- int err;
-
- /* Jack detection API stuff */
- err = snd_soc_card_jack_new(rtd->card, "Headphone Jack",
- SND_JACK_HEADPHONE, &hs_jack, hs_jack_pins,
- ARRAY_SIZE(hs_jack_pins));
- if (err)
- return err;
-
- err = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
- hs_jack_gpios);
-
- return err;
-}
-
-SND_SOC_DAILINK_DEFS(hifi,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link palm27x_dai[] = {
-{
- .name = "AC97 HiFi",
- .stream_name = "AC97 HiFi",
- .init = palm27x_ac97_init,
- SND_SOC_DAILINK_REG(hifi),
-},
-{
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(aux),
-},
-};
-
-static struct snd_soc_card palm27x_asoc = {
- .name = "Palm/PXA27x",
- .owner = THIS_MODULE,
- .dai_link = palm27x_dai,
- .num_links = ARRAY_SIZE(palm27x_dai),
- .dapm_widgets = palm27x_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(palm27x_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
- .fully_routed = true,
-};
-
-static int palm27x_asoc_probe(struct platform_device *pdev)
-{
- int ret;
-
- if (!(machine_is_palmtx() || machine_is_palmt5() ||
- machine_is_palmld() || machine_is_palmte2()))
- return -ENODEV;
-
- if (!pdev->dev.platform_data) {
- dev_err(&pdev->dev, "please supply platform_data\n");
- return -ENODEV;
- }
-
- hs_jack_gpios[0].gpio = ((struct palm27x_asoc_info *)
- (pdev->dev.platform_data))->jack_gpio;
-
- palm27x_asoc.dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, &palm27x_asoc);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- return ret;
-}
-
-static struct platform_driver palm27x_wm9712_driver = {
- .probe = palm27x_asoc_probe,
- .driver = {
- .name = "palm27x-asoc",
- .pm = &snd_soc_pm_ops,
- },
-};
-
-module_platform_driver(palm27x_wm9712_driver);
-
-/* Module information */
-MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
-MODULE_DESCRIPTION("ALSA SoC Palm T|X, T5 and LifeDrive");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:palm27x-asoc");
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
deleted file mode 100644
index 323ba3e23039..000000000000
--- a/sound/soc/pxa/poodle.c
+++ /dev/null
@@ -1,288 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * poodle.c -- SoC audio for Poodle
- *
- * Copyright 2005 Wolfson Microelectronics PLC.
- * Copyright 2005 Openedhand Ltd.
- *
- * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
- * Richard Purdie <richard@openedhand.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/timer.h>
-#include <linux/i2c.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <asm/hardware/locomo.h>
-#include <mach/poodle.h>
-#include <mach/audio.h>
-
-#include "../codecs/wm8731.h"
-#include "pxa2xx-i2s.h"
-
-#define POODLE_HP 1
-#define POODLE_HP_OFF 0
-#define POODLE_SPK_ON 1
-#define POODLE_SPK_OFF 0
-
- /* audio clock in Hz - rounded from 12.235MHz */
-#define POODLE_AUDIO_CLOCK 12288000
-
-static int poodle_jack_func;
-static int poodle_spk_func;
-
-static void poodle_ext_control(struct snd_soc_dapm_context *dapm)
-{
- /* set up jack connection */
- if (poodle_jack_func == POODLE_HP) {
- /* set = unmute headphone */
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_L, 1);
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_R, 1);
- snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
- } else {
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_L, 0);
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_R, 0);
- snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
- }
-
- /* set the endpoints to their new connection states */
- if (poodle_spk_func == POODLE_SPK_ON)
- snd_soc_dapm_enable_pin(dapm, "Ext Spk");
- else
- snd_soc_dapm_disable_pin(dapm, "Ext Spk");
-
- /* signal a DAPM event */
- snd_soc_dapm_sync(dapm);
-}
-
-static int poodle_startup(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
-
- /* check the jack status at stream startup */
- poodle_ext_control(&rtd->card->dapm);
-
- return 0;
-}
-
-/* we need to unmute the HP at shutdown as the mute burns power on poodle */
-static void poodle_shutdown(struct snd_pcm_substream *substream)
-{
- /* set = unmute headphone */
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_L, 1);
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_R, 1);
-}
-
-static int poodle_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int clk = 0;
- int ret = 0;
-
- switch (params_rate(params)) {
- case 8000:
- case 16000:
- case 48000:
- case 96000:
- clk = 12288000;
- break;
- case 11025:
- case 22050:
- case 44100:
- clk = 11289600;
- break;
- }
-
- /* set the codec system clock for DAC and ADC */
- ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- /* set the I2S system clock as input (unused) */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static const struct snd_soc_ops poodle_ops = {
- .startup = poodle_startup,
- .hw_params = poodle_hw_params,
- .shutdown = poodle_shutdown,
-};
-
-static int poodle_get_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = poodle_jack_func;
- return 0;
-}
-
-static int poodle_set_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (poodle_jack_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- poodle_jack_func = ucontrol->value.enumerated.item[0];
- poodle_ext_control(&card->dapm);
- return 1;
-}
-
-static int poodle_get_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = poodle_spk_func;
- return 0;
-}
-
-static int poodle_set_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (poodle_spk_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- poodle_spk_func = ucontrol->value.enumerated.item[0];
- poodle_ext_control(&card->dapm);
- return 1;
-}
-
-static int poodle_amp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- if (SND_SOC_DAPM_EVENT_ON(event))
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_AMP_ON, 0);
- else
- locomo_gpio_write(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_AMP_ON, 1);
-
- return 0;
-}
-
-/* poodle machine dapm widgets */
-static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
-SND_SOC_DAPM_HP("Headphone Jack", NULL),
-SND_SOC_DAPM_SPK("Ext Spk", poodle_amp_event),
-SND_SOC_DAPM_MIC("Microphone", NULL),
-};
-
-/* Corgi machine connections to the codec pins */
-static const struct snd_soc_dapm_route poodle_audio_map[] = {
-
- /* headphone connected to LHPOUT1, RHPOUT1 */
- {"Headphone Jack", NULL, "LHPOUT"},
- {"Headphone Jack", NULL, "RHPOUT"},
-
- /* speaker connected to LOUT, ROUT */
- {"Ext Spk", NULL, "ROUT"},
- {"Ext Spk", NULL, "LOUT"},
-
- {"MICIN", NULL, "Microphone"},
-};
-
-static const char * const jack_function[] = {"Off", "Headphone"};
-static const char * const spk_function[] = {"Off", "On"};
-static const struct soc_enum poodle_enum[] = {
- SOC_ENUM_SINGLE_EXT(2, jack_function),
- SOC_ENUM_SINGLE_EXT(2, spk_function),
-};
-
-static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
- SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack,
- poodle_set_jack),
- SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk,
- poodle_set_spk),
-};
-
-/* poodle digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(wm8731,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link poodle_dai = {
- .name = "WM8731",
- .stream_name = "WM8731",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &poodle_ops,
- SND_SOC_DAILINK_REG(wm8731),
-};
-
-/* poodle audio machine driver */
-static struct snd_soc_card poodle = {
- .name = "Poodle",
- .dai_link = &poodle_dai,
- .num_links = 1,
- .owner = THIS_MODULE,
-
- .controls = wm8731_poodle_controls,
- .num_controls = ARRAY_SIZE(wm8731_poodle_controls),
- .dapm_widgets = wm8731_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
- .dapm_routes = poodle_audio_map,
- .num_dapm_routes = ARRAY_SIZE(poodle_audio_map),
- .fully_routed = true,
-};
-
-static int poodle_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &poodle;
- int ret;
-
- locomo_gpio_set_dir(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_AMP_ON, 0);
- /* should we mute HP at startup - burning power ?*/
- locomo_gpio_set_dir(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_L, 0);
- locomo_gpio_set_dir(&poodle_locomo_device.dev,
- POODLE_LOCOMO_GPIO_MUTE_R, 0);
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- return ret;
-}
-
-static struct platform_driver poodle_driver = {
- .driver = {
- .name = "poodle-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = poodle_probe,
-};
-
-module_platform_driver(poodle_driver);
-
-/* Module information */
-MODULE_AUTHOR("Richard Purdie");
-MODULE_DESCRIPTION("ALSA SoC Poodle");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:poodle-audio");
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index c4e7307a4437..b8a3cb8b7597 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -61,22 +61,6 @@ static void dump_registers(struct ssp_device *ssp)
pxa_ssp_read_reg(ssp, SSACD));
}
-static void pxa_ssp_enable(struct ssp_device *ssp)
-{
- uint32_t sscr0;
-
- sscr0 = __raw_readl(ssp->mmio_base + SSCR0) | SSCR0_SSE;
- __raw_writel(sscr0, ssp->mmio_base + SSCR0);
-}
-
-static void pxa_ssp_disable(struct ssp_device *ssp)
-{
- uint32_t sscr0;
-
- sscr0 = __raw_readl(ssp->mmio_base + SSCR0) & ~SSCR0_SSE;
- __raw_writel(sscr0, ssp->mmio_base + SSCR0);
-}
-
static void pxa_ssp_set_dma_params(struct ssp_device *ssp, int width4,
int out, struct snd_dmaengine_dai_dma_data *dma)
{
@@ -99,8 +83,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
pxa_ssp_disable(ssp);
}
- if (priv->extclk)
- clk_prepare_enable(priv->extclk);
+ clk_prepare_enable(priv->extclk);
dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL);
if (!dma)
@@ -124,8 +107,7 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
clk_disable_unprepare(ssp->clk);
}
- if (priv->extclk)
- clk_disable_unprepare(priv->extclk);
+ clk_disable_unprepare(priv->extclk);
kfree(snd_soc_dai_get_dma_data(cpu_dai, substream));
snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
@@ -390,10 +372,10 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
{
struct ssp_priv *priv = snd_soc_dai_get_drvdata(cpu_dai);
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
- case SND_SOC_DAIFMT_CBM_CFS:
- case SND_SOC_DAIFMT_CBS_CFS:
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BC_FC:
+ case SND_SOC_DAIFMT_BC_FP:
+ case SND_SOC_DAIFMT_BP_FP:
break;
default:
return -EINVAL;
@@ -450,14 +432,14 @@ static int pxa_ssp_configure_dai_fmt(struct ssp_priv *priv)
sscr1 |= SSCR1_RxTresh(8) | SSCR1_TxTresh(7);
- switch (priv->dai_fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
+ switch (priv->dai_fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BC_FC:
sscr1 |= SSCR1_SCLKDIR | SSCR1_SFRMDIR | SSCR1_SCFR;
break;
- case SND_SOC_DAIFMT_CBM_CFS:
+ case SND_SOC_DAIFMT_BC_FP:
sscr1 |= SSCR1_SCLKDIR | SSCR1_SCFR;
break;
- case SND_SOC_DAIFMT_CBS_CFS:
+ case SND_SOC_DAIFMT_BP_FP:
break;
default:
return -EINVAL;
@@ -502,9 +484,9 @@ static int pxa_ssp_configure_dai_fmt(struct ssp_priv *priv)
pxa_ssp_write_reg(ssp, SSCR1, sscr1);
pxa_ssp_write_reg(ssp, SSPSP, sspsp);
- switch (priv->dai_fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
- case SND_SOC_DAIFMT_CBM_CFS:
+ switch (priv->dai_fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BC_FC:
+ case SND_SOC_DAIFMT_BC_FP:
scfr = pxa_ssp_read_reg(ssp, SSCR1) | SSCR1_SCFR;
pxa_ssp_write_reg(ssp, SSCR1, scfr);
@@ -609,7 +591,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) {
const struct pxa_ssp_clock_mode *m;
- int ssacd, acds;
+ int ssacd;
for (m = pxa_ssp_clock_modes; m->rate; m++) {
if (m->rate == rate)
@@ -619,12 +601,6 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
if (!m->rate)
return -EINVAL;
- acds = m->acds;
-
- /* The values in the table are for 16 bits */
- if (width == 32)
- acds--;
-
ret = pxa_ssp_set_pll(priv, bclk);
if (ret < 0)
return ret;
@@ -797,7 +773,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai)
if (IS_ERR(priv->extclk)) {
ret = PTR_ERR(priv->extclk);
if (ret == -EPROBE_DEFER)
- return ret;
+ goto err_priv;
priv->extclk = NULL;
}
@@ -837,6 +813,8 @@ static int pxa_ssp_remove(struct snd_soc_dai *dai)
#define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
static const struct snd_soc_dai_ops pxa_ssp_dai_ops = {
+ .probe = pxa_ssp_probe,
+ .remove = pxa_ssp_remove,
.startup = pxa_ssp_startup,
.shutdown = pxa_ssp_shutdown,
.trigger = pxa_ssp_trigger,
@@ -848,8 +826,6 @@ static const struct snd_soc_dai_ops pxa_ssp_dai_ops = {
};
static struct snd_soc_dai_driver pxa_ssp_dai = {
- .probe = pxa_ssp_probe,
- .remove = pxa_ssp_remove,
.playback = {
.channels_min = 1,
.channels_max = 8,
@@ -866,19 +842,17 @@ static struct snd_soc_dai_driver pxa_ssp_dai = {
};
static const struct snd_soc_component_driver pxa_ssp_component = {
- .name = "pxa-ssp",
- .pcm_construct = pxa2xx_soc_pcm_new,
- .pcm_destruct = pxa2xx_soc_pcm_free,
- .open = pxa2xx_soc_pcm_open,
- .close = pxa2xx_soc_pcm_close,
- .hw_params = pxa2xx_soc_pcm_hw_params,
- .hw_free = pxa2xx_soc_pcm_hw_free,
- .prepare = pxa2xx_soc_pcm_prepare,
- .trigger = pxa2xx_soc_pcm_trigger,
- .pointer = pxa2xx_soc_pcm_pointer,
- .mmap = pxa2xx_soc_pcm_mmap,
- .suspend = pxa_ssp_suspend,
- .resume = pxa_ssp_resume,
+ .name = "pxa-ssp",
+ .pcm_construct = pxa2xx_soc_pcm_new,
+ .open = pxa2xx_soc_pcm_open,
+ .close = pxa2xx_soc_pcm_close,
+ .hw_params = pxa2xx_soc_pcm_hw_params,
+ .prepare = pxa2xx_soc_pcm_prepare,
+ .trigger = pxa2xx_soc_pcm_trigger,
+ .pointer = pxa2xx_soc_pcm_pointer,
+ .suspend = pxa_ssp_suspend,
+ .resume = pxa_ssp_resume,
+ .legacy_dai_naming = 1,
};
#ifdef CONFIG_OF
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 4240fde6aae8..78f50032afc5 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -21,9 +21,11 @@
#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
-#include <mach/hardware.h>
-#include <mach/regs-ac97.h>
-#include <mach/audio.h>
+#include <linux/platform_data/asoc-pxa.h>
+
+#define PCDR 0x0040 /* PCM FIFO Data Register */
+#define MODR 0x0140 /* Modem FIFO Data Register */
+#define MCDR 0x0060 /* Mic-in FIFO Data Register */
static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv)
{
@@ -59,35 +61,30 @@ static struct ac97_controller_ops pxa2xx_ac97_ops = {
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
- .addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "pcm_pcm_stereo_in",
.maxburst = 32,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
- .addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "pcm_pcm_stereo_out",
.maxburst = 32,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
- .addr = __PREG(MODR),
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mono_out",
.maxburst = 16,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
- .addr = __PREG(MODR),
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mono_in",
.maxburst = 16,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
- .addr = __PREG(MCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mic_mono",
.maxburst = 16,
@@ -202,15 +199,12 @@ static struct snd_soc_dai_driver pxa_ac97_dai_driver[] = {
static const struct snd_soc_component_driver pxa_ac97_component = {
.name = "pxa-ac97",
.pcm_construct = pxa2xx_soc_pcm_new,
- .pcm_destruct = pxa2xx_soc_pcm_free,
.open = pxa2xx_soc_pcm_open,
.close = pxa2xx_soc_pcm_close,
.hw_params = pxa2xx_soc_pcm_hw_params,
- .hw_free = pxa2xx_soc_pcm_hw_free,
.prepare = pxa2xx_soc_pcm_prepare,
.trigger = pxa2xx_soc_pcm_trigger,
.pointer = pxa2xx_soc_pcm_pointer,
- .mmap = pxa2xx_soc_pcm_mmap,
};
#ifdef CONFIG_OF
@@ -229,6 +223,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
int ret;
struct ac97_controller *ctrl;
pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data;
+ struct resource *regs;
void **codecs_pdata;
if (pdev->id != -1) {
@@ -236,6 +231,16 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
return -ENXIO;
}
+ regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!regs)
+ return -ENXIO;
+
+ pxa2xx_ac97_pcm_stereo_in.addr = regs->start + PCDR;
+ pxa2xx_ac97_pcm_stereo_out.addr = regs->start + PCDR;
+ pxa2xx_ac97_pcm_aux_mono_out.addr = regs->start + MODR;
+ pxa2xx_ac97_pcm_aux_mono_in.addr = regs->start + MODR;
+ pxa2xx_ac97_pcm_mic_mono_in.addr = regs->start + MCDR;
+
ret = pxa2xx_ac97_hw_probe(pdev);
if (ret) {
dev_err(&pdev->dev, "PXA2xx AC97 hw probe error (%d)\n", ret);
@@ -258,16 +263,14 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
pxa_ac97_dai_driver, ARRAY_SIZE(pxa_ac97_dai_driver));
}
-static int pxa2xx_ac97_dev_remove(struct platform_device *pdev)
+static void pxa2xx_ac97_dev_remove(struct platform_device *pdev)
{
struct ac97_controller *ctrl = platform_get_drvdata(pdev);
snd_ac97_controller_unregister(ctrl);
pxa2xx_ac97_hw_remove(pdev);
- return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int pxa2xx_ac97_dev_suspend(struct device *dev)
{
return pxa2xx_ac97_hw_suspend();
@@ -278,18 +281,15 @@ static int pxa2xx_ac97_dev_resume(struct device *dev)
return pxa2xx_ac97_hw_resume();
}
-static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops,
+static DEFINE_SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops,
pxa2xx_ac97_dev_suspend, pxa2xx_ac97_dev_resume);
-#endif
static struct platform_driver pxa2xx_ac97_driver = {
.probe = pxa2xx_ac97_dev_probe,
.remove = pxa2xx_ac97_dev_remove,
.driver = {
.name = "pxa2xx-ac97",
-#ifdef CONFIG_PM_SLEEP
.pm = &pxa2xx_ac97_pm_ops,
-#endif
.of_match_table = of_match_ptr(pxa2xx_ac97_dt_ids),
},
};
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 5301859a8453..849fbf176a70 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -21,21 +21,20 @@
#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
-#include <mach/hardware.h>
-#include <mach/audio.h>
+#include <linux/platform_data/asoc-pxa.h>
#include "pxa2xx-i2s.h"
/*
* I2S Controller Register and Bit Definitions
*/
-#define SACR0 __REG(0x40400000) /* Global Control Register */
-#define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */
-#define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
-#define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */
-#define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */
-#define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */
-#define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */
+#define SACR0 (0x0000) /* Global Control Register */
+#define SACR1 (0x0004) /* Serial Audio I 2 S/MSB-Justified Control Register */
+#define SASR0 (0x000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
+#define SAIMR (0x0014) /* Serial Audio Interrupt Mask Register */
+#define SAICR (0x0018) /* Serial Audio Interrupt Clear Register */
+#define SADIV (0x0060) /* Audio Clock Divider Register. */
+#define SADR (0x0080) /* Serial Audio Data Register (TX and RX FIFO access Register). */
#define SACR0_RFTH(x) ((x) << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */
#define SACR0_TFTH(x) ((x) << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */
@@ -77,16 +76,15 @@ struct pxa_i2s_port {
static struct pxa_i2s_port pxa_i2s;
static struct clk *clk_i2s;
static int clk_ena = 0;
+static void __iomem *i2s_reg_base;
static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_out = {
- .addr = __PREG(SADR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "tx",
.maxburst = 32,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = {
- .addr = __PREG(SADR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "rx",
.maxburst = 32,
@@ -95,14 +93,14 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = {
static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
if (IS_ERR(clk_i2s))
return PTR_ERR(clk_i2s);
if (!snd_soc_dai_active(cpu_dai))
- SACR0 = 0;
+ writel(0, i2s_reg_base + SACR0);
return 0;
}
@@ -114,7 +112,7 @@ static int pxa_i2s_wait(void)
/* flush the Rx FIFO */
for (i = 0; i < 16; i++)
- SADR;
+ readl(i2s_reg_base + SADR);
return 0;
}
@@ -131,11 +129,11 @@ static int pxa2xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
break;
}
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBS_CFS:
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BP_FP:
pxa_i2s.master = 1;
break;
- case SND_SOC_DAIFMT_CBM_CFS:
+ case SND_SOC_DAIFMT_BC_FP:
pxa_i2s.master = 0;
break;
default:
@@ -174,39 +172,39 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
/* is port used by another stream */
if (!(SACR0 & SACR0_ENB)) {
- SACR0 = 0;
+ writel(0, i2s_reg_base + SACR0);
if (pxa_i2s.master)
- SACR0 |= SACR0_BCKD;
+ writel(readl(i2s_reg_base + SACR0) | (SACR0_BCKD), i2s_reg_base + SACR0);
- SACR0 |= SACR0_RFTH(14) | SACR0_TFTH(1);
- SACR1 |= pxa_i2s.fmt;
+ writel(readl(i2s_reg_base + SACR0) | (SACR0_RFTH(14) | SACR0_TFTH(1)), i2s_reg_base + SACR0);
+ writel(readl(i2s_reg_base + SACR1) | (pxa_i2s.fmt), i2s_reg_base + SACR1);
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- SAIMR |= SAIMR_TFS;
+ writel(readl(i2s_reg_base + SAIMR) | (SAIMR_TFS), i2s_reg_base + SAIMR);
else
- SAIMR |= SAIMR_RFS;
+ writel(readl(i2s_reg_base + SAIMR) | (SAIMR_RFS), i2s_reg_base + SAIMR);
switch (params_rate(params)) {
case 8000:
- SADIV = 0x48;
+ writel(0x48, i2s_reg_base + SADIV);
break;
case 11025:
- SADIV = 0x34;
+ writel(0x34, i2s_reg_base + SADIV);
break;
case 16000:
- SADIV = 0x24;
+ writel(0x24, i2s_reg_base + SADIV);
break;
case 22050:
- SADIV = 0x1a;
+ writel(0x1a, i2s_reg_base + SADIV);
break;
case 44100:
- SADIV = 0xd;
+ writel(0xd, i2s_reg_base + SADIV);
break;
case 48000:
- SADIV = 0xc;
+ writel(0xc, i2s_reg_base + SADIV);
break;
case 96000: /* not in manual and possibly slightly inaccurate */
- SADIV = 0x6;
+ writel(0x6, i2s_reg_base + SADIV);
break;
}
@@ -221,10 +219,10 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- SACR1 &= ~SACR1_DRPL;
+ writel(readl(i2s_reg_base + SACR1) & (~SACR1_DRPL), i2s_reg_base + SACR1);
else
- SACR1 &= ~SACR1_DREC;
- SACR0 |= SACR0_ENB;
+ writel(readl(i2s_reg_base + SACR1) & (~SACR1_DREC), i2s_reg_base + SACR1);
+ writel(readl(i2s_reg_base + SACR0) | (SACR0_ENB), i2s_reg_base + SACR0);
break;
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
@@ -243,15 +241,15 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- SACR1 |= SACR1_DRPL;
- SAIMR &= ~SAIMR_TFS;
+ writel(readl(i2s_reg_base + SACR1) | (SACR1_DRPL), i2s_reg_base + SACR1);
+ writel(readl(i2s_reg_base + SAIMR) & (~SAIMR_TFS), i2s_reg_base + SAIMR);
} else {
- SACR1 |= SACR1_DREC;
- SAIMR &= ~SAIMR_RFS;
+ writel(readl(i2s_reg_base + SACR1) | (SACR1_DREC), i2s_reg_base + SACR1);
+ writel(readl(i2s_reg_base + SAIMR) & (~SAIMR_RFS), i2s_reg_base + SAIMR);
}
- if ((SACR1 & (SACR1_DREC | SACR1_DRPL)) == (SACR1_DREC | SACR1_DRPL)) {
- SACR0 &= ~SACR0_ENB;
+ if ((readl(i2s_reg_base + SACR1) & (SACR1_DREC | SACR1_DRPL)) == (SACR1_DREC | SACR1_DRPL)) {
+ writel(readl(i2s_reg_base + SACR0) & (~SACR0_ENB), i2s_reg_base + SACR0);
pxa_i2s_wait();
if (clk_ena) {
clk_disable_unprepare(clk_i2s);
@@ -264,13 +262,13 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
static int pxa2xx_soc_pcm_suspend(struct snd_soc_component *component)
{
/* store registers */
- pxa_i2s.sacr0 = SACR0;
- pxa_i2s.sacr1 = SACR1;
- pxa_i2s.saimr = SAIMR;
- pxa_i2s.sadiv = SADIV;
+ pxa_i2s.sacr0 = readl(i2s_reg_base + SACR0);
+ pxa_i2s.sacr1 = readl(i2s_reg_base + SACR1);
+ pxa_i2s.saimr = readl(i2s_reg_base + SAIMR);
+ pxa_i2s.sadiv = readl(i2s_reg_base + SADIV);
/* deactivate link */
- SACR0 &= ~SACR0_ENB;
+ writel(readl(i2s_reg_base + SACR0) & (~SACR0_ENB), i2s_reg_base + SACR0);
pxa_i2s_wait();
return 0;
}
@@ -279,12 +277,12 @@ static int pxa2xx_soc_pcm_resume(struct snd_soc_component *component)
{
pxa_i2s_wait();
- SACR0 = pxa_i2s.sacr0 & ~SACR0_ENB;
- SACR1 = pxa_i2s.sacr1;
- SAIMR = pxa_i2s.saimr;
- SADIV = pxa_i2s.sadiv;
+ writel(pxa_i2s.sacr0 & ~SACR0_ENB, i2s_reg_base + SACR0);
+ writel(pxa_i2s.sacr1, i2s_reg_base + SACR1);
+ writel(pxa_i2s.saimr, i2s_reg_base + SAIMR);
+ writel(pxa_i2s.sadiv, i2s_reg_base + SADIV);
- SACR0 = pxa_i2s.sacr0;
+ writel(pxa_i2s.sacr0, i2s_reg_base + SACR0);
return 0;
}
@@ -306,12 +304,12 @@ static int pxa2xx_i2s_probe(struct snd_soc_dai *dai)
* the SACR0[RST] bit must also be set and cleared to reset all
* I2S controller registers.
*/
- SACR0 = SACR0_RST;
- SACR0 = 0;
+ writel(SACR0_RST, i2s_reg_base + SACR0);
+ writel(0, i2s_reg_base + SACR0);
/* Make sure RPL and REC are disabled */
- SACR1 = SACR1_DRPL | SACR1_DREC;
+ writel(SACR1_DRPL | SACR1_DREC, i2s_reg_base + SACR1);
/* Along with FIFO servicing */
- SAIMR &= ~(SAIMR_RFS | SAIMR_TFS);
+ writel(readl(i2s_reg_base + SAIMR) & (~(SAIMR_RFS | SAIMR_TFS)), i2s_reg_base + SAIMR);
snd_soc_dai_init_dma_data(dai, &pxa2xx_i2s_pcm_stereo_out,
&pxa2xx_i2s_pcm_stereo_in);
@@ -331,6 +329,8 @@ static int pxa2xx_i2s_remove(struct snd_soc_dai *dai)
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)
static const struct snd_soc_dai_ops pxa_i2s_dai_ops = {
+ .probe = pxa2xx_i2s_probe,
+ .remove = pxa2xx_i2s_remove,
.startup = pxa2xx_i2s_startup,
.shutdown = pxa2xx_i2s_shutdown,
.trigger = pxa2xx_i2s_trigger,
@@ -340,8 +340,6 @@ static const struct snd_soc_dai_ops pxa_i2s_dai_ops = {
};
static struct snd_soc_dai_driver pxa_i2s_dai = {
- .probe = pxa2xx_i2s_probe,
- .remove = pxa2xx_i2s_remove,
.playback = {
.channels_min = 2,
.channels_max = 2,
@@ -353,27 +351,34 @@ static struct snd_soc_dai_driver pxa_i2s_dai = {
.rates = PXA2XX_I2S_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
.ops = &pxa_i2s_dai_ops,
- .symmetric_rates = 1,
+ .symmetric_rate = 1,
};
static const struct snd_soc_component_driver pxa_i2s_component = {
- .name = "pxa-i2s",
- .pcm_construct = pxa2xx_soc_pcm_new,
- .pcm_destruct = pxa2xx_soc_pcm_free,
- .open = pxa2xx_soc_pcm_open,
- .close = pxa2xx_soc_pcm_close,
- .hw_params = pxa2xx_soc_pcm_hw_params,
- .hw_free = pxa2xx_soc_pcm_hw_free,
- .prepare = pxa2xx_soc_pcm_prepare,
- .trigger = pxa2xx_soc_pcm_trigger,
- .pointer = pxa2xx_soc_pcm_pointer,
- .mmap = pxa2xx_soc_pcm_mmap,
- .suspend = pxa2xx_soc_pcm_suspend,
- .resume = pxa2xx_soc_pcm_resume,
+ .name = "pxa-i2s",
+ .pcm_construct = pxa2xx_soc_pcm_new,
+ .open = pxa2xx_soc_pcm_open,
+ .close = pxa2xx_soc_pcm_close,
+ .hw_params = pxa2xx_soc_pcm_hw_params,
+ .prepare = pxa2xx_soc_pcm_prepare,
+ .trigger = pxa2xx_soc_pcm_trigger,
+ .pointer = pxa2xx_soc_pcm_pointer,
+ .suspend = pxa2xx_soc_pcm_suspend,
+ .resume = pxa2xx_soc_pcm_resume,
+ .legacy_dai_naming = 1,
};
static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)
{
+ struct resource *res;
+
+ i2s_reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
+ if (IS_ERR(i2s_reg_base))
+ return PTR_ERR(i2s_reg_base);
+
+ pxa2xx_i2s_pcm_stereo_out.addr = res->start + SADR;
+ pxa2xx_i2s_pcm_stereo_in.addr = res->start + SADR;
+
return devm_snd_soc_register_component(&pdev->dev, &pxa_i2s_component,
&pxa_i2s_dai, 1);
}
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 2b7839715dd5..9d6c41f775e5 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -19,15 +19,12 @@
static const struct snd_soc_component_driver pxa2xx_soc_platform = {
.pcm_construct = pxa2xx_soc_pcm_new,
- .pcm_destruct = pxa2xx_soc_pcm_free,
.open = pxa2xx_soc_pcm_open,
.close = pxa2xx_soc_pcm_close,
.hw_params = pxa2xx_soc_pcm_hw_params,
- .hw_free = pxa2xx_soc_pcm_hw_free,
.prepare = pxa2xx_soc_pcm_prepare,
.trigger = pxa2xx_soc_pcm_trigger,
.pointer = pxa2xx_soc_pcm_pointer,
- .mmap = pxa2xx_soc_pcm_mmap,
};
static int pxa2xx_soc_platform_probe(struct platform_device *pdev)
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index 7c1384a869ca..6ca0a6bcd34c 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -14,13 +14,12 @@
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
-#include <mach/spitz.h>
#include "../codecs/wm8750.h"
#include "pxa2xx-i2s.h"
@@ -37,7 +36,7 @@
static int spitz_jack_func;
static int spitz_spk_func;
-static int spitz_mic_gpio;
+static struct gpio_desc *gpiod_mic, *gpiod_mute_l, *gpiod_mute_r;
static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
{
@@ -56,8 +55,8 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
- gpio_set_value(SPITZ_GPIO_MUTE_L, 1);
- gpio_set_value(SPITZ_GPIO_MUTE_R, 1);
+ gpiod_set_value(gpiod_mute_l, 1);
+ gpiod_set_value(gpiod_mute_r, 1);
break;
case SPITZ_MIC:
/* enable mic jack and bias, mute hp */
@@ -65,8 +64,8 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
snd_soc_dapm_enable_pin_unlocked(dapm, "Mic Jack");
- gpio_set_value(SPITZ_GPIO_MUTE_L, 0);
- gpio_set_value(SPITZ_GPIO_MUTE_R, 0);
+ gpiod_set_value(gpiod_mute_l, 0);
+ gpiod_set_value(gpiod_mute_r, 0);
break;
case SPITZ_LINE:
/* enable line jack, disable mic bias and mute hp */
@@ -74,8 +73,8 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Jack");
snd_soc_dapm_enable_pin_unlocked(dapm, "Line Jack");
- gpio_set_value(SPITZ_GPIO_MUTE_L, 0);
- gpio_set_value(SPITZ_GPIO_MUTE_R, 0);
+ gpiod_set_value(gpiod_mute_l, 0);
+ gpiod_set_value(gpiod_mute_r, 0);
break;
case SPITZ_HEADSET:
/* enable and unmute headset jack enable mic bias, mute L hp */
@@ -83,8 +82,8 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
snd_soc_dapm_enable_pin_unlocked(dapm, "Mic Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
snd_soc_dapm_enable_pin_unlocked(dapm, "Headset Jack");
- gpio_set_value(SPITZ_GPIO_MUTE_L, 0);
- gpio_set_value(SPITZ_GPIO_MUTE_R, 1);
+ gpiod_set_value(gpiod_mute_l, 0);
+ gpiod_set_value(gpiod_mute_r, 1);
break;
case SPITZ_HP_OFF:
@@ -93,8 +92,8 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Mic Jack");
snd_soc_dapm_disable_pin_unlocked(dapm, "Line Jack");
- gpio_set_value(SPITZ_GPIO_MUTE_L, 0);
- gpio_set_value(SPITZ_GPIO_MUTE_R, 0);
+ gpiod_set_value(gpiod_mute_l, 0);
+ gpiod_set_value(gpiod_mute_r, 0);
break;
}
@@ -105,7 +104,7 @@ static void spitz_ext_control(struct snd_soc_dapm_context *dapm)
static int spitz_startup(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
/* check the jack status at stream startup */
spitz_ext_control(&rtd->card->dapm);
@@ -116,9 +115,9 @@ static int spitz_startup(struct snd_pcm_substream *substream)
static int spitz_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
unsigned int clk = 0;
int ret = 0;
@@ -199,7 +198,7 @@ static int spitz_set_spk(struct snd_kcontrol *kcontrol,
static int spitz_mic_bias(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
- gpio_set_value_cansleep(spitz_mic_gpio, SND_SOC_DAPM_EVENT_ON(event));
+ gpiod_set_value_cansleep(gpiod_mic, SND_SOC_DAPM_EVENT_ON(event));
return 0;
}
@@ -261,7 +260,7 @@ static struct snd_soc_dai_link spitz_dai = {
.name = "wm8750",
.stream_name = "WM8750",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
+ SND_SOC_DAIFMT_CBC_CFC,
.ops = &spitz_ops,
SND_SOC_DAILINK_REG(wm8750),
};
@@ -287,49 +286,32 @@ static int spitz_probe(struct platform_device *pdev)
struct snd_soc_card *card = &snd_soc_spitz;
int ret;
- if (machine_is_akita())
- spitz_mic_gpio = AKITA_GPIO_MIC_BIAS;
- else
- spitz_mic_gpio = SPITZ_GPIO_MIC_BIAS;
-
- ret = gpio_request(spitz_mic_gpio, "MIC GPIO");
- if (ret)
- goto err1;
-
- ret = gpio_direction_output(spitz_mic_gpio, 0);
- if (ret)
- goto err2;
+ gpiod_mic = devm_gpiod_get(&pdev->dev, "mic", GPIOD_OUT_LOW);
+ if (IS_ERR(gpiod_mic))
+ return PTR_ERR(gpiod_mic);
+ gpiod_mute_l = devm_gpiod_get(&pdev->dev, "mute-l", GPIOD_OUT_LOW);
+ if (IS_ERR(gpiod_mute_l))
+ return PTR_ERR(gpiod_mute_l);
+ gpiod_mute_r = devm_gpiod_get(&pdev->dev, "mute-r", GPIOD_OUT_LOW);
+ if (IS_ERR(gpiod_mute_r))
+ return PTR_ERR(gpiod_mute_r);
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret) {
+ if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
- goto err2;
- }
- return 0;
-
-err2:
- gpio_free(spitz_mic_gpio);
-err1:
return ret;
}
-static int spitz_remove(struct platform_device *pdev)
-{
- gpio_free(spitz_mic_gpio);
- return 0;
-}
-
static struct platform_driver spitz_driver = {
.driver = {
.name = "spitz-audio",
.pm = &snd_soc_pm_ops,
},
.probe = spitz_probe,
- .remove = spitz_remove,
};
module_platform_driver(spitz_driver);
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
deleted file mode 100644
index 3b40b5fa5de7..000000000000
--- a/sound/soc/pxa/tosa.c
+++ /dev/null
@@ -1,262 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * tosa.c -- SoC audio for Tosa
- *
- * Copyright 2005 Wolfson Microelectronics PLC.
- * Copyright 2005 Openedhand Ltd.
- *
- * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
- * Richard Purdie <richard@openedhand.com>
- *
- * GPIO's
- * 1 - Jack Insertion
- * 5 - Hookswitch (headset answer/hang up switch)
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/device.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <mach/tosa.h>
-#include <mach/audio.h>
-
-#define TOSA_HP 0
-#define TOSA_MIC_INT 1
-#define TOSA_HEADSET 2
-#define TOSA_HP_OFF 3
-#define TOSA_SPK_ON 0
-#define TOSA_SPK_OFF 1
-
-static int tosa_jack_func;
-static int tosa_spk_func;
-
-static void tosa_ext_control(struct snd_soc_dapm_context *dapm)
-{
-
- snd_soc_dapm_mutex_lock(dapm);
-
- /* set up jack connection */
- switch (tosa_jack_func) {
- case TOSA_HP:
- snd_soc_dapm_disable_pin_unlocked(dapm, "Mic (Internal)");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
- break;
- case TOSA_MIC_INT:
- snd_soc_dapm_enable_pin_unlocked(dapm, "Mic (Internal)");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headset Jack");
- break;
- case TOSA_HEADSET:
- snd_soc_dapm_disable_pin_unlocked(dapm, "Mic (Internal)");
- snd_soc_dapm_disable_pin_unlocked(dapm, "Headphone Jack");
- snd_soc_dapm_enable_pin_unlocked(dapm, "Headset Jack");
- break;
- }
-
- if (tosa_spk_func == TOSA_SPK_ON)
- snd_soc_dapm_enable_pin_unlocked(dapm, "Speaker");
- else
- snd_soc_dapm_disable_pin_unlocked(dapm, "Speaker");
-
- snd_soc_dapm_sync_unlocked(dapm);
-
- snd_soc_dapm_mutex_unlock(dapm);
-}
-
-static int tosa_startup(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
-
- /* check the jack status at stream startup */
- tosa_ext_control(&rtd->card->dapm);
-
- return 0;
-}
-
-static const struct snd_soc_ops tosa_ops = {
- .startup = tosa_startup,
-};
-
-static int tosa_get_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = tosa_jack_func;
- return 0;
-}
-
-static int tosa_set_jack(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (tosa_jack_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- tosa_jack_func = ucontrol->value.enumerated.item[0];
- tosa_ext_control(&card->dapm);
- return 1;
-}
-
-static int tosa_get_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = tosa_spk_func;
- return 0;
-}
-
-static int tosa_set_spk(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
-
- if (tosa_spk_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- tosa_spk_func = ucontrol->value.enumerated.item[0];
- tosa_ext_control(&card->dapm);
- return 1;
-}
-
-/* tosa dapm event handlers */
-static int tosa_hp_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *k, int event)
-{
- gpio_set_value(TOSA_GPIO_L_MUTE, SND_SOC_DAPM_EVENT_ON(event) ? 1 : 0);
- return 0;
-}
-
-/* tosa machine dapm widgets */
-static const struct snd_soc_dapm_widget tosa_dapm_widgets[] = {
-SND_SOC_DAPM_HP("Headphone Jack", tosa_hp_event),
-SND_SOC_DAPM_HP("Headset Jack", NULL),
-SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
-SND_SOC_DAPM_SPK("Speaker", NULL),
-};
-
-/* tosa audio map */
-static const struct snd_soc_dapm_route audio_map[] = {
-
- /* headphone connected to HPOUTL, HPOUTR */
- {"Headphone Jack", NULL, "HPOUTL"},
- {"Headphone Jack", NULL, "HPOUTR"},
-
- /* ext speaker connected to LOUT2, ROUT2 */
- {"Speaker", NULL, "LOUT2"},
- {"Speaker", NULL, "ROUT2"},
-
- /* internal mic is connected to mic1, mic2 differential - with bias */
- {"MIC1", NULL, "Mic Bias"},
- {"MIC2", NULL, "Mic Bias"},
- {"Mic Bias", NULL, "Mic (Internal)"},
-
- /* headset is connected to HPOUTR, and LINEINR with bias */
- {"Headset Jack", NULL, "HPOUTR"},
- {"LINEINR", NULL, "Mic Bias"},
- {"Mic Bias", NULL, "Headset Jack"},
-};
-
-static const char * const jack_function[] = {"Headphone", "Mic", "Line",
- "Headset", "Off"};
-static const char * const spk_function[] = {"On", "Off"};
-static const struct soc_enum tosa_enum[] = {
- SOC_ENUM_SINGLE_EXT(5, jack_function),
- SOC_ENUM_SINGLE_EXT(2, spk_function),
-};
-
-static const struct snd_kcontrol_new tosa_controls[] = {
- SOC_ENUM_EXT("Jack Function", tosa_enum[0], tosa_get_jack,
- tosa_set_jack),
- SOC_ENUM_EXT("Speaker Function", tosa_enum[1], tosa_get_spk,
- tosa_set_spk),
-};
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link tosa_dai[] = {
-{
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- .ops = &tosa_ops,
- SND_SOC_DAILINK_REG(ac97),
-},
-{
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- .ops = &tosa_ops,
- SND_SOC_DAILINK_REG(ac97_aux),
-},
-};
-
-static struct snd_soc_card tosa = {
- .name = "Tosa",
- .owner = THIS_MODULE,
- .dai_link = tosa_dai,
- .num_links = ARRAY_SIZE(tosa_dai),
-
- .controls = tosa_controls,
- .num_controls = ARRAY_SIZE(tosa_controls),
- .dapm_widgets = tosa_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(tosa_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
- .fully_routed = true,
-};
-
-static int tosa_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &tosa;
- int ret;
-
- ret = gpio_request_one(TOSA_GPIO_L_MUTE, GPIOF_OUT_INIT_LOW,
- "Headphone Jack");
- if (ret)
- return ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
- gpio_free(TOSA_GPIO_L_MUTE);
- }
- return ret;
-}
-
-static int tosa_remove(struct platform_device *pdev)
-{
- gpio_free(TOSA_GPIO_L_MUTE);
- return 0;
-}
-
-static struct platform_driver tosa_driver = {
- .driver = {
- .name = "tosa-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = tosa_probe,
- .remove = tosa_remove,
-};
-
-module_platform_driver(tosa_driver);
-
-/* Module information */
-MODULE_AUTHOR("Richard Purdie");
-MODULE_DESCRIPTION("ALSA SoC Tosa");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:tosa-audio");
diff --git a/sound/soc/pxa/ttc-dkb.c b/sound/soc/pxa/ttc-dkb.c
deleted file mode 100644
index d5f2961b1a3e..000000000000
--- a/sound/soc/pxa/ttc-dkb.c
+++ /dev/null
@@ -1,141 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * linux/sound/soc/pxa/ttc_dkb.c
- *
- * Copyright (C) 2012 Marvell International Ltd.
- */
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <sound/jack.h>
-#include <asm/mach-types.h>
-#include <sound/pcm_params.h>
-#include "../codecs/88pm860x-codec.h"
-
-static struct snd_soc_jack hs_jack, mic_jack;
-
-static struct snd_soc_jack_pin hs_jack_pins[] = {
- { .pin = "Headset Stereophone", .mask = SND_JACK_HEADPHONE, },
-};
-
-static struct snd_soc_jack_pin mic_jack_pins[] = {
- { .pin = "Headset Mic 2", .mask = SND_JACK_MICROPHONE, },
-};
-
-/* ttc machine dapm widgets */
-static const struct snd_soc_dapm_widget ttc_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headset Stereophone", NULL),
- SND_SOC_DAPM_LINE("Lineout Out 1", NULL),
- SND_SOC_DAPM_LINE("Lineout Out 2", NULL),
- SND_SOC_DAPM_SPK("Ext Speaker", NULL),
- SND_SOC_DAPM_MIC("Ext Mic 1", NULL),
- SND_SOC_DAPM_MIC("Headset Mic 2", NULL),
- SND_SOC_DAPM_MIC("Ext Mic 3", NULL),
-};
-
-/* ttc machine audio map */
-static const struct snd_soc_dapm_route ttc_audio_map[] = {
- {"Headset Stereophone", NULL, "HS1"},
- {"Headset Stereophone", NULL, "HS2"},
-
- {"Ext Speaker", NULL, "LSP"},
- {"Ext Speaker", NULL, "LSN"},
-
- {"Lineout Out 1", NULL, "LINEOUT1"},
- {"Lineout Out 2", NULL, "LINEOUT2"},
-
- {"MIC1P", NULL, "Mic1 Bias"},
- {"MIC1N", NULL, "Mic1 Bias"},
- {"Mic1 Bias", NULL, "Ext Mic 1"},
-
- {"MIC2P", NULL, "Mic1 Bias"},
- {"MIC2N", NULL, "Mic1 Bias"},
- {"Mic1 Bias", NULL, "Headset Mic 2"},
-
- {"MIC3P", NULL, "Mic3 Bias"},
- {"MIC3N", NULL, "Mic3 Bias"},
- {"Mic3 Bias", NULL, "Ext Mic 3"},
-};
-
-static int ttc_pm860x_init(struct snd_soc_pcm_runtime *rtd)
-{
- struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
-
- /* Headset jack detection */
- snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE |
- SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2,
- &hs_jack, hs_jack_pins, ARRAY_SIZE(hs_jack_pins));
- snd_soc_card_jack_new(rtd->card, "Microphone Jack", SND_JACK_MICROPHONE,
- &mic_jack, mic_jack_pins,
- ARRAY_SIZE(mic_jack_pins));
-
- /* headphone, microphone detection & headset short detection */
- pm860x_hs_jack_detect(component, &hs_jack, SND_JACK_HEADPHONE,
- SND_JACK_BTN_0, SND_JACK_BTN_1, SND_JACK_BTN_2);
- pm860x_mic_jack_detect(component, &hs_jack, SND_JACK_MICROPHONE);
-
- return 0;
-}
-
-/* ttc/td-dkb digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(i2s,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa-ssp-dai.1")),
- DAILINK_COMP_ARRAY(COMP_CODEC("88pm860x-codec", "88pm860x-i2s")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("mmp-pcm-audio")));
-
-static struct snd_soc_dai_link ttc_pm860x_hifi_dai[] = {
-{
- .name = "88pm860x i2s",
- .stream_name = "audio playback",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBM_CFM,
- .init = ttc_pm860x_init,
- SND_SOC_DAILINK_REG(i2s),
-},
-};
-
-/* ttc/td audio machine driver */
-static struct snd_soc_card ttc_dkb_card = {
- .name = "ttc-dkb-hifi",
- .owner = THIS_MODULE,
- .dai_link = ttc_pm860x_hifi_dai,
- .num_links = ARRAY_SIZE(ttc_pm860x_hifi_dai),
-
- .dapm_widgets = ttc_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(ttc_dapm_widgets),
- .dapm_routes = ttc_audio_map,
- .num_dapm_routes = ARRAY_SIZE(ttc_audio_map),
-};
-
-static int ttc_dkb_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &ttc_dkb_card;
- int ret;
-
- card->dev = &pdev->dev;
-
- ret = devm_snd_soc_register_card(&pdev->dev, card);
- if (ret)
- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
- ret);
-
- return ret;
-}
-
-static struct platform_driver ttc_dkb_driver = {
- .driver = {
- .name = "ttc-dkb-audio",
- .pm = &snd_soc_pm_ops,
- },
- .probe = ttc_dkb_probe,
-};
-
-module_platform_driver(ttc_dkb_driver);
-
-/* Module information */
-MODULE_AUTHOR("Qiao Zhou, <zhouqiao@marvell.com>");
-MODULE_DESCRIPTION("ALSA SoC TTC DKB");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:ttc-dkb-audio");
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c
deleted file mode 100644
index edf2b9eec5b8..000000000000
--- a/sound/soc/pxa/z2.c
+++ /dev/null
@@ -1,219 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/sound/soc/pxa/z2.c
- *
- * SoC Audio driver for Aeronix Zipit Z2
- *
- * Copyright (C) 2009 Ken McGuire <kenm@desertweyr.com>
- * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <sound/jack.h>
-
-#include <asm/mach-types.h>
-#include <mach/hardware.h>
-#include <mach/audio.h>
-#include <mach/z2.h>
-
-#include "../codecs/wm8750.h"
-#include "pxa2xx-i2s.h"
-
-static struct snd_soc_card snd_soc_z2;
-
-static int z2_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int clk = 0;
- int ret = 0;
-
- switch (params_rate(params)) {
- case 8000:
- case 16000:
- case 48000:
- case 96000:
- clk = 12288000;
- break;
- case 11025:
- case 22050:
- case 44100:
- clk = 11289600;
- break;
- }
-
- /* set the codec system clock for DAC and ADC */
- ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- /* set the I2S system clock as input (unused) */
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0,
- SND_SOC_CLOCK_IN);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static struct snd_soc_jack hs_jack;
-
-/* Headset jack detection DAPM pins */
-static struct snd_soc_jack_pin hs_jack_pins[] = {
- {
- .pin = "Mic Jack",
- .mask = SND_JACK_MICROPHONE,
- },
- {
- .pin = "Headphone Jack",
- .mask = SND_JACK_HEADPHONE,
- },
- {
- .pin = "Ext Spk",
- .mask = SND_JACK_HEADPHONE,
- .invert = 1
- },
-};
-
-/* Headset jack detection gpios */
-static struct snd_soc_jack_gpio hs_jack_gpios[] = {
- {
- .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT,
- .name = "hsdet-gpio",
- .report = SND_JACK_HEADSET,
- .debounce_time = 200,
- .invert = 1,
- },
-};
-
-/* z2 machine dapm widgets */
-static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone Jack", NULL),
- SND_SOC_DAPM_MIC("Mic Jack", NULL),
- SND_SOC_DAPM_SPK("Ext Spk", NULL),
-
- /* headset is a mic and mono headphone */
- SND_SOC_DAPM_HP("Headset Jack", NULL),
-};
-
-/* Z2 machine audio_map */
-static const struct snd_soc_dapm_route z2_audio_map[] = {
-
- /* headphone connected to LOUT1, ROUT1 */
- {"Headphone Jack", NULL, "LOUT1"},
- {"Headphone Jack", NULL, "ROUT1"},
-
- /* ext speaker connected to LOUT2, ROUT2 */
- {"Ext Spk", NULL, "ROUT2"},
- {"Ext Spk", NULL, "LOUT2"},
-
- /* mic is connected to R input 2 - with bias */
- {"RINPUT2", NULL, "Mic Bias"},
- {"Mic Bias", NULL, "Mic Jack"},
-};
-
-/*
- * Logic for a wm8750 as connected on a Z2 Device
- */
-static int z2_wm8750_init(struct snd_soc_pcm_runtime *rtd)
-{
- int ret;
-
- /* Jack detection API stuff */
- ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET,
- &hs_jack, hs_jack_pins,
- ARRAY_SIZE(hs_jack_pins));
- if (ret)
- goto err;
-
- ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
- hs_jack_gpios);
- if (ret)
- goto err;
-
- return 0;
-
-err:
- return ret;
-}
-
-static const struct snd_soc_ops z2_ops = {
- .hw_params = z2_hw_params,
-};
-
-/* z2 digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(wm8750,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001b", "wm8750-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link z2_dai = {
- .name = "wm8750",
- .stream_name = "WM8750",
- .init = z2_wm8750_init,
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &z2_ops,
- SND_SOC_DAILINK_REG(wm8750),
-};
-
-/* z2 audio machine driver */
-static struct snd_soc_card snd_soc_z2 = {
- .name = "Z2",
- .owner = THIS_MODULE,
- .dai_link = &z2_dai,
- .num_links = 1,
-
- .dapm_widgets = wm8750_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets),
- .dapm_routes = z2_audio_map,
- .num_dapm_routes = ARRAY_SIZE(z2_audio_map),
- .fully_routed = true,
-};
-
-static struct platform_device *z2_snd_device;
-
-static int __init z2_init(void)
-{
- int ret;
-
- if (!machine_is_zipit2())
- return -ENODEV;
-
- z2_snd_device = platform_device_alloc("soc-audio", -1);
- if (!z2_snd_device)
- return -ENOMEM;
-
- platform_set_drvdata(z2_snd_device, &snd_soc_z2);
- ret = platform_device_add(z2_snd_device);
-
- if (ret)
- platform_device_put(z2_snd_device);
-
- return ret;
-}
-
-static void __exit z2_exit(void)
-{
- platform_device_unregister(z2_snd_device);
-}
-
-module_init(z2_init);
-module_exit(z2_exit);
-
-MODULE_AUTHOR("Ken McGuire <kenm@desertweyr.com>, "
- "Marek Vasut <marek.vasut@gmail.com>");
-MODULE_DESCRIPTION("ALSA SoC ZipitZ2");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
deleted file mode 100644
index bb89a53f4ab1..000000000000
--- a/sound/soc/pxa/zylonite.c
+++ /dev/null
@@ -1,266 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * zylonite.c -- SoC audio for Zylonite
- *
- * Copyright 2008 Wolfson Microelectronics PLC.
- * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/device.h>
-#include <linux/clk.h>
-#include <linux/i2c.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include "../codecs/wm9713.h"
-#include "pxa-ssp.h"
-
-/*
- * There is a physical switch SW15 on the board which changes the MCLK
- * for the WM9713 between the standard AC97 master clock and the
- * output of the CLK_POUT signal from the PXA.
- */
-static int clk_pout;
-module_param(clk_pout, int, 0);
-MODULE_PARM_DESC(clk_pout, "Use CLK_POUT as WM9713 MCLK (SW15 on board).");
-
-static struct clk *pout;
-
-static struct snd_soc_card zylonite;
-
-static const struct snd_soc_dapm_widget zylonite_dapm_widgets[] = {
- SND_SOC_DAPM_HP("Headphone", NULL),
- SND_SOC_DAPM_MIC("Headset Microphone", NULL),
- SND_SOC_DAPM_MIC("Handset Microphone", NULL),
- SND_SOC_DAPM_SPK("Multiactor", NULL),
- SND_SOC_DAPM_SPK("Headset Earpiece", NULL),
-};
-
-/* Currently supported audio map */
-static const struct snd_soc_dapm_route audio_map[] = {
-
- /* Headphone output connected to HPL/HPR */
- { "Headphone", NULL, "HPL" },
- { "Headphone", NULL, "HPR" },
-
- /* On-board earpiece */
- { "Headset Earpiece", NULL, "OUT3" },
-
- /* Headphone mic */
- { "MIC2A", NULL, "Mic Bias" },
- { "Mic Bias", NULL, "Headset Microphone" },
-
- /* On-board mic */
- { "MIC1", NULL, "Mic Bias" },
- { "Mic Bias", NULL, "Handset Microphone" },
-
- /* Multiactor differentially connected over SPKL/SPKR */
- { "Multiactor", NULL, "SPKL" },
- { "Multiactor", NULL, "SPKR" },
-};
-
-static int zylonite_wm9713_init(struct snd_soc_pcm_runtime *rtd)
-{
- if (clk_pout)
- snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0), 0, 0,
- clk_get_rate(pout), 0);
-
- return 0;
-}
-
-static int zylonite_voice_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
- struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
- unsigned int wm9713_div = 0;
- int ret = 0;
- int rate = params_rate(params);
-
- /* Only support ratios that we can generate neatly from the AC97
- * based master clock - in particular, this excludes 44.1kHz.
- * In most applications the voice DAC will be used for telephony
- * data so multiples of 8kHz will be the common case.
- */
- switch (rate) {
- case 8000:
- wm9713_div = 12;
- break;
- case 16000:
- wm9713_div = 6;
- break;
- case 48000:
- wm9713_div = 2;
- break;
- default:
- /* Don't support OSS emulation */
- return -EINVAL;
- }
-
- ret = snd_soc_dai_set_sysclk(cpu_dai, PXA_SSP_CLK_AUDIO, 0, 1);
- if (ret < 0)
- return ret;
-
- if (clk_pout)
- ret = snd_soc_dai_set_clkdiv(codec_dai, WM9713_PCMCLK_PLL_DIV,
- WM9713_PCMDIV(wm9713_div));
- else
- ret = snd_soc_dai_set_clkdiv(codec_dai, WM9713_PCMCLK_DIV,
- WM9713_PCMDIV(wm9713_div));
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static const struct snd_soc_ops zylonite_voice_ops = {
- .hw_params = zylonite_voice_hw_params,
-};
-
-SND_SOC_DAILINK_DEFS(ac97,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(ac97_aux,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97-aux")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-aux")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-SND_SOC_DAILINK_DEFS(voice,
- DAILINK_COMP_ARRAY(COMP_CPU("pxa-ssp-dai.2")),
- DAILINK_COMP_ARRAY(COMP_CODEC("wm9713-codec", "wm9713-voice")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
-
-static struct snd_soc_dai_link zylonite_dai[] = {
-{
- .name = "AC97",
- .stream_name = "AC97 HiFi",
- .init = zylonite_wm9713_init,
- SND_SOC_DAILINK_REG(ac97),
-},
-{
- .name = "AC97 Aux",
- .stream_name = "AC97 Aux",
- SND_SOC_DAILINK_REG(ac97_aux),
-},
-{
- .name = "WM9713 Voice",
- .stream_name = "WM9713 Voice",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
- .ops = &zylonite_voice_ops,
- SND_SOC_DAILINK_REG(voice),
-},
-};
-
-static int zylonite_probe(struct snd_soc_card *card)
-{
- int ret;
-
- if (clk_pout) {
- pout = clk_get(NULL, "CLK_POUT");
- if (IS_ERR(pout)) {
- dev_err(card->dev, "Unable to obtain CLK_POUT: %ld\n",
- PTR_ERR(pout));
- return PTR_ERR(pout);
- }
-
- ret = clk_enable(pout);
- if (ret != 0) {
- dev_err(card->dev, "Unable to enable CLK_POUT: %d\n",
- ret);
- clk_put(pout);
- return ret;
- }
-
- dev_dbg(card->dev, "MCLK enabled at %luHz\n",
- clk_get_rate(pout));
- }
-
- return 0;
-}
-
-static int zylonite_remove(struct snd_soc_card *card)
-{
- if (clk_pout) {
- clk_disable(pout);
- clk_put(pout);
- }
-
- return 0;
-}
-
-static int zylonite_suspend_post(struct snd_soc_card *card)
-{
- if (clk_pout)
- clk_disable(pout);
-
- return 0;
-}
-
-static int zylonite_resume_pre(struct snd_soc_card *card)
-{
- int ret = 0;
-
- if (clk_pout) {
- ret = clk_enable(pout);
- if (ret != 0)
- dev_err(card->dev, "Unable to enable CLK_POUT: %d\n",
- ret);
- }
-
- return ret;
-}
-
-static struct snd_soc_card zylonite = {
- .name = "Zylonite",
- .owner = THIS_MODULE,
- .probe = &zylonite_probe,
- .remove = &zylonite_remove,
- .suspend_post = &zylonite_suspend_post,
- .resume_pre = &zylonite_resume_pre,
- .dai_link = zylonite_dai,
- .num_links = ARRAY_SIZE(zylonite_dai),
-
- .dapm_widgets = zylonite_dapm_widgets,
- .num_dapm_widgets = ARRAY_SIZE(zylonite_dapm_widgets),
- .dapm_routes = audio_map,
- .num_dapm_routes = ARRAY_SIZE(audio_map),
-};
-
-static struct platform_device *zylonite_snd_ac97_device;
-
-static int __init zylonite_init(void)
-{
- int ret;
-
- zylonite_snd_ac97_device = platform_device_alloc("soc-audio", -1);
- if (!zylonite_snd_ac97_device)
- return -ENOMEM;
-
- platform_set_drvdata(zylonite_snd_ac97_device, &zylonite);
-
- ret = platform_device_add(zylonite_snd_ac97_device);
- if (ret != 0)
- platform_device_put(zylonite_snd_ac97_device);
-
- return ret;
-}
-
-static void __exit zylonite_exit(void)
-{
- platform_device_unregister(zylonite_snd_ac97_device);
-}
-
-module_init(zylonite_init);
-module_exit(zylonite_exit);
-
-MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
-MODULE_DESCRIPTION("ALSA SoC WM9713 Zylonite");
-MODULE_LICENSE("GPL");