* [PATCH] ASoC: pandora: fix CLKX polarity
@ 2010-06-17 13:45 Grazvydas Ignotas
2010-06-21 16:59 ` Liam Girdwood
0 siblings, 1 reply; 3+ messages in thread
From: Grazvydas Ignotas @ 2010-06-17 13:45 UTC (permalink / raw)
To: alsa-devel; +Cc: broonie, Grazvydas Ignotas, lrg
After mass production started it was found that several boards exhibit
noise problems during sound playback. After some investigation it was
determined that CLKX polarity is set incorrectly, and even if most boards
can tolerate the wrong setting, there are some that don't.
Fix polarity setup in the board file. As the clock settings for input and
output now match, merge in and out functions and structures to simplify
code.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
sound/soc/omap/omap3pandora.c | 36 ++++++++----------------------------
1 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 87ce842..9eecac1 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -43,12 +43,14 @@
static struct regulator *omap3pandora_dac_reg;
-static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params, unsigned int fmt)
+static int omap3pandora_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 *codec_dai = rtd->dai->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ int fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_CBS_CFS;
int ret;
/* Set codec DAI configuration */
@@ -91,24 +93,6 @@ static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- return omap3pandora_cmn_hw_params(substream, params,
- SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_IB_NF |
- SND_SOC_DAIFMT_CBS_CFS);
-}
-
-static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
-{
- return omap3pandora_cmn_hw_params(substream, params,
- SND_SOC_DAIFMT_I2S |
- SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS);
-}
-
static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
@@ -231,12 +215,8 @@ static int omap3pandora_in_init(struct snd_soc_codec *codec)
return snd_soc_dapm_sync(codec);
}
-static struct snd_soc_ops omap3pandora_out_ops = {
- .hw_params = omap3pandora_out_hw_params,
-};
-
-static struct snd_soc_ops omap3pandora_in_ops = {
- .hw_params = omap3pandora_in_hw_params,
+static struct snd_soc_ops omap3pandora_ops = {
+ .hw_params = omap3pandora_hw_params,
};
/* Digital audio interface glue - connects codec <--> CPU */
@@ -246,14 +226,14 @@ static struct snd_soc_dai_link omap3pandora_dai[] = {
.stream_name = "HiFi Out",
.cpu_dai = &omap_mcbsp_dai[0],
.codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
- .ops = &omap3pandora_out_ops,
+ .ops = &omap3pandora_ops,
.init = omap3pandora_out_init,
}, {
.name = "TWL4030",
.stream_name = "Line/Mic In",
.cpu_dai = &omap_mcbsp_dai[1],
.codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
- .ops = &omap3pandora_in_ops,
+ .ops = &omap3pandora_ops,
.init = omap3pandora_in_init,
}
};
--
1.6.3.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: pandora: fix CLKX polarity
2010-06-17 13:45 [PATCH] ASoC: pandora: fix CLKX polarity Grazvydas Ignotas
@ 2010-06-21 16:59 ` Liam Girdwood
0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2010-06-21 16:59 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: alsa-devel, broonie
On Thu, 2010-06-17 at 16:45 +0300, Grazvydas Ignotas wrote:
> After mass production started it was found that several boards exhibit
> noise problems during sound playback. After some investigation it was
> determined that CLKX polarity is set incorrectly, and even if most boards
> can tolerate the wrong setting, there are some that don't.
>
> Fix polarity setup in the board file. As the clock settings for input and
> output now match, merge in and out functions and structures to simplify
> code.
>
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> sound/soc/omap/omap3pandora.c | 36 ++++++++----------------------------
> 1 files changed, 8 insertions(+), 28 deletions(-)
>
Applied.
Thanks
Liam
--
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: pandora: fix CLKX polarity
@ 2010-06-17 15:50 Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-06-17 15:50 UTC (permalink / raw)
To: Grazvydas Ignotas, alsa-devel; +Cc: lrg
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Probably best to add a CC to stable too. Sorry about the rubbish formatting, on my phone and it can't do any better.
Grazvydas Ignotas <notasas@gmail.com> wrote:
>After mass production started it was found that several boards exhibit
>noise problems during sound playback. After some investigation it was
>determined that CLKX polarity is set incorrectly, and even if most boards
>can tolerate the wrong setting, there are some that don't.
>
>Fix polarity setup in the board file. As the clock settings for input and
>output now match, merge in and out functions and structures to simplify
>code.
>
>Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
>---
> sound/soc/omap/omap3pandora.c | 36 ++++++++----------------------------
> 1 files changed, 8 insertions(+), 28 deletions(-)
>
>diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
>index 87ce842..9eecac1 100644
>--- a/sound/soc/omap/omap3pandora.c
>+++ b/sound/soc/omap/omap3pandora.c
>@@ -43,12 +43,14 @@
>
> static struct regulator *omap3pandora_dac_reg;
>
>-static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
>- struct snd_pcm_hw_params *params, unsigned int fmt)
>+static int omap3pandora_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 *codec_dai = rtd->dai->codec_dai;
> struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
>+ int fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
>+ SND_SOC_DAIFMT_CBS_CFS;
> int ret;
>
> /* Set codec DAI configuration */
>@@ -91,24 +93,6 @@ static int omap3pandora_cmn_hw_params(struct snd_pcm_substream *substream,
> return 0;
> }
>
>-static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
>- struct snd_pcm_hw_params *params)
>-{
>- return omap3pandora_cmn_hw_params(substream, params,
>- SND_SOC_DAIFMT_I2S |
>- SND_SOC_DAIFMT_IB_NF |
>- SND_SOC_DAIFMT_CBS_CFS);
>-}
>-
>-static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream,
>- struct snd_pcm_hw_params *params)
>-{
>- return omap3pandora_cmn_hw_params(substream, params,
>- SND_SOC_DAIFMT_I2S |
>- SND_SOC_DAIFMT_NB_NF |
>- SND_SOC_DAIFMT_CBS_CFS);
>-}
>-
> static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
> struct snd_kcontrol *k, int event)
> {
>@@ -231,12 +215,8 @@ static int omap3pandora_in_init(struct snd_soc_codec *codec)
> return snd_soc_dapm_sync(codec);
> }
>
>-static struct snd_soc_ops omap3pandora_out_ops = {
>- .hw_params = omap3pandora_out_hw_params,
>-};
>-
>-static struct snd_soc_ops omap3pandora_in_ops = {
>- .hw_params = omap3pandora_in_hw_params,
>+static struct snd_soc_ops omap3pandora_ops = {
>+ .hw_params = omap3pandora_hw_params,
> };
>
> /* Digital audio interface glue - connects codec <--> CPU */
>@@ -246,14 +226,14 @@ static struct snd_soc_dai_link omap3pandora_dai[] = {
> .stream_name = "HiFi Out",
> .cpu_dai = &omap_mcbsp_dai[0],
> .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
>- .ops = &omap3pandora_out_ops,
>+ .ops = &omap3pandora_ops,
> .init = omap3pandora_out_init,
> }, {
> .name = "TWL4030",
> .stream_name = "Line/Mic In",
> .cpu_dai = &omap_mcbsp_dai[1],
> .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
>- .ops = &omap3pandora_in_ops,
>+ .ops = &omap3pandora_ops,
> .init = omap3pandora_in_init,
> }
> };
>--
>1.6.3.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-21 16:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-17 13:45 [PATCH] ASoC: pandora: fix CLKX polarity Grazvydas Ignotas
2010-06-21 16:59 ` Liam Girdwood
-- strict thread matches above, loose matches on Subject: below --
2010-06-17 15:50 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.