[alsa-devel] [PATCH 1/4] ASoC: Use dai_fmt in saarb machine driver
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/pxa/saarb.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/pxa/saarb.c b/sound/soc/pxa/saarb.c index 2e21712..b2be225 100644 --- a/sound/soc/pxa/saarb.c +++ b/sound/soc/pxa/saarb.c @@ -92,15 +92,6 @@ static int saarb_i2s_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret;
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); - if (ret < 0) - return ret; - ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); - if (ret < 0) - return ret; - ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width);
return ret; @@ -119,6 +110,8 @@ static struct snd_soc_dai_link saarb_dai[] = { .platform_name = "pxa-pcm-audio", .codec_name = "88pm860x-codec", .init = saarb_pm860x_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM, .ops = &saarb_i2s_ops, }, };
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/pxa/spitz.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index bb06048..76288ad 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c @@ -143,18 +143,6 @@ static int spitz_hw_params(struct snd_pcm_substream *substream, break; }
- /* set codec DAI configuration */ - ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - - /* set cpu DAI configuration */ - ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - /* set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, SND_SOC_CLOCK_IN); @@ -313,6 +301,8 @@ static struct snd_soc_dai_link spitz_dai = { .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .init = spitz_wm8750_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, .ops = &spitz_ops, };
On Fri, Dec 30, 2011 at 11:42 PM, Axel Lin axel.lin@gmail.com wrote:
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/pxa/spitz.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index bb06048..76288ad 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c @@ -143,18 +143,6 @@ static int spitz_hw_params(struct snd_pcm_substream *substream, break; }
- /* set codec DAI configuration */
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
- /* set cpu DAI configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
/* set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, SND_SOC_CLOCK_IN); @@ -313,6 +301,8 @@ static struct snd_soc_dai_link spitz_dai = { .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .init = spitz_wm8750_init,
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
.ops = &spitz_ops, };
Acked-by: Haojian Zhuang haojian.zhuang@gmail.com
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/pxa/tavorevb3.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/tavorevb3.c index 4bef12c..46ac1fe 100644 --- a/sound/soc/pxa/tavorevb3.c +++ b/sound/soc/pxa/tavorevb3.c @@ -92,16 +92,6 @@ static int evb3_i2s_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret;
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); - if (ret < 0) - return ret; - - ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); - if (ret < 0) - return ret; - ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); return ret; } @@ -119,6 +109,8 @@ static struct snd_soc_dai_link evb3_dai[] = { .platform_name = "pxa-pcm-audio", .codec_name = "88pm860x-codec", .init = evb3_pm860x_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM, .ops = &evb3_i2s_ops, }, };
On Fri, Dec 30, 2011 at 11:43 PM, Axel Lin axel.lin@gmail.com wrote:
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/pxa/tavorevb3.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/tavorevb3.c index 4bef12c..46ac1fe 100644 --- a/sound/soc/pxa/tavorevb3.c +++ b/sound/soc/pxa/tavorevb3.c @@ -92,16 +92,6 @@ static int evb3_i2s_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret;
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
- if (ret < 0)
- return ret;
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
- if (ret < 0)
- return ret;
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); return ret; } @@ -119,6 +109,8 @@ static struct snd_soc_dai_link evb3_dai[] = { .platform_name = "pxa-pcm-audio", .codec_name = "88pm860x-codec", .init = evb3_pm860x_init,
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBM_CFM,
.ops = &evb3_i2s_ops, }, }; --
Acked-by: Haojian Zhuang haojian.zhuang@gmail.com
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/pxa/z2.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index d6807e0..e8f15ce 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -56,18 +56,6 @@ static int z2_hw_params(struct snd_pcm_substream *substream, break; }
- /* set codec DAI configuration */ - ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - - /* set cpu DAI configuration */ - ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | - SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); - if (ret < 0) - return ret; - /* set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, SND_SOC_CLOCK_IN); @@ -196,6 +184,8 @@ static struct snd_soc_dai_link z2_dai = { .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .init = z2_wm8750_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, .ops = &z2_ops, };
On Fri, Dec 30, 2011 at 11:44 PM, Axel Lin axel.lin@gmail.com wrote:
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/pxa/z2.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index d6807e0..e8f15ce 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -56,18 +56,6 @@ static int z2_hw_params(struct snd_pcm_substream *substream, break; }
- /* set codec DAI configuration */
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
- /* set cpu DAI configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
- if (ret < 0)
- return ret;
/* set the codec system clock for DAC and ADC */ ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, SND_SOC_CLOCK_IN); @@ -196,6 +184,8 @@ static struct snd_soc_dai_link z2_dai = { .platform_name = "pxa-pcm-audio", .codec_name = "wm8750.0-001b", .init = z2_wm8750_init,
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS,
.ops = &z2_ops, };
--
Acked-by: Haojian Zhuang haojian.zhuang@gmail.com
On Fri, Dec 30, 2011 at 11:41 PM, Axel Lin axel.lin@gmail.com wrote:
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/pxa/saarb.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/pxa/saarb.c b/sound/soc/pxa/saarb.c index 2e21712..b2be225 100644 --- a/sound/soc/pxa/saarb.c +++ b/sound/soc/pxa/saarb.c @@ -92,15 +92,6 @@ static int saarb_i2s_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret;
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
- if (ret < 0)
- return ret;
- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
- if (ret < 0)
- return ret;
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width);
return ret; @@ -119,6 +110,8 @@ static struct snd_soc_dai_link saarb_dai[] = { .platform_name = "pxa-pcm-audio", .codec_name = "88pm860x-codec", .init = saarb_pm860x_init,
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBM_CFM,
.ops = &saarb_i2s_ops, }, }; -- 1.7.5.4
Acked-by: Haojian Zhuang haojian.zhuang@gmail.com
On Fri, Dec 30, 2011 at 11:41:54PM +0800, Axel Lin wrote:
Signed-off-by: Axel Lin axel.lin@gmail.com
Applied all, thanks.
participants (3)
-
Axel Lin
-
Haojian Zhuang
-
Mark Brown