[PATCH 03/10] S3C64XX I2S: Codec Clock Gating Option

jassi brar jassisinghbrar at gmail.com
Wed Sep 16 19:59:00 EDT 2009


On Thu, Sep 17, 2009 at 5:12 AM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
> On Wed, Sep 16, 2009 at 12:02:46PM +0100, Mark Brown wrote:
>
>> There's no meaningful extra effort required to do this properly and
>> given that all this patch does is implement an external interface it's
>> better to just get it right rather than spend the effort on fixups (and
>> merge issues).
>
> I added the following patch to implement this, not tested yet.
>
> From 8bb014895547eeeb9aa61a654f24e41e15919304 Mon Sep 17 00:00:00 2001
> From: Mark Brown <broonie at opensource.wolfsonmicro.com>
> Date: Wed, 16 Sep 2009 19:38:53 +0100
> Subject: [PATCH] ASoC: Add S3C64xx IIS CDCLK source selection
>
> CDCLK can either be an output generated by the CPU, intended for use
> as the CODEC master clock, or an input (probably from the CODEC)
> providing a master clock for the IIS block.
>
> Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
> ---
>  arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h |    2 ++
>  sound/soc/s3c24xx/s3c64xx-i2s.c                   |   13 +++++++++++++
>  sound/soc/s3c24xx/s3c64xx-i2s.h                   |    1 +
>  3 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
> index 07659da..abf2fbc 100644
> --- a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
> +++ b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
> @@ -67,6 +67,8 @@
>  #define S3C2412_IISMOD_BCLK_MASK       (3 << 1)
>  #define S3C2412_IISMOD_8BIT            (1 << 0)
>
> +#define S3C64XX_IISMOD_CDCLKCON                (1 << 12)
> +
>  #define S3C2412_IISPSR_PSREN           (1 << 15)
>
>  #define S3C2412_IISFIC_TXFLUSH         (1 << 15)
> diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
> index 3c06c40..aaf4520 100644
> --- a/sound/soc/s3c24xx/s3c64xx-i2s.c
> +++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
> @@ -99,6 +99,19 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
>                iismod |= S3C64XX_IISMOD_IMS_SYSMUX;
>                break;
>
> +       case S3C64XX_CLKSRC_CDCLK:
> +               switch (dir) {
> +               case SND_SOC_CLOCK_IN:
> +                       iismod |= S3C64XX_IISMOD_CDCLKCON;
> +                       break;
> +               case SND_SOC_CLOCK_OUT:
> +                       iismod &= ~S3C64XX_IISMOD_CDCLKCON;
> +                       break;
> +               default:
> +                       return -EINVAL;
> +               }
> +               break;
> +
>        default:
>                return -EINVAL;
>        }
oops, all along i had misunderstood ur suggestion. This seems fine.



More information about the linux-arm-kernel mailing list