All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seungwhan Youn <claude.youn@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Seungwhan Youn <sw.youn@samsung.com>,
	alsa-devel@alsa-project.org,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 4/7] ASoC: Automatically calculate clock ratio for WM8580
Date: Sun, 15 Aug 2010 18:00:50 +0900	[thread overview]
Message-ID: <AANLkTi=6Op9C3adxhN8HsZu9FewFYqeCWRoQs=P3LP18@mail.gmail.com> (raw)
In-Reply-To: <1281728107-25386-4-git-send-email-broonie@opensource.wolfsonmicro.com>

On Sat, Aug 14, 2010 at 4:35 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> Implement set_sysclk() and then rather than assuming 256fs use the
> supplied value to calculate and configure the clock ratio for the
> currently used sample rate. As a side effect we also end up
> implementing clock selection for the ADC path.
>
> In order to avoid confusion remove the existing set_clkdiv() based
> configuration of the clock source for the DAC and update the SMDK64xx
> driver (which is the only in-tree user of the CODEC).
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/codecs/wm8580.c           |  101 +++++++++++++++++++++++++++--------
>  sound/soc/codecs/wm8580.h           |   14 +++---
>  sound/soc/s3c24xx/smdk64xx_wm8580.c |    9 ++--
>  3 files changed, 90 insertions(+), 34 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
> index 9964f02..3d7ff55 100644
> --- a/sound/soc/codecs/wm8580.c
> +++ b/sound/soc/codecs/wm8580.c

(snip)

> @@ -666,6 +672,55 @@ static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
>        return 0;
>  }
>
> +static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
> +                            unsigned int freq, int dir)
> +{
> +       struct snd_soc_codec *codec = dai->codec;
> +       struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
> +       int sel, sel_mask, sel_shift;
> +
> +       switch (dai->driver->id) {
> +       case WM8580_DAI_PAIFTX:
> +               sel_mask = 0x3;
> +               sel_shift = 0;
> +               break;
> +
> +       case WM8580_DAI_PAIFRX:
> +               sel_mask = 0xc;
> +               sel_shift = 3;
> +               break;

These CLKSEL settings looks different with my WM8580 datasheet
(released March 2009, Rev 4.7).
I think these codes look...
+       case WM8580_DAI_PAIFRX:
+               sel_mask = 0x3;
+               sel_shift = 0;
+               break;
+
+       case WM8580_DAI_PAIFTX:
+               sel_mask = 0xc;
+               sel_shift = 2;
+               break;


> +
> +       default:
> +               BUG_ON("Unknown DAI driver ID\n");
> +               return -EINVAL;
> +       }
> +
> +       switch (clk_id) {
> +       case WM8580_CLKSRC_ADCMCLK:
> +               if (dai->id != WM8580_DAI_PAIFTX)
> +                       return -EINVAL;
> +               sel = 0 << sel_shift;
> +               break;

During my test case with smdk6410 board, clock source of ADC should be
set by ADCMCLK, if we want to hear a correct sound on playback and
capture. And when ADC select MCLK or PLLA, source clock was broken
both of playback and capture.
Can you verify this(set source clock of ADC set to ADCMCLK) is right
or is there something missing on other settings?

> +       case WM8580_CLKSRC_PLLA:
> +               sel = 1 << sel_shift;
> +               break;
> +       case WM8580_CLKSRC_PLLB:
> +               sel = 2 << sel_shift;
> +               break;
> +       case WM8580_CLKSRC_MCLK:
> +               sel = 3 << sel_shift;
> +               break;
> +       default:
> +               dev_err(codec->dev, "Unknown clock %d\n", clk_id);
> +               return -EINVAL;
> +       }
> +

(snip)

>
> --
> 1.7.1
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

Thanks,

Claude
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2010-08-15  9:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 19:33 [PATCH 0/7] WM8580 updates Mark Brown
2010-08-13 19:35 ` [PATCH 1/7] ASoC: Add a bit of resource unwinding in the S3C IISv4 driver Mark Brown
2010-08-13 19:35 ` [PATCH 2/7] ASoC: Convert WM8580 hw_params to use snd_soc_update_bits() Mark Brown
2010-08-13 19:35 ` [PATCH 3/7] ASoC: Remove unused rate selection bitmasks from WM8580 Mark Brown
2010-08-13 19:35 ` [PATCH 4/7] ASoC: Automatically calculate clock ratio for WM8580 Mark Brown
2010-08-15  9:00   ` Seungwhan Youn [this message]
2010-08-15 11:09     ` Mark Brown
2010-08-16  4:36       ` Jassi Brar
2010-08-16 10:20         ` Mark Brown
2010-08-16 12:51           ` Jassi Brar
2010-08-16 15:19             ` Mark Brown
2010-08-16 23:14               ` Jassi Brar
2010-08-17  9:46                 ` Mark Brown
2010-08-31  6:46                   ` Jassi Brar
2010-08-31 10:42                     ` Mark Brown
2010-08-16  4:16   ` Seungwhan Youn
2010-08-16 12:21     ` Mark Brown
2010-08-16 12:47       ` Jassi Brar
2010-08-13 19:35 ` [PATCH 5/7] ASoC: Implement BCLK rate selection " Mark Brown
2010-08-13 19:35 ` [PATCH 6/7] ASoC: Fix inverted WM8580 capture mute control Mark Brown
2010-08-15  4:50   ` Seungwhan Youn
2010-08-15  6:20     ` Seungwhan Youn
2010-08-13 19:35 ` [PATCH 7/7] ASoC: Automatically manage WM8580 DAC OSR Mark Brown
2010-08-14  4:09 ` [PATCH 0/7] WM8580 updates Jassi Brar
2010-08-15  9:21   ` Seungwhan Youn
2010-08-15 11:10     ` Mark Brown
2010-08-16  9:44       ` Seungwhan Youn
2010-08-16 14:49         ` Mark Brown
2010-08-19 11:37           ` Seungwhan Youn
2010-08-14 10:45 ` Liam Girdwood

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='AANLkTi=6Op9C3adxhN8HsZu9FewFYqeCWRoQs=P3LP18@mail.gmail.com' \
    --to=claude.youn@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=sw.youn@samsung.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 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.