linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@ti.com>
To: paul@pwsan.com
Cc: rnayak@ti.com, linux-omap@vger.kernel.org,
	linux-arm-kernel@vger.kernel.org, patches@linaro.org,
	Mike Turquette <mturquette@ti.com>
Subject: [PATCH 01/26] ARM: OMAP: clock: Nuke plat/clock.c & reuse struct clk as clk_hw_omap
Date: Wed, 7 Nov 2012 17:12:36 -0800	[thread overview]
Message-ID: <1352337181-29427-2-git-send-email-mturquette@ti.com> (raw)
In-Reply-To: <1352337181-29427-1-git-send-email-mturquette@ti.com>

From: Rajendra Nayak <rnayak@ti.com>

plat/clock.c which has most of usecounting/locking infrastructure will
be used only for OMAP1 until that is moved to use COMMON clk.

reuse most of what plat/clock.h has while we move to common clk, and
move most of what 'struct clk' was as 'struct clk_hw_omap' which
will then be used to define platform specific parameters.
All usecounting/locking related variables from 'struct clk' are
dropped as they will not be used with 'struct clk_hw_omap'.

Based on the original changes from Mike Turquette.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
---
 arch/arm/mach-omap2/clock.h |   64 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index cfba1ff..1fb9ecb 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -52,6 +52,14 @@ struct omap_clk {
 #define CK_34XX		(CK_3430ES1 | CK_3430ES2PLUS)
 #define CK_3XXX		(CK_34XX | CK_AM35XX | CK_36XX)
 
+#ifdef CONFIG_COMMON_CLK
+#include <linux/clk-provider.h>
+
+struct clockdomain;
+#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
+
+#else
+
 struct module;
 struct clk;
 struct clockdomain;
@@ -89,6 +97,7 @@ struct clkops {
 	void			(*allow_idle)(struct clk *);
 	void			(*deny_idle)(struct clk *);
 };
+#endif
 
 /* struct clksel_rate.flags possibilities */
 #define RATE_IN_242X		(1 << 0)
@@ -228,6 +237,60 @@ struct dpll_data {
 #define INVERT_ENABLE		(1 << 4)	/* 0 enables, 1 disables */
 #define CLOCK_CLKOUTX2		(1 << 5)
 
+#ifdef CONFIG_COMMON_CLK
+/**
+ * struct clk_hw_omap - OMAP struct clk
+ * @node: list_head connecting this clock into the full clock list
+ * @enable_reg: register to write to enable the clock (see @enable_bit)
+ * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
+ * @flags: see "struct clk.flags possibilities" above
+ * @clksel_reg: for clksel clks, register va containing src/divisor select
+ * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
+ * @clksel: for clksel clks, pointer to struct clksel for this clock
+ * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
+ * @clkdm_name: clockdomain name that this clock is contained in
+ * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
+ * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
+ * @src_offset: bitshift for source selection bitfield (OMAP1 only)
+ *
+ * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * clock code converted to use clksel.
+ *
+ */
+
+struct clk_hw_omap_ops;
+
+struct clk_hw_omap {
+	struct clk_hw		hw;
+	struct list_head	node;
+	unsigned long		fixed_rate;
+	u8			fixed_div;
+	void __iomem		*enable_reg;
+	u8			enable_bit;
+	u8			flags;
+	void __iomem		*clksel_reg;
+	u32			clksel_mask;
+	const struct clksel	*clksel;
+	struct dpll_data	*dpll_data;
+	const char		*clkdm_name;
+	struct clockdomain	*clkdm;
+	const struct clk_hw_omap_ops	*ops;
+};
+
+struct clk_hw_omap_ops {
+	void			(*find_idlest)(struct clk_hw_omap *oclk,
+					void __iomem **idlest_reg,
+					u8 *idlest_bit, u8 *idlest_val);
+	void			(*find_companion)(struct clk_hw_omap *oclk,
+					void __iomem **other_reg,
+					u8 *other_bit);
+	void			(*allow_idle)(struct clk_hw_omap *oclk);
+	void			(*deny_idle)(struct clk_hw_omap *oclk);
+};
+
+unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw,
+		unsigned long parent_rate);
+#else
 /**
  * struct clk - OMAP struct clk
  * @node: list_head connecting this clock into the full clock list
@@ -484,4 +547,5 @@ extern struct clk virt_26000000_ck;
 
 extern int am33xx_clk_init(void);
 
+#endif /* CONFIG_COMMON_CLK */
 #endif
-- 
1.7.9.5


  reply	other threads:[~2012-11-08  1:13 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08  1:12 [PATCH v2 00/26] Move OMAP2+ over to common clk framework Mike Turquette
2012-11-08  1:12 ` Mike Turquette [this message]
2012-11-08  1:12 ` [PATCH 02/26] ARM: OMAP: hwmod: Fix up hwmod based clkdm accesses Mike Turquette
2012-11-12 22:15   ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 03/26] ARM: OMAP4: clock: Convert to common clk Mike Turquette
2012-11-12 22:52   ` Paul Walmsley
2012-11-13  2:17   ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 04/26] ARM: OMAP3: " Mike Turquette
2012-11-08  1:12 ` [PATCH 05/26] ARM: OMAP2: " Mike Turquette
2012-11-12 22:16   ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 06/26] ARM: OMAP2xxx: clock: add APLL rate recalculation functions Mike Turquette
2012-11-08  1:12 ` [PATCH 07/26] ARM: OMAP: clock: list all clk_hw_omap clks to enable/disable autoidle Mike Turquette
2012-11-12 23:00   ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 08/26] ARM: OMAP: clock: Define a function to enable clocks at init Mike Turquette
2012-11-12 23:01   ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 09/26] ARM: OMAP2+: hwmod: Invoke init_clkdm before other init functions Mike Turquette
2012-11-08  1:12 ` [PATCH 10/26] ARM: OMAP: clock: Get rid of some clkdm assocations within clks Mike Turquette
2012-11-08  1:12 ` [PATCH 11/26] ARM: OMAP2+: clock: add OMAP CCF convenience macros to mach-omap2/clock.h Mike Turquette
2012-11-08  1:12 ` [PATCH 12/26] ARM: OMAP4: clock: Add 44xx data using common struct clk Mike Turquette
2012-11-13  1:37   ` Paul Walmsley
2012-11-13  2:16     ` Paul Walmsley
2012-11-08  1:12 ` [PATCH 13/26] ARM: AM33XX: clock: add clock data in common clock format Mike Turquette
2012-11-08  1:12 ` [PATCH 16/26] ARM: OMAP: clock: Switch to COMMON clk Mike Turquette
2012-11-08  1:12 ` [PATCH 17/26] ARM: OMAP: hwmod: Cleanup !CONFIG_COMMON_CLK parts Mike Turquette
2012-11-08  1:12 ` [PATCH 18/26] ARM: OMAP4: clock: " Mike Turquette
2012-11-08  1:12 ` [PATCH 20/26] ARM: omap3: " Mike Turquette
2012-11-08  1:12 ` [PATCH 22/26] ARM: AM33xx: clock: drop obsolete clock data Mike Turquette
2012-11-08  1:12 ` [PATCH 23/26] ARM: omap2: clock: Cleanup !CONFIG_COMMON_CLK parts Mike Turquette
2012-11-08  1:13 ` [PATCH 25/26] ARM: OMAP2+: clock: remove unnecessary declarations Mike Turquette
2012-11-08  1:13 ` [PATCH 26/26] ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts Mike Turquette
2012-11-08  1:31 ` [PATCH v2 00/26] Move OMAP2+ over to common clk framework Mike Turquette
2012-11-08  1:42   ` Tony Lindgren
2012-11-08  1:54     ` Mike Turquette
2012-11-08  2:50       ` Paul Walmsley
2012-11-08  5:02 ` Rajendra Nayak
2012-11-08  5:19   ` Mike Turquette
2012-11-08 19:20     ` Kevin Hilman
     [not found] ` <1352337181-29427-15-git-send-email-mturquette@ti.com>
2012-11-08 18:08   ` [PATCH 14/26] ARM: OMAP3: clock: Add 3xxx data using common struct clk Paul Walmsley
2012-11-08 21:52     ` Mike Turquette
2012-11-08 22:01     ` Paul Walmsley
2012-11-09  0:11       ` Paul Walmsley
2012-11-09  0:33         ` Paul Walmsley
2012-11-09  0:49           ` Paul Walmsley
2012-11-09  0:57         ` Mike Turquette
2012-11-08 23:31     ` [PATCH] ARM: OMAP2+: clockdomain: disabling unused clks Mike Turquette
2012-11-09  0:58       ` Paul Walmsley
2012-11-09  1:17         ` Mike Turquette
2012-11-09 19:06           ` Paul Walmsley
2012-11-09 19:08             ` Paul Walmsley
2012-11-09 19:40               ` Mike Turquette
2012-11-09 19:52                 ` Paul Walmsley
2012-11-09 20:53                   ` Paul Walmsley
2012-11-08 19:04 ` [PATCH v2 00/26] Move OMAP2+ over to common clk framework Vaibhav Hiremath
2012-11-09 21:12 ` Paul Walmsley
2012-11-09 22:09   ` Tony Lindgren
2012-11-09 22:18   ` Mike Turquette
2012-11-09 23:47     ` Paul Walmsley
2012-11-12 21:50 ` [PATCH] ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections Paul Walmsley
2012-11-12 22:30   ` Mike Turquette
     [not found] ` <1352337181-29427-16-git-send-email-mturquette@ti.com>
     [not found]   ` <alpine.DEB.2.00.1211081532210.20703@utopia.booyaka.com>
2012-11-09 20:32     ` [PATCH 15/26] ARM: omap2: clock: Add 24xx data using common struct clk Paul Walmsley
2012-11-09 21:05       ` Mike Turquette
2012-11-09 21:22         ` Paul Walmsley
2012-11-09 22:21           ` Mike Turquette
2012-11-12 22:13   ` Paul Walmsley
2012-11-13 13:42 ` [PATCH v2 00/26] Move OMAP2+ over to common clk framework Laurent Pinchart
2012-11-13 16:43   ` Mike Turquette
2012-11-15  0:57     ` Laurent Pinchart

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=1352337181-29427-2-git-send-email-mturquette@ti.com \
    --to=mturquette@ti.com \
    --cc=linux-arm-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    /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).