All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/10] OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases
Date: Fri, 01 Oct 2010 15:34:59 -0600	[thread overview]
Message-ID: <20101001213454.1408.22112.stgit@twilight.localdomain> (raw)
In-Reply-To: <20101001213119.1408.65395.stgit@twilight.localdomain>

Add the MCBSP_CLKS clock and the clksel structures needed to support clock
framework-based source switching for McBSP 1 and 2.  Also, add clkdev
aliases on the parent clocks for the McBSP source switching code, added
in a subsequent patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/clock2420_data.c |   40 ++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 5f2066a..7086fe4 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -18,6 +18,7 @@
 #include <linux/list.h>
 
 #include <plat/clkdev_omap.h>
+#include <plat/control.h>
 
 #include "clock.h"
 #include "clock2xxx.h"
@@ -89,6 +90,12 @@ static struct clk alt_ck = {		/* Typical 54M or 48M, may not exist */
 	.clkdm_name	= "wkup_clkdm",
 };
 
+/* Optional external clock input for McBSP CLKS */
+static struct clk mcbsp_clks = {
+	.name		= "mcbsp_clks",
+	.ops		= &clkops_null,
+};
+
 /*
  * Analog domain root source clocks
  */
@@ -1135,14 +1142,34 @@ static struct clk mcbsp1_ick = {
 	.recalc		= &followparent_recalc,
 };
 
