[alsa-devel] [PATCH V3] ASoC: SAMSUNG: Add quirk to support Exynos4 PCM audio

Jassi Brar jassisinghbrar at gmail.com
Thu Apr 28 08:15:31 CEST 2011


On Thu, Apr 28, 2011 at 10:39 AM, Sangbeom Kim <sbkim73 at samsung.com> wrote:

> @@ -10,7 +10,6 @@
>  * it under the terms of the GNU General Public License version 2 as
>  * published by the Free Software Foundation.
>  */
> -
>  #include <linux/clk.h>
>  #include <linux/io.h>

Please avoid null changes.


> @@ -299,25 +299,34 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
>
>        spin_lock_irqsave(&pcm->lock, flags);
>
> -       /* Get hold of the PCMSOURCE_CLK */
> -       clkctl = readl(regs + S3C_PCM_CLKCTL);
> -       if (clkctl & S3C_PCM_CLKCTL_SERCLKSEL_PCLK)
> -               clk = pcm->pclk;
> -       else
> +       if (pcm->quirks == QUIRK_NO_DIV) {
>                clk = pcm->cclk;
> +               if (clk_get_rate(clk) != (pcm->sclk_per_fs*params_rate(params))) {
> +                       clk_set_rate(clk, pcm->sclk_per_fs*params_rate(params));
> +               }
> +               sync_div = clk_get_rate(clk)/(params_rate(params))-1;

The sync_div assignment is essentially unchanged. See below..


> -       /* Set the SYNC divider */
> -       sync_div = pcm->sclk_per_fs - 1;
> +               sync_div = pcm->sclk_per_fs - 1;
> +       }

so this could be moved outside of the if-else block as common code.


> @@ -330,7 +339,6 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
>        dev_dbg(pcm->dev, "PCMSOURCE_CLK-%lu SCLK=%ufs SCLK_DIV=%d SYNC_DIV=%d\n",
>                                clk_get_rate(clk), pcm->sclk_per_fs,
>                                sclk_div, sync_div);
> -
>        return 0;
>  }

Again, this is not needed.


I know I should have pointed these out earlier to avoid unnecessary
revision. My apologies.


More information about the Alsa-devel mailing list