All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: Benoit Cousson <b-cousson@ti.com>
Cc: rnayak@ti.com, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 12/13] OMAP4: cm: Add two new APIs for modulemode control
Date: Thu, 7 Jul 2011 02:32:40 -0600 (MDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1107070231110.30028@utopia.booyaka.com> (raw)
In-Reply-To: <1309554558-19819-13-git-send-email-b-cousson@ti.com>

On Fri, 1 Jul 2011, Benoit Cousson wrote:

> In OMAP4, a new programming model based on module control instead
> of clock control was introduced.
> Expose two APIs to allow the upper layer (omap_hwmod) to control
> the module mode independently of the parent clocks management.
> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Rajendra Nayak <rnayak@ti.com>

This patch was updated to use '_cminst_' in function names that are part 
of the cminst44xx.c file, rather than '_cm_', to preserve consistency 
with the rest of the file.  Updated patch below.


- Paul


From: Benoit Cousson <b-cousson@ti.com>
Date: Fri, 1 Jul 2011 23:09:17 +0200
Subject: [PATCH] OMAP4: cm: Add two new APIs for modulemode control

In OMAP4, a new programming model based on module control instead
of clock control was introduced.
Expose two APIs to allow the upper layer (omap_hwmod) to control
the module mode independently of the parent clocks management.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: renamed 'omap4_cm_' fns to 'omap4_cminst_'; cleaned up
 kerneldoc]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/cminst44xx.c |   40 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/cminst44xx.h |    5 ++++
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 61e4382..2b96e72 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -271,3 +271,43 @@ int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_off
 
 	return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
 }
+
+/**
+ * omap4_cminst_module_enable - Enable the modulemode inside CLKCTRL
+ * @mode: Module mode (SW or HW)
+ * @part: PRCM partition ID that the CM_CLKCTRL register exists in
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * No return value.
+ */
+void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs,
+			    u16 clkctrl_offs)
+{
+	u32 v;
+
+	v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs);
+	v &= ~OMAP4430_MODULEMODE_MASK;
+	v |= mode << OMAP4430_MODULEMODE_SHIFT;
+	omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs);
+}
+
+/**
+ * omap4_cminst_module_disable - Disable the module inside CLKCTRL
+ * @part: PRCM partition ID that the CM_CLKCTRL register exists in
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * No return value.
+ */
+void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
+			     u16 clkctrl_offs)
+{
+	u32 v;
+
+	v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs);
+	v &= ~OMAP4430_MODULEMODE_MASK;
+	omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs);
+}
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index a985400..f2ea645 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -20,6 +20,11 @@ extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs);
 extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs);
 extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs);
 
+extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs,
+				       u16 clkctrl_offs);
+extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
+					u16 clkctrl_offs);
+
 /*
  * In an ideal world, we would not export these low-level functions,
  * but this will probably take some time to fix properly
-- 
1.7.5.4


WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 12/13] OMAP4: cm: Add two new APIs for modulemode control
Date: Thu, 7 Jul 2011 02:32:40 -0600 (MDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1107070231110.30028@utopia.booyaka.com> (raw)
In-Reply-To: <1309554558-19819-13-git-send-email-b-cousson@ti.com>

On Fri, 1 Jul 2011, Benoit Cousson wrote:

> In OMAP4, a new programming model based on module control instead
> of clock control was introduced.
> Expose two APIs to allow the upper layer (omap_hwmod) to control
> the module mode independently of the parent clocks management.
> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Rajendra Nayak <rnayak@ti.com>

This patch was updated to use '_cminst_' in function names that are part 
of the cminst44xx.c file, rather than '_cm_', to preserve consistency 
with the rest of the file.  Updated patch below.


- Paul


From: Benoit Cousson <b-cousson@ti.com>
Date: Fri, 1 Jul 2011 23:09:17 +0200
Subject: [PATCH] OMAP4: cm: Add two new APIs for modulemode control

In OMAP4, a new programming model based on module control instead
of clock control was introduced.
Expose two APIs to allow the upper layer (omap_hwmod) to control
the module mode independently of the parent clocks management.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
[paul at pwsan.com: renamed 'omap4_cm_' fns to 'omap4_cminst_'; cleaned up
 kerneldoc]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/cminst44xx.c |   40 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/cminst44xx.h |    5 ++++
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 61e4382..2b96e72 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -271,3 +271,43 @@ int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_off
 
 	return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
 }
+
+/**
+ * omap4_cminst_module_enable - Enable the modulemode inside CLKCTRL
+ * @mode: Module mode (SW or HW)
+ * @part: PRCM partition ID that the CM_CLKCTRL register exists in
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * No return value.
+ */
+void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs,
+			    u16 clkctrl_offs)
+{
+	u32 v;
+
+	v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs);
+	v &= ~OMAP4430_MODULEMODE_MASK;
+	v |= mode << OMAP4430_MODULEMODE_SHIFT;
+	omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs);
+}
+
+/**
+ * omap4_cminst_module_disable - Disable the module inside CLKCTRL
+ * @part: PRCM partition ID that the CM_CLKCTRL register exists in
+ * @inst: CM instance register offset (*_INST macro)
+ * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
+ * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
+ *
+ * No return value.
+ */
+void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
+			     u16 clkctrl_offs)
+{
+	u32 v;
+
+	v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs);
+	v &= ~OMAP4430_MODULEMODE_MASK;
+	omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs);
+}
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index a985400..f2ea645 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -20,6 +20,11 @@ extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs);
 extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs);
 extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs);
 
+extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs,
+				       u16 clkctrl_offs);
+extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
+					u16 clkctrl_offs);
+
 /*
  * In an ideal world, we would not export these low-level functions,
  * but this will probably take some time to fix properly
-- 
1.7.5.4

  reply	other threads:[~2011-07-07  8:32 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 21:09 [PATCH v3 00/13] OMAP4: Add modulemode support to hwmod framework Benoit Cousson
2011-07-01 21:09 ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 01/13] OMAP4: hwmod data: Add clock domain attribute Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 02/13] OMAP2+: hwmod: Init clkdm field at boot time Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 03/13] OMAP4: hwmod: Replace CLKCTRL absolute address with offset macros Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-07  8:25   ` Paul Walmsley
2011-07-07  8:25     ` Paul Walmsley
2011-07-07 18:27     ` Todd Poynor
2011-07-07 18:27       ` Todd Poynor
2011-07-07 21:40       ` Paul Walmsley
2011-07-07 21:40         ` Paul Walmsley
2011-07-07 21:42       ` Paul Walmsley
2011-07-07 21:42         ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 04/13] OMAP: hwmod: Wait the idle status to be disabled Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-05 18:21   ` Todd Poynor
2011-07-05 18:21     ` Todd Poynor
2011-07-07  8:10     ` Paul Walmsley
2011-07-07  8:10       ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 05/13] OMAP2+: hwmod: Replace clkdm access from main_clk using hwmod attribute Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-06 23:27   ` Paul Walmsley
2011-07-06 23:27     ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 06/13] OMAP4: hwmod: Replace RSTCTRL absolute address with offset macros Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-07  8:28   ` Paul Walmsley
2011-07-07  8:28     ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 07/13] OMAP4: prm: Replace warm reset API with the offset based version Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 08/13] OMAP4: prm: Remove deprecated functions Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 09/13] OMAP4: hwmod data: Align interconnect format with regular modules Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-06 22:42   ` Paul Walmsley
2011-07-06 22:42     ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 10/13] OMAP4: hwmod data: Add PRM context register offset Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 11/13] OMAP4: hwmod data: Add modulemode entry in omap_hwmod structure Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-01 21:09 ` [PATCH v3 12/13] OMAP4: cm: Add two new APIs for modulemode control Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-07  8:32   ` Paul Walmsley [this message]
2011-07-07  8:32     ` Paul Walmsley
2011-07-01 21:09 ` [PATCH v3 13/13] OMAP4: hwmod: Introduce the module control in hwmod control Benoit Cousson
2011-07-01 21:09   ` Benoit Cousson
2011-07-07  8:17 ` [PATCH v3 00/13] OMAP4: Add modulemode support to hwmod framework Paul Walmsley
2011-07-07  8:17   ` Paul Walmsley

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=alpine.DEB.2.00.1107070231110.30028@utopia.booyaka.com \
    --to=paul@pwsan.com \
    --cc=b-cousson@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --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 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.