+static const struct clksel_rate common_mcbsp_96m_rates[] = {
+	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
+	{ .div = 0 }
+};
+
+static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
+	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
+	{ .div = 0 }
+};
+
+static const struct clksel mcbsp_fck_clksel[] = {
+	{ .parent = &func_96m_ck,  .rates = common_mcbsp_96m_rates },
+	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
+	{ .parent = NULL }
+};
+
 static struct clk mcbsp1_fck = {
 	.name		= "mcbsp1_fck",
 	.ops		= &clkops_omap2_dflt_wait,
 	.parent		= &func_96m_ck,
+	.init		= &omap2_init_clksel_parent,
 	.clkdm_name	= "core_l4_clkdm",
 	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
 	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
-	.recalc		= &followparent_recalc,
+	.clksel_reg	= OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+	.clksel_mask	= OMAP2_MCBSP1_CLKS_MASK,
+	.clksel		= mcbsp_fck_clksel,
+	.recalc		= &omap2_clksel_recalc,
 };
 
 static struct clk mcbsp2_ick = {
@@ -1159,10 +1186,14 @@ static struct clk mcbsp2_fck = {
 	.name		= "mcbsp2_fck",
 	.ops		= &clkops_omap2_dflt_wait,
 	.parent		= &func_96m_ck,
+	.init		= &omap2_init_clksel_parent,
 	.clkdm_name	= "core_l4_clkdm",
 	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
 	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
-	.recalc		= &followparent_recalc,
+	.clksel_reg	= OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+	.clksel_mask	= OMAP2_MCBSP2_CLKS_MASK,
+	.clksel		= mcbsp_fck_clksel,
+	.recalc		= &omap2_clksel_recalc,
 };
 
 static struct clk mcspi1_ick = {
@@ -1721,6 +1752,9 @@ static struct omap_clk omap2420_clks[] = {
 	CLK(NULL,	"osc_ck",	&osc_ck,	CK_242X),
 	CLK(NULL,	"sys_ck",	&sys_ck,	CK_242X),
 	CLK(NULL,	"alt_ck",	&alt_ck,	CK_242X),
+	CLK("omap-mcbsp.1",	"pad_fck",	&mcbsp_clks,	CK_242X),
+	CLK("omap-mcbsp.2",	"pad_fck",	&mcbsp_clks,	CK_242X),
+	CLK(NULL,	"mcbsp_clks",	&mcbsp_clks,	CK_242X),
 	/* internal analog sources */
 	CLK(NULL,	"dpll_ck",	&dpll_ck,	CK_242X),
 	CLK(NULL,	"apll96_ck",	&apll96_ck,	CK_242X),
@@ -1728,6 +1762,8 @@ static struct omap_clk omap2420_clks[] = {
 	/* internal prcm root sources */
 	CLK(NULL,	"func_54m_ck",	&func_54m_ck,	CK_242X),
 	CLK(NULL,	"core_ck",	&core_ck,	CK_242X),
+	CLK("omap-mcbsp.1",	"prcm_fck",	&func_96m_ck,	CK_242X),
+	CLK("omap-mcbsp.2",	"prcm_fck",	&func_96m_ck,	CK_242X),
 	CLK(NULL,	"func_96m_ck",	&func_96m_ck,	CK_242X),
 	CLK(NULL,	"func_48m_ck",	&func_48m_ck,	CK_242X),
 	CLK(NULL,	"func_12m_ck",	&func_12m_ck,	CK_242X),



WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/10] OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases
Date: Fri, 01 Oct 2010 15:34:59 -0600	[thread overview]
Message-ID: <20101001213454.1408.22112.stgit@twilight.localdomain> (raw)
In-Reply-To: <20101001213119.1408.65395.stgit@twilight.localdomain>

Add the MCBSP_CLKS clock and the clksel structures needed to support clock
framework-based source switching for McBSP 1 and 2.  Also, add clkdev
aliases on the parent clocks for the McBSP source switching code, added
in a subsequent patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/clock2420_data.c |   40 ++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 5f2066a..7086fe4 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -18,6 +18,7 @@
 #include <linux/list.h>
 
 #include <plat/clkdev_omap.h>
+#include <plat/control.h>
 
 #include "clock.h"
 #include "clock2xxx.h"
@@ -89,6 +90,12 @@ static struct clk alt_ck = {		/* Typical 54M or 48M, may not exist */
 	.clkdm_name	= "wkup_clkdm",
 };
 
+/* Optional external clock input for McBSP CLKS */
+static struct clk mcbsp_clks = {
+	.name		= "mcbsp_clks",
+	.ops		= &clkops_null,
+};
+
 /*
  * Analog domain root source clocks
  */
@@ -1135,14 +1142,34 @@ static struct clk mcbsp1_ick = {
 	.recalc		= &followparent_recalc,
 };
 
+static const struct clksel_rate common_mcbsp_96m_rates[] = {
+	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
+	{ .div = 0 }
+};
+
+static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
+	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
+	{ .div = 0 }
+};
+
+static const struct clksel mcbsp_fck_clksel[] = {
+	{ .parent = &func_96m_ck,  .rates = common_mcbsp_96m_rates },
+	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
+	{ .parent = NULL }
+};
+
 static struct clk mcbsp1_fck = {
 	.name		= "mcbsp1_fck",
 	.ops		= &clkops_omap2_dflt_wait,
 	.parent		= &func_96m_ck,
+	.init		= &omap2_init_clksel_parent,
 	.clkdm_name	= "core_l4_clkdm",
 	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
 	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
-	.recalc		= &followparent_recalc,
+	.clksel_reg	= OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+	.clksel_mask	= OMAP2_MCBSP1_CLKS_MASK,
+	.clksel		= mcbsp_fck_clksel,
+	.recalc		= &omap2_clksel_recalc,
 };
 
 static struct clk mcbsp2_ick = {
@@ -1159,10 +1186,14 @@ static struct clk mcbsp2_fck = {
 	.name		= "mcbsp2_fck",
 	.ops		= &clkops_omap2_dflt_wait,
 	.parent		= &func_96m_ck,
+	.init		= &omap2_init_clksel_parent,
 	.clkdm_name	= "core_l4_clkdm",
 	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
 	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
-	.recalc		= &followparent_recalc,
+	.clksel_reg	= OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+	.clksel_mask	= OMAP2_MCBSP2_CLKS_MASK,
+	.clksel		= mcbsp_fck_clksel,
+	.recalc		= &omap2_clksel_recalc,
 };
 
 static struct clk mcspi1_ick = {
@@ -1721,6 +1752,9 @@ static struct omap_clk omap2420_clks[] = {
 	CLK(NULL,	"osc_ck",	&osc_ck,	CK_242X),
 	CLK(NULL,	"sys_ck",	&sys_ck,	CK_242X),
 	CLK(NULL,	"alt_ck",	&alt_ck,	CK_242X),
+	CLK("omap-mcbsp.1",	"pad_fck",	&mcbsp_clks,	CK_242X),
+	CLK("omap-mcbsp.2",	"pad_fck",	&mcbsp_clks,	CK_242X),
+	CLK(NULL,	"mcbsp_clks",	&mcbsp_clks,	CK_242X),
 	/* internal analog sources */
 	CLK(NULL,	"dpll_ck",	&dpll_ck,	CK_242X),
 	CLK(NULL,	"apll96_ck",	&apll96_ck,	CK_242X),
@@ -1728,6 +1762,8 @@ static struct omap_clk omap2420_clks[] = {
 	/* internal prcm root sources */
 	CLK(NULL,	"func_54m_ck",	&func_54m_ck,	CK_242X),
 	CLK(NULL,	"core_ck",	&core_ck,	CK_242X),
+	CLK("omap-mcbsp.1",	"prcm_fck",	&func_96m_ck,	CK_242X),
+	CLK("omap-mcbsp.2",	"prcm_fck",	&func_96m_ck,	CK_242X),
 	CLK(NULL,	"func_96m_ck",	&func_96m_ck,	CK_242X),
 	CLK(NULL,	"func_48m_ck",	&func_48m_ck,	CK_242X),
 	CLK(NULL,	"func_12m_ck",	&func_12m_ck,	CK_242X),

  parent reply	other threads:[~2010-10-01 21:41 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 21:34 [PATCH 00/10] OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37 Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley
2010-10-01 21:34 ` [PATCH 01/10] OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC Paul Walmsley
2010-10-01 21:34   ` Paul Walmsley
2010-10-04  4:21   ` Varadarajan, Charulatha
2010-10-04  4:21     ` Varadarajan, Charulatha
2010-10-04  5:45     ` Paul Walmsley
2010-10-04  5:45       ` Paul Walmsley
2010-10-01 21:34 ` [PATCH 02/10] OMAP2420: CTRL: fix OMAP242X_CTRL_REGADDR macro Paul Walmsley
2010-10-01 21:34   ` Paul Walmsley
2010-10-01 21:34 ` Paul Walmsley [this message]
2010-10-01 21:34   ` [PATCH 03/10] OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases Paul Walmsley
2010-10-01 21:35 ` [PATCH 04/10] OMAP2430: " Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 05/10] OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 06/10] OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 07/10] OMAP: McBSP: implement functional clock switching via clock framework Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-05  8:35   ` Peter Ujfalusi
2010-10-05  8:35     ` Peter Ujfalusi
2010-10-05  9:57     ` Paul Walmsley
2010-10-05  9:57       ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 08/10] OMAP: split plat-omap/common.c Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-04  5:34   ` Shilimkar, Santosh
2010-10-04  5:34     ` Shilimkar, Santosh
2010-10-04  6:56     ` Felipe Balbi
2010-10-04  6:56       ` Felipe Balbi
2010-10-04  7:00       ` Felipe Balbi
2010-10-04  7:00         ` Felipe Balbi
2010-10-04  7:28         ` Shilimkar, Santosh
2010-10-04  7:28           ` Shilimkar, Santosh
2010-10-04 18:21           ` Tony Lindgren
2010-10-04 18:21             ` Tony Lindgren
2010-10-04 19:32           ` Paul Walmsley
2010-10-04 19:32             ` Paul Walmsley
2010-10-05  4:37             ` Shilimkar, Santosh
2010-10-05  4:37               ` Shilimkar, Santosh
2010-10-05  4:55               ` Paul Walmsley
2010-10-05  4:55                 ` Paul Walmsley
2010-10-05  5:19                 ` Shilimkar, Santosh
2010-10-05  5:19                   ` Shilimkar, Santosh
2010-10-04  5:38   ` Varadarajan, Charulatha
2010-10-04  5:38     ` Varadarajan, Charulatha
2010-10-04  6:03     ` Paul Walmsley
2010-10-04  6:03       ` Paul Walmsley
2010-10-04  8:28       ` Varadarajan, Charulatha
2010-10-04  8:28         ` Varadarajan, Charulatha
2010-10-04 18:27         ` Tony Lindgren
2010-10-04 18:27           ` Tony Lindgren
2010-10-04 19:24     ` Paul Walmsley
2010-10-04 19:24       ` Paul Walmsley
2010-10-04  9:08   ` Cousson, Benoit
2010-10-04  9:08     ` Cousson, Benoit
2010-10-04  9:35     ` DebBarma, Tarun Kanti
2010-10-04  9:35       ` DebBarma, Tarun Kanti
2010-10-04  9:54       ` Cousson, Benoit
2010-10-04  9:54         ` Cousson, Benoit
2010-10-04 19:15     ` Paul Walmsley
2010-10-04 19:15       ` Paul Walmsley
2010-10-04 19:26       ` Paul Walmsley
2010-10-04 19:26         ` Paul Walmsley
2010-10-05 11:00       ` Sergei Shtylyov
2010-10-05 11:00         ` Sergei Shtylyov
2010-10-05 15:07         ` Paul Walmsley
2010-10-05 15:07           ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 09/10] OMAP: control: move plat-omap/control.h to mach-omap2/control.h Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-01 21:35 ` [PATCH 10/10] OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks Paul Walmsley
2010-10-01 21:35   ` Paul Walmsley
2010-10-05 12:52 ` [PATCH 00/10] OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37 Jarkko Nikula
2010-10-05 12:52   ` Jarkko Nikula
2010-10-05 18:40   ` Tony Lindgren
2010-10-05 18:40     ` Tony Lindgren
2010-10-06  5:42     ` Peter Ujfalusi
2010-10-06  5:42       ` Peter Ujfalusi
2010-10-06 14:48       ` Tony Lindgren
2010-10-06 14:48         ` Tony Lindgren
2010-10-06 15:08         ` Liam Girdwood
2010-10-06 15:08           ` Liam Girdwood
2010-10-06 18:57           ` Paul Walmsley
2010-10-06 18:57             ` Paul Walmsley
2010-10-06 16:33         ` Mark Brown
2010-10-06 16:33           ` Mark Brown

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=20101001213454.1408.22112.stgit@twilight.localdomain \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.