linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/10] S3C64XX I2S: Codec Clock Gating Option
Date: Tue, 15 Sep 2009 11:44:17 +0100	[thread overview]
Message-ID: <20090915104417.GF22878@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1253008955-10505-1-git-send-email-jassi.brar@samsung.com>

On Tue, Sep 15, 2009 at 07:02:35PM +0900, Jassi wrote:
> In SoC-Master mode, CODCLK maybe gated out as MCLK of the CODEC.
> In SoC-Slave mode, CODCLK needs to be cut-off from PAD inorder
> to avoid collision with MCLK from CODEC.
> Option to gate/block CODCLK is implemented in this patch.

Just to confuse matters the datasheet appears to use both CODCLK and
CDCLK to refer to the same signal (as far as I can tell, anyway -
there's only a couple of references to CODCLK).  The drivers are
currently using CDCLK as the name, it'd be better to stick with just
one.

In terms of functionality it might be clearer to describe what's going
on here as switching the function of CDCLK from being an input to being
an output.  The actual implementation appears to be done by gating the
output of the internal clock signal to the CDCLK pin but in terms of
what the user can see externally the clock isn't gated, it's still
active but it changed direction.

> +#define S3C64XX_IISMOD_CDCLK_EXT	(1 << 12)
> +

The datasheet calls this bit CDLKCON - it'd be better to preserve that
naming unless there is a good reason to diverge?

> @@ -99,6 +99,14 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
>  		iismod |= S3C64XX_IISMOD_IMS_SYSMUX;
>  		break;
>  
> +	case S3C64XX_CODCLKSRC_INT:
> +		iismod &= ~S3C64XX_IISMOD_CDCLK_EXT;
> +		break;
> +
> +	case S3C64XX_CODCLKSRC_EXT:
> +		iismod |= S3C64XX_IISMOD_CDCLK_EXT;
> +		break;
> +

This should really be done using the direction parameter - clk_id should
specify that CDCLK should be used and the direction parameter be used to
say if it's an input or output.

Ideally this would also be more joined up with the rest of the
configuration so the machine driver could just specify the master clock
for the IIS block and have all the clock switching (the system
controller mux and IMS) updated appropriately.  That should make it
easier for users to set up the clocking since they don't need to worry
about the implementation details of the IIS block.

  reply	other threads:[~2009-09-15 10:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 10:02 [PATCH 03/10] S3C64XX I2S: Codec Clock Gating Option Jassi
2009-09-15 10:44 ` Mark Brown [this message]
2009-09-16  1:37   ` jassi brar
2009-09-16 11:02     ` Mark Brown
2009-09-16 20:12       ` Mark Brown
2009-09-16 23:59         ` jassi brar

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=20090915104417.GF22878@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).