All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link
@ 2010-03-10  9:18 Chaithrika U S
  2010-03-10 11:08 ` Liam Girdwood
  2010-03-10 12:00 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Chaithrika U S @ 2010-03-10  9:18 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E

On TI DM6467 EVM, S/PDIF DIT codec fails to open as it is unable to install
hardware params. This dummy codec has no set_fmt and set_sysclk implementations
and calls from the application to these functions cause errors. This patch adds
a new hardware params callback function for S/PDIF transciever codec.

Signed-off-by: Chaithrika U S <chaithrika-l0cyMroinI0@public.gmane.org>
Tested-by: Anuj Aggarwal <anuj.aggarwal-l0cyMroinI0@public.gmane.org>
---
This patch has been re-worked upon based on the review comments for
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-January/024621.html

Applies to ALSA GIT tree on branch topic/asoc at
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=shortlog;
h=topic/asoc

 sound/soc/davinci/davinci-evm.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 7ccbe66..dba6651 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -81,10 +81,24 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
+static int evm_spdif_hw_params(struct snd_pcm_substream *substream,
+				struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+
+	/* set cpu DAI configuration */
+	return snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
+}
+
 static struct snd_soc_ops evm_ops = {
 	.hw_params = evm_hw_params,
 };
 
+static struct snd_soc_ops evm_spdif_ops = {
+	.hw_params = evm_spdif_hw_params,
+};
+
 /* davinci-evm machine dapm widgets */
 static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
 	SND_SOC_DAPM_HP("Headphone Jack", NULL),
@@ -165,7 +179,7 @@ static struct snd_soc_dai_link dm6467_evm_dai[] = {
 		.stream_name = "spdif",
 		.cpu_dai = &davinci_mcasp_dai[DAVINCI_MCASP_DIT_DAI],
 		.codec_dai = &dit_stub_dai,
-		.ops = &evm_ops,
+		.ops = &evm_spdif_ops,
 	},
 };
 static struct snd_soc_dai_link da8xx_evm_dai = {
-- 
1.5.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link
  2010-03-10  9:18 [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link Chaithrika U S
@ 2010-03-10 11:08 ` Liam Girdwood
  2010-03-10 12:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2010-03-10 11:08 UTC (permalink / raw)
  To: Chaithrika U S
  Cc: alsa-devel, sudhakar.raj, khilman, broonie, nsekhar,
	davinci-linux-open-source

On Wed, 2010-03-10 at 14:48 +0530, Chaithrika U S wrote:
> On TI DM6467 EVM, S/PDIF DIT codec fails to open as it is unable to install
> hardware params. This dummy codec has no set_fmt and set_sysclk implementations
> and calls from the application to these functions cause errors. This patch adds
> a new hardware params callback function for S/PDIF transciever codec.
> 
> Signed-off-by: Chaithrika U S <chaithrika@ti.com>
> Tested-by: Anuj Aggarwal <anuj.aggarwal@ti.com>

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link
  2010-03-10  9:18 [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link Chaithrika U S
  2010-03-10 11:08 ` Liam Girdwood
@ 2010-03-10 12:00 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-03-10 12:00 UTC (permalink / raw)
  To: Chaithrika U S
  Cc: khilman, alsa-devel, sudhakar.raj, nsekhar,
	davinci-linux-open-source

On Wed, Mar 10, 2010 at 02:48:33PM +0530, Chaithrika U S wrote:
> On TI DM6467 EVM, S/PDIF DIT codec fails to open as it is unable to install
> hardware params. This dummy codec has no set_fmt and set_sysclk implementations
> and calls from the application to these functions cause errors. This patch adds
> a new hardware params callback function for S/PDIF transciever codec.

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-10 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10  9:18 [PATCH] ASoC: DaVinci: Add hw_param callback for S/PDIF DIT link Chaithrika U S
2010-03-10 11:08 ` Liam Girdwood
2010-03-10 12:00 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.