diff options
author | Manoj Gangwal <mgangwal@nvidia.com> | 2012-04-30 21:17:24 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-05-01 14:39:08 -0700 |
commit | f0a2ff2afda84c19f977dadf5701c7c354817e66 (patch) | |
tree | 114213188108ffd34e47375fb5f45edc0bcf5807 /sound/soc | |
parent | 5e03e0db07043177b677b5890711568c586fcfc4 (diff) |
asoc: codecs: spdif: Add support for setting bias level
Allow setting bias level to turn off clock extern1 on KAI when
codec is idle. Added a dummy widgets to make the target_bias_level
to BIAS_OFF as per required by the new ALSA kernel.
Bug 964287
Change-Id: I628744040866a9879eedc41ed4ee25af38ed86fb
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/99667
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Hunk Lin <hulin@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/spdif_transciever.c | 38 |
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) |