From f0a2ff2afda84c19f977dadf5701c7c354817e66 Mon Sep 17 00:00:00 2001 From: Manoj Gangwal Date: Mon, 30 Apr 2012 21:17:24 +0530 Subject: 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 Reviewed-on: http://git-master/r/99667 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Hunk Lin Reviewed-by: Scott Peterson --- sound/soc/codecs/spdif_transciever.c | 38 +++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'sound/soc/codecs/spdif_transciever.c') 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, * Copyright: (C) 2009 MontaVista Software, Inc., * 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 #include #include #include @@ -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) -- cgit v1.2.3 From e463cd94c8a523c00624616ea94a5f20e4e5d3dc Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Thu, 3 May 2012 15:15:31 +0530 Subject: asoc: codecs: spdif: Add support for setting bias level Allow setting bias level to turn off clock extern1 on enterprise when codec is idle. Added a dummy widget to make the target_bias_level to BIAS_OFF as per required by the new ALSA kernel. Bug 984678 Signed-off-by: Ankit Gupta Change-Id: I29de405c26286eee0a49e655f1d4236f6093ce8a Reviewed-on: http://git-master/r/100287 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Manoj Gangwal Reviewed-by: Scott Peterson Tested-by: Ankit Gupta (Engrg-SW) --- sound/soc/codecs/spdif_transciever.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/codecs/spdif_transciever.c') diff --git a/sound/soc/codecs/spdif_transciever.c b/sound/soc/codecs/spdif_transciever.c index 16ea0ed77355..6173b3a5b082 100644 --- a/sound/soc/codecs/spdif_transciever.c +++ b/sound/soc/codecs/spdif_transciever.c @@ -77,7 +77,7 @@ static struct snd_soc_dai_driver dit_stub_dai = { static int spdif_dit_probe(struct platform_device *pdev) { - if(machine_is_kai()) + if(machine_is_kai() || machine_is_tegra_enterprise()) return snd_soc_register_codec(&pdev->dev, &soc_codec_spdif_dit1, &dit_stub_dai, 1); else -- cgit v1.2.3