linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/18] ARM: S5PV210: Add 'clock source gate' clock definitions
Date: Mon, 17 May 2010 02:09:20 +0100	[thread overview]
Message-ID: <20100517010920.GW6684@trinity.fluff.org> (raw)
In-Reply-To: <1274056745-14746-1-git-send-email-kgene.kim@samsung.com>

On Mon, May 17, 2010 at 09:39:05AM +0900, Kukjin Kim wrote:
> From: Thomas Abraham <thomas.ab@samsung.com>
> 
> The non-glitch-free clock muxes can suffer from glitches when changing
> clock sources. It is recommended to disable the output of non-glitch-
> free muxes before trying to change the clock source. After clock change
> is complete, the non-glitch-free clock can be re-enabled.
> 
> These clocks are added to the list of clocks to be enabled at boot time.
> Device drivers that need to disable the non-glitch-free mux output clock
> can 'clk_get' these clocks, disable them, change the clock selection
> of the mux and then re-enable the non-glitch-free mux output.

Hmm, this is something we may have to get into the clock layer itself
and keep away from the drivers involved. Can these clocks be hard connected
to their sources?

At least putting some form of comment in with the clock addition to note
that there is this problem would be useful.

> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/mach-s5pv210/clock.c |  140 +++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 140 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
> index 154bca4..a2c3ab5 100644
> --- a/arch/arm/mach-s5pv210/clock.c
> +++ b/arch/arm/mach-s5pv210/clock.c
> @@ -183,6 +183,11 @@ static int s5pv210_clk_mask0_ctrl(struct clk *clk, int enable)
>  	return s5p_gatectrl(S5P_CLK_SRC_MASK0, clk, enable);
>  }
>  
> +static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable)
> +{
> +	return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable);
> +}
> +
>  static struct clk clk_sclk_hdmi27m = {
>  	.name		= "sclk_hdmi27m",
>  	.id		= -1,
> @@ -448,6 +453,141 @@ static struct clk init_clocks[] = {
>  		.parent		= &clk_pclk_psys.clk,
>  		.enable		= s5pv210_clk_ip3_ctrl,
>  		.ctrlbit	= (1<<10),
> +	}, {
> +		.name		= "mout_hdmi",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 0),
> +	}, {
> +		.name		= "mout_mixer",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 1),
> +	}, {
> +		.name		= "mout_dac",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 2),
> +	}, {
> +		.name		= "mout_cam",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 3),
> +	}, {
> +		.name		= "mout_cam",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 4),
> +	}, {
> +		.name		= "mout_fimd",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 5),
> +	}, {
> +		.name		= "mout_csis",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 6),
> +	}, {
> +		.name		= "mout_finvpll",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 7),
> +	}, {
> +		.name		= "mout_mmc",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 8),
> +	}, {
> +		.name		= "mout_mmc",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 9),
> +	}, {
> +		.name		= "mout_mmc",
> +		.id		= 2,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 10),
> +	}, {
> +		.name		= "mout_mmc",
> +		.id		= 3,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 11),
> +	}, {
> +		.name		= "mout_uart",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 12),
> +	}, {
> +		.name		= "mout_uart",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 13),
> +	}, {
> +		.name		= "mout_uart",
> +		.id		= 2,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 14),
> +	}, {
> +		.name		= "mout_uart",
> +		.id		= 3,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 15),
> +	}, {
> +		.name		= "mout_spi",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 16),
> +	}, {
> +		.name		= "mout_spi",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 17),
> +	}, {
> +		.name		= "mout_pwm",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 19),
> +	}, {
> +		.name		= "mout_audio",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 24),
> +	}, {
> +		.name		= "mout_audio",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 25),
> +	}, {
> +		.name		= "mout_audio",
> +		.id		= 2,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 26),
> +	}, {
> +		.name		= "mout_spdif",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 27),
> +	}, {
> +		.name		= "mout_pwi",
> +		.id		= -1,
> +		.enable		= s5pv210_clk_mask0_ctrl,
> +		.ctrlbit	= (1 << 29),
> +	}, {
> +		.name		= "mout_fimc",
> +		.id		= 0,
> +		.enable		= s5pv210_clk_mask1_ctrl,
> +		.ctrlbit	= (1 << 2),
> +	}, {
> +		.name		= "mout_fimc",
> +		.id		= 1,
> +		.enable		= s5pv210_clk_mask1_ctrl,
> +		.ctrlbit	= (1 << 3),
> +	}, {
> +		.name		= "mout_fimc",
> +		.id		= 2,
> +		.enable		= s5pv210_clk_mask1_ctrl,
> +		.ctrlbit	= (1 << 4),
>  	},
>  };
>  
> -- 
> 1.6.2.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

      reply	other threads:[~2010-05-17  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17  0:39 [PATCH 17/18] ARM: S5PV210: Add 'clock source gate' clock definitions Kukjin Kim
2010-05-17  1:09 ` Ben Dooks [this message]

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=20100517010920.GW6684@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --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).