From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] Add a common struct clk
Date: Tue, 11 Jan 2011 11:16:36 +0100 [thread overview]
Message-ID: <20110111101636.GF26617@pengutronix.de> (raw)
In-Reply-To: <1294199462.348449.192344022926.1.gpush@pororo>
On Wed, Jan 05, 2011 at 11:51:02AM +0800, Jeremy Kerr wrote:
> diff --git a/kernel/clk.c b/kernel/clk.c
> new file mode 100644
> index 0000000..8de8fe3
> --- /dev/null
> +++ b/kernel/clk.c
> @@ -0,0 +1,102 @@
> +/*
> + * Copyright (C) 2010 Canonical Ltd <jeremy.kerr@canonical.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * Standard functionality for the common clock API.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/module.h>
> +
...
> +
> +int clk_set_parent(struct clk *clk, struct clk *parent)
> +{
> + if (clk->ops->set_parent)
> + return clk->ops->set_parent(clk, parent);
> + return -ENOSYS;
> +}
> +EXPORT_SYMBOL_GPL(clk_set_parent);
The i.MX clk implementation disables the old parent if clk is enabled
and enables the new parent if clk is enabled (modulo bugs). Shouldn't
we do this here aswell? Otherwise at least the enable_count of both the
old and the new parent will be wrong after calling clk_set_parent for an
enabled clk.
I thought about returning -EBUSY if clk_set_parent is called for an
enabled clk, but this way we could never reparent the cpu clock which I
think is done in the Freescale BSP for power saving.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2011-01-11 10:16 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 3:51 [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-05 3:51 ` [PATCH 2/2] clk: Generic support for fixed-rate clocks Jeremy Kerr
2011-01-05 3:51 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2011-01-06 16:07 ` Richard Cochran
2011-01-06 20:11 ` Uwe Kleine-König
2011-01-07 0:10 ` Jeremy Kerr
2011-01-07 0:32 ` Russell King - ARM Linux
2011-01-07 9:40 ` Uwe Kleine-König
2011-01-08 13:15 ` Sascha Hauer
2011-01-10 2:43 ` Jeremy Kerr
2011-01-10 10:41 ` Sascha Hauer
2011-01-10 11:00 ` Russell King - ARM Linux
2011-01-11 0:54 ` Jeremy Kerr
2011-01-16 7:26 ` Grant Likely
2011-01-16 20:41 ` Ryan Mallon
2011-01-16 21:07 ` Uwe Kleine-König
2011-01-16 21:39 ` Ryan Mallon
2011-01-11 10:16 ` Sascha Hauer [this message]
2011-01-11 10:27 ` Jeremy Kerr
2011-01-11 11:22 ` Sascha Hauer
2011-01-18 8:44 ` Paul Mundt
2011-01-18 9:21 ` Sascha Hauer
2011-01-18 9:23 ` Paul Mundt
2011-01-18 12:21 ` Russell King - ARM Linux
2011-01-05 3:55 ` [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-07 1:33 ` Ben Dooks
2011-01-07 9:49 ` Uwe Kleine-König
-- strict thread matches above, loose matches on Subject: below --
2011-03-03 6:40 [PATCH 0/2] Common struct clk implementation, v14 Jeremy Kerr
2011-03-03 6:40 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2011-04-14 12:49 ` Tony Lindgren
2011-02-21 2:50 [PATCH 0/2] Common struct clk implementation, v13 Jeremy Kerr
2011-02-21 2:50 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2011-02-22 20:17 ` Uwe Kleine-König
2011-02-23 2:49 ` Jeremy Kerr
2011-01-05 3:18 [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-05 3:18 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-12-08 2:08 [PATCH 0/2] Common struct clk implementation, v8 Jeremy Kerr
2010-12-08 2:08 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-12-08 2:05 Jeremy Kerr
2010-12-08 10:21 ` Uwe Kleine-König
2010-12-10 1:58 ` Jeremy Kerr
2010-12-10 9:21 ` Uwe Kleine-König
2010-07-12 2:37 [PATCH 0/2] Common struct clk implementation, v6 Jeremy Kerr
2010-07-12 2:37 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-06-21 5:35 [PATCH 0/2] Common struct clk implementation, v5 Jeremy Kerr
2010-06-21 5:35 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-06-22 4:43 ` Baruch Siach
2010-07-05 2:33 ` MyungJoo Ham
2010-07-12 2:19 ` Jeremy Kerr
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=20110111101636.GF26617@pengutronix.de \
--to=s.hauer@pengutronix.de \
--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).