| Index: sound/soc/samsung/goni_wm8994.c
|
| diff --git a/sound/soc/s3c24xx/goni_wm8994.c b/sound/soc/samsung/goni_wm8994.c
|
| similarity index 84%
|
| rename from sound/soc/s3c24xx/goni_wm8994.c
|
| rename to sound/soc/samsung/goni_wm8994.c
|
| index 694f702cc8e2c7c350d26893bb33811e9c8b95ac..f6b3a3ce59196078e11c670c94a417edc1517b5b 100644
|
| --- a/sound/soc/s3c24xx/goni_wm8994.c
|
| +++ b/sound/soc/samsung/goni_wm8994.c
|
| @@ -11,22 +11,21 @@
|
| *
|
| */
|
|
|
| -#include <linux/module.h>
|
| -#include <linux/moduleparam.h>
|
| -#include <linux/io.h>
|
| -#include <linux/platform_device.h>
|
| #include <sound/soc.h>
|
| -#include <sound/soc-dapm.h>
|
| #include <sound/jack.h>
|
| +
|
| #include <asm/mach-types.h>
|
| #include <mach/gpio.h>
|
| -#include <mach/regs-clock.h>
|
|
|
| -#include <linux/mfd/wm8994/core.h>
|
| -#include <linux/mfd/wm8994/registers.h>
|
| #include "../codecs/wm8994.h"
|
| -#include "s3c-dma.h"
|
| -#include "s3c64xx-i2s.h"
|
| +
|
| +#define MACHINE_NAME 0
|
| +#define CPU_VOICE_DAI 1
|
| +
|
| +static const char *aquila_str[] = {
|
| + [MACHINE_NAME] = "aquila",
|
| + [CPU_VOICE_DAI] = "aquila-voice-dai",
|
| +};
|
|
|
| static struct snd_soc_card goni;
|
| static struct platform_device *goni_snd_device;
|
| @@ -97,28 +96,34 @@ static const struct snd_soc_dapm_route goni_dapm_routes[] = {
|
| static int goni_wm8994_init(struct snd_soc_pcm_runtime *rtd)
|
| {
|
| struct snd_soc_codec *codec = rtd->codec;
|
| + struct snd_soc_dapm_context *dapm = &codec->dapm;
|
| int ret;
|
|
|
| /* add goni specific widgets */
|
| - snd_soc_dapm_new_controls(codec, goni_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, goni_dapm_widgets,
|
| ARRAY_SIZE(goni_dapm_widgets));
|
|
|
| /* set up goni specific audio routes */
|
| - snd_soc_dapm_add_routes(codec, goni_dapm_routes,
|
| + snd_soc_dapm_add_routes(dapm, goni_dapm_routes,
|
| ARRAY_SIZE(goni_dapm_routes));
|
|
|
| /* set endpoints to not connected */
|
| - snd_soc_dapm_nc_pin(codec, "IN2LP:VXRN");
|
| - snd_soc_dapm_nc_pin(codec, "IN2RP:VXRP");
|
| - snd_soc_dapm_nc_pin(codec, "LINEOUT1N");
|
| - snd_soc_dapm_nc_pin(codec, "LINEOUT1P");
|
| - snd_soc_dapm_nc_pin(codec, "LINEOUT2N");
|
| - snd_soc_dapm_nc_pin(codec, "LINEOUT2P");
|
| + snd_soc_dapm_nc_pin(dapm, "IN2LP:VXRN");
|
| + snd_soc_dapm_nc_pin(dapm, "IN2RP:VXRP");
|
| + snd_soc_dapm_nc_pin(dapm, "LINEOUT1N");
|
| + snd_soc_dapm_nc_pin(dapm, "LINEOUT1P");
|
| + snd_soc_dapm_nc_pin(dapm, "LINEOUT2N");
|
| + snd_soc_dapm_nc_pin(dapm, "LINEOUT2P");
|
| +
|
| + if (machine_is_aquila()) {
|
| + snd_soc_dapm_nc_pin(dapm, "SPKOUTRN");
|
| + snd_soc_dapm_nc_pin(dapm, "SPKOUTRP");
|
| + }
|
|
|
| - snd_soc_dapm_sync(codec);
|
| + snd_soc_dapm_sync(dapm);
|
|
|
| /* Headset jack detection */
|
| - ret = snd_soc_jack_new(&goni, "Headset Jack",
|
| + ret = snd_soc_jack_new(codec, "Headset Jack",
|
| SND_JACK_HEADSET | SND_JACK_MECHANICAL | SND_JACK_AVOUT,
|
| &jack);
|
| if (ret)
|
| @@ -150,12 +155,6 @@ static int goni_hifi_hw_params(struct snd_pcm_substream *substream,
|
| if (ret < 0)
|
| return ret;
|
|
|
| - /* set the cpu system clock */
|
| - ret = snd_soc_dai_set_sysclk(cpu_dai, S3C64XX_CLKSRC_PCLK,
|
| - 0, SND_SOC_CLOCK_IN);
|
| - if (ret < 0)
|
| - return ret;
|
| -
|
| /* set codec DAI configuration */
|
| ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
|
| SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
|
| @@ -236,9 +235,9 @@ static struct snd_soc_dai_link goni_dai[] = {
|
| {
|
| .name = "WM8994",
|
| .stream_name = "WM8994 HiFi",
|
| - .cpu_dai_name = "s3c64xx-i2s-v4",
|
| + .cpu_dai_name = "samsung-i2s.0",
|
| .codec_dai_name = "wm8994-hifi",
|
| - .platform_name = "s3c24xx-pcm-audio",
|
| + .platform_name = "samsung-audio",
|
| .codec_name = "wm8994-codec.0-0x1a",
|
| .init = goni_wm8994_init,
|
| .ops = &goni_hifi_ops,
|
| @@ -247,7 +246,7 @@ static struct snd_soc_dai_link goni_dai[] = {
|
| .stream_name = "Voice",
|
| .cpu_dai_name = "goni-voice-dai",
|
| .codec_dai_name = "wm8994-voice",
|
| - .platform_name = "s3c24xx-pcm-audio",
|
| + .platform_name = "samsung-audio",
|
| .codec_name = "wm8994-codec.0-0x1a",
|
| .ops = &goni_voice_ops,
|
| },
|
| @@ -263,7 +262,11 @@ static int __init goni_init(void)
|
| {
|
| int ret;
|
|
|
| - if (!machine_is_goni())
|
| + if (machine_is_aquila()) {
|
| + voice_dai.name = aquila_str[CPU_VOICE_DAI];
|
| + goni_dai[1].cpu_dai_name = aquila_str[CPU_VOICE_DAI];
|
| + goni.name = aquila_str[MACHINE_NAME];
|
| + } else if (!machine_is_goni())
|
| return -ENODEV;
|
|
|
| goni_snd_device = platform_device_alloc("soc-audio", -1);
|
| @@ -272,20 +275,25 @@ static int __init goni_init(void)
|
|
|
| /* register voice DAI here */
|
| ret = snd_soc_register_dai(&goni_snd_device->dev, &voice_dai);
|
| - if (ret)
|
| + if (ret) {
|
| + platform_device_put(goni_snd_device);
|
| return ret;
|
| + }
|
|
|
| platform_set_drvdata(goni_snd_device, &goni);
|
| ret = platform_device_add(goni_snd_device);
|
|
|
| - if (ret)
|
| + if (ret) {
|
| + snd_soc_unregister_dai(&goni_snd_device->dev);
|
| platform_device_put(goni_snd_device);
|
| + }
|
|
|
| return ret;
|
| }
|
|
|
| static void __exit goni_exit(void)
|
| {
|
| + snd_soc_unregister_dai(&goni_snd_device->dev);
|
| platform_device_unregister(goni_snd_device);
|
| }
|
|
|
|
|