alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jassi Brar <jassisinghbrar@gmail.com>
To: Seungwhan Youn <sw.youn@samsung.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Seungwhan Youn <claude.youn@gmail.com>
Subject: Re: [PATCH 1/5] ASoC: wm8580: Add to support ADC clock source setting
Date: Fri, 6 Aug 2010 13:27:48 +0900	[thread overview]
Message-ID: <AANLkTingw3AiJdN1_tahFbmHNWeqMZnb6HB0r=PuK20f@mail.gmail.com> (raw)
In-Reply-To: <1281053897-4675-1-git-send-email-sw.youn@samsung.com>

On Fri, Aug 6, 2010 at 9:18 AM, Seungwhan Youn <sw.youn@samsung.com> wrote:
> This patch adds to support additional ADC clock source setting
> with R8 register for CLKSRC on wm8580.
>
> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
> ---
>  sound/soc/codecs/wm8580.c |   33 +++++++++++++++++++++++++++++++++
>  sound/soc/codecs/wm8580.h |   16 +++++++++-------
>  2 files changed, 42 insertions(+), 7 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
> index c3571ee..e342da5 100644
> --- a/sound/soc/codecs/wm8580.c
> +++ b/sound/soc/codecs/wm8580.c
> @@ -110,6 +110,12 @@
>  #define WM8580_CLKSEL_DAC_CLKSEL_PLLA 0x01
>  #define WM8580_CLKSEL_DAC_CLKSEL_PLLB 0x02
>
> +#define WM8580_CLKSEL_ADC_CLKSEL_MASK     0x0c
> +#define WM8580_CLKSEL_ADC_CLKSEL_ADCMCLK  0x00
> +#define WM8580_CLKSEL_ADC_CLKSEL_PLLA     0x04
> +#define WM8580_CLKSEL_ADC_CLKSEL_PLLB     0x08
> +#define WM8580_CLKSEL_ADC_CLKSEL_MCLK     0x0c
> +
>  /* AIF control 1 (registers 9h-bh) */
>  #define WM8580_AIF_RATE_MASK       0x7
>  #define WM8580_AIF_RATE_128        0x0
> @@ -672,6 +678,33 @@ static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
>                snd_soc_write(codec, WM8580_PLLB4, reg);
>                break;
>
> +       case WM8580_ADC_CLKSEL:
> +               reg = snd_soc_read(codec, WM8580_CLKSEL);
> +               reg &= ~WM8580_CLKSEL_ADC_CLKSEL_MASK;
> +
> +               switch (div) {
> +               case WM8580_CLKSRC_ADCMCLK:
> +                       reg |= WM8580_CLKSEL_ADC_CLKSEL_ADCMCLK;
> +                       break;
> +
> +               case WM8580_CLKSRC_MCLK:
> +                       reg |= WM8580_CLKSEL_ADC_CLKSEL_MCLK;
> +                       break;
> +
> +               case WM8580_CLKSRC_PLLA:
> +                       reg |= WM8580_CLKSEL_ADC_CLKSEL_PLLA;
> +                       break;
> +
> +               case WM8580_CLKSRC_PLLB:
> +                       reg |= WM8580_CLKSEL_ADC_CLKSEL_PLLB;
> +                       break;
> +
> +               default:
> +                       return -EINVAL;
> +               }
> +               snd_soc_write(codec, WM8580_CLKSEL, reg);
> +               break;
> +
>        default:
>                return -EINVAL;
>        }
> diff --git a/sound/soc/codecs/wm8580.h b/sound/soc/codecs/wm8580.h
> index 0dfb5dd..aeb65ef 100644
> --- a/sound/soc/codecs/wm8580.h
> +++ b/sound/soc/codecs/wm8580.h
> @@ -20,13 +20,15 @@
>
>  #define WM8580_MCLK       1
>  #define WM8580_DAC_CLKSEL 2
> -#define WM8580_CLKOUTSRC  3
> -
> -#define WM8580_CLKSRC_MCLK 1
> -#define WM8580_CLKSRC_PLLA 2
> -#define WM8580_CLKSRC_PLLB 3
> -#define WM8580_CLKSRC_OSC  4
> -#define WM8580_CLKSRC_NONE 5
> +#define WM8580_ADC_CLKSEL 3
> +#define WM8580_CLKOUTSRC  4
> +
> +#define WM8580_CLKSRC_MCLK    1
> +#define WM8580_CLKSRC_ADCMCLK 2
> +#define WM8580_CLKSRC_PLLA    3
> +#define WM8580_CLKSRC_PLLB    4
> +#define WM8580_CLKSRC_OSC     5
> +#define WM8580_CLKSRC_NONE    6
>
>  #define WM8580_DAI_PAIFRX 0
>  #define WM8580_DAI_PAIFTX 1

This is OK. Though I don't remember why it wasn't accepted when
I submitted a few months ago.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2010-08-06  4:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06  0:13 [PATCH 0/5] ASoC: Fix smdk64xx-wm8580 problems Seungwhan Youn
2010-08-06  0:18 ` [PATCH 1/5] ASoC: wm8580: Add to support ADC clock source setting Seungwhan Youn
2010-08-06  4:27   ` Jassi Brar [this message]
2010-08-06 10:19     ` Mark Brown
2010-08-08  1:15       ` Jassi Brar
2010-08-06  0:21 ` [PATCH 2/5] ASoC: S3C64XX: Add ADC source clock setting Seungwhan Youn
2010-08-06 10:26   ` Mark Brown
2010-08-06 16:28     ` Seungwhan Youn
2010-08-06 16:49       ` Mark Brown
2010-08-06 17:00         ` Seungwhan Youn
2010-08-06  0:26 ` [PATCH 3/5] ASoC: wm8580: Fix Master Mode BCLK rates names Seungwhan Youn
2010-08-06  0:32 ` [PATCH 4/5] ASoC: wm8580: Add to support Master Mode Rates Seungwhan Youn
2010-08-06  4:32   ` Jassi Brar
2010-08-06  5:54     ` Seungwhan Youn
2010-08-06  0:36 ` [PATCH 5/5] ASoC: S3C64XX: Fix to support BCLK, LRCLK rates setting Seungwhan Youn
2010-08-06  4:25   ` Jassi Brar
2010-08-06  6:02     ` Seungwhan Youn
2010-08-06 11:17       ` Mark Brown
2010-08-06 16:26         ` Seungwhan Youn

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='AANLkTingw3AiJdN1_tahFbmHNWeqMZnb6HB0r=PuK20f@mail.gmail.com' \
    --to=jassisinghbrar@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=claude.youn@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).