diff mbox

ASoC: DaVinci: Updates to EVM hardware params callback

Message ID 1263987161-29657-1-git-send-email-chaithrika@ti.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

chaithrika@ti.com Jan. 20, 2010, 11:32 a.m. UTC
None
diff mbox

Patch

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;
 }