summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/spdif_transciever.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/sound/soc/codecs/spdif_transciever.c b/sound/soc/codecs/spdif_transciever.c
index 7c1bf5c04eb9..16ea0ed77355 100644
--- a/sound/soc/codecs/spdif_transciever.c
+++ b/sound/soc/codecs/spdif_transciever.c
@@ -8,12 +8,15 @@
* Author: Steve Chen, <schen@mvista.com>
* Copyright: (C) 2009 MontaVista Software, Inc., <source@mvista.com>
* Copyright: (C) 2009 Texas Instruments, India
+ * Copyright: (C) 2009-2012, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+
+#include <asm/mach-types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
@@ -26,9 +29,34 @@
#define STUB_RATES SNDRV_PCM_RATE_8000_96000
#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE
-
static struct snd_soc_codec_driver soc_codec_spdif_dit;
+static int spdif_probe(struct snd_soc_codec *codec) {
+ codec->dapm.idle_bias_off = 1;
+ return 0;
+}
+
+static const struct snd_soc_dapm_widget spdif_dapm_widgets[] = {
+ SND_SOC_DAPM_VMID("spdif dummy Vmid"),
+};
+
+static int spdif_write(struct snd_soc_codec * codec, unsigned int reg,
+ unsigned int val){
+ return 0;
+}
+
+static int spdif_read(struct snd_soc_codec * codec, unsigned int reg){
+ return 0;
+}
+
+static struct snd_soc_codec_driver soc_codec_spdif_dit1 = {
+ .probe = spdif_probe,
+ .dapm_widgets = spdif_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(spdif_dapm_widgets),
+ .read = spdif_read,
+ .write = spdif_write,
+};
+
static struct snd_soc_dai_driver dit_stub_dai = {
.name = "dit-hifi",
.playback = {
@@ -49,8 +77,12 @@ static struct snd_soc_dai_driver dit_stub_dai = {
static int spdif_dit_probe(struct platform_device *pdev)
{
- return snd_soc_register_codec(&pdev->dev, &soc_codec_spdif_dit,
- &dit_stub_dai, 1);
+ if(machine_is_kai())
+ return snd_soc_register_codec(&pdev->dev,
+ &soc_codec_spdif_dit1, &dit_stub_dai, 1);
+ else
+ return snd_soc_register_codec(&pdev->dev,
+ &soc_codec_spdif_dit, &dit_stub_dai, 1);
}
static int spdif_dit_remove(struct platform_device *pdev)