Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chaithrika U S <chaithrika@ti.com>
To: alsa-devel@alsa-project.org
Cc: khilman@deeprootsystems.com, Chaithrika U S <chaithrika@ti.com>,
	davinci-linux-open-source@linux.davincidsp.com,
	broonie@opensource.wolfsonmicro.com
Subject: [PATCH] ASoC: DaVinci: Updates to EVM hardware params callback
Date: Wed, 20 Jan 2010 17:02:41 +0530	[thread overview]
Message-ID: <1263987161-29657-1-git-send-email-chaithrika@ti.com> (raw)

For S/PDIF transciever codec to work on TI DM6467 EVM,
the codec ops pointer should be checked for in the params callback.
This dummy codec has no set_fmt or set_sysclk implementations.

Tested on TI DM6467 EVM.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Tested-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
---
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 |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 7ccbe66..1760354 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -64,9 +64,11 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 
 	/* set codec DAI configuration */
-	ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
-	if (ret < 0)
-		return ret;
+	if (codec_dai->ops->set_fmt) {
+		ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
+		if (ret < 0)
+			return ret;
+	}
 
 	/* set cpu DAI configuration */
 	ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
@@ -74,9 +76,12 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 
 	/* set the codec system clock */
-	ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT);
-	if (ret < 0)
-		return ret;
+	if (codec_dai->ops->set_sysclk) {
+		ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk,
+							SND_SOC_CLOCK_OUT);
+		if (ret < 0)
+			return ret;
+	}
 
 	return 0;
 }
-- 
1.5.6

             reply	other threads:[~2010-01-20 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 11:32 Chaithrika U S [this message]
2010-01-26 11:14 ` [PATCH] ASoC: DaVinci: Updates to EVM hardware params callback Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263987161-29657-1-git-send-email-chaithrika@ti.com \
    --to=chaithrika@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=khilman@deeprootsystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox