Stephen Warren | 7 Jun 2012 01:15

[PATCH 1/2] ASoC: tegra: statically define DAI link format

From: Stephen Warren <swarren@...>

Define the DAI format statically in the dai_link, rather than executing
code to set it each time the hw params are set.

Signed-off-by: Stephen Warren <swarren@...>
---
 sound/soc/tegra/tegra_wm8903.c |   22 +++-------------------
 sound/soc/tegra/trimslice.c    |   22 +++-------------------
 2 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 1fd71e5..087d3d8 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
 <at>  <at>  -58,7 +58,6  <at>  <at>  static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_card *card = codec->card;
 	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
 <at>  <at>  -86,24 +85,6  <at>  <at>  static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
 		return err;
 	}

-	err = snd_soc_dai_set_fmt(codec_dai,
-					SND_SOC_DAIFMT_I2S |
-					SND_SOC_DAIFMT_NB_NF |
(Continue reading)

Stephen Warren | 7 Jun 2012 01:15

[PATCH 2/2] ASoC: tegra: remove usage of rtd->codec

From: Stephen Warren <swarren@...>

rtd->codec_dai->codec can be used instead.

This is a slight step along the way to not needing the rtd->codec field
any more.

Signed-off-by: Stephen Warren <swarren@...>
---
 sound/soc/tegra/tegra_alc5632.c |    5 +++--
 sound/soc/tegra/tegra_wm8753.c  |    2 +-
 sound/soc/tegra/tegra_wm8903.c  |    5 +++--
 sound/soc/tegra/trimslice.c     |    2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 417b09b..d684df2 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
 <at>  <at>  -43,7 +43,7  <at>  <at>  static int tegra_alc5632_asoc_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_codec *codec = rtd->codec;
+	struct snd_soc_codec *codec = codec_dai->codec;
 	struct snd_soc_card *card = codec->card;
 	struct tegra_alc5632 *alc5632 = snd_soc_card_get_drvdata(card);
 	int srate, mclk;
 <at>  <at>  -105,7 +105,8  <at>  <at>  static const struct snd_kcontrol_new tegra_alc5632_controls[] = {

(Continue reading)

Mark Brown | 8 Jun 2012 01:03
Favicon
Gravatar

Re: [PATCH 1/2] ASoC: tegra: statically define DAI link format

On Wed, Jun 06, 2012 at 05:15:48PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@...>
> 
> Define the DAI format statically in the dai_link, rather than executing
> code to set it each time the hw params are set.

Applied, thanks.

Gmane