[alsa-devel] [PATCH 4/7] ASoC: Automatically calculate clock ratio for WM8580

Seungwhan Youn claude.youn at gmail.com
Mon Aug 16 06:16:15 CEST 2010


On Sat, Aug 14, 2010 at 4:35 AM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:

.....

> +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:

    should be  WM8580_DAI_PAIFRX:

Because, WM8580_DAI_PAIFTX --> Capture --> ADC.

> +               sel_mask = 0x3;
> +               sel_shift = 0;
> +               break;
> +
> +       case WM8580_DAI_PAIFRX:  --> TX

    should be  WM8580_DAI_PAIFTX:

Because, WM8580_DAI_PAIFRX --> Playback --> DAC.



> +               sel_mask = 0xc;
> +               sel_shift = 3;

Shouldn't the shift be 2 ?

....

> +       /* We really should validate PLL settings but not yet */
> +       wm8580->sysclk[dai->id] = freq;
> +
> +       return snd_soc_update_bits(codec, WM8580_CLKSEL, sel, sel_mask);

Seems the value and mask arguments are swapped ?

Thanks,
Claude


More information about the Alsa-devel mailing list