linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 20/22] OMAP3+ VP: replace transaction done check/clear with VP ops
Date: Mon, 29 Aug 2011 10:35:53 -0700	[thread overview]
Message-ID: <1314639355-12713-21-git-send-email-khilman@ti.com> (raw)
In-Reply-To: <1314639355-12713-1-git-send-email-khilman@ti.com>

Replace the VP tranxdone check/clear with helper functions from the
PRM layer.

In the process, remove prm_irqst_* voltage structure fields for IRQ
status checking which are no longer needed.

Since these reads/writes of the IRQ status bits were the only PRM
accesses that were not to VC/VP registers, this allows the rest of the
register accesses in the VC/VP code to use VC/VP specific register
access functions (done in the following patch.)

Signed-off-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/voltage.h                 |    3 ---
 arch/arm/mach-omap2/voltagedomains3xxx_data.c |    4 ----
 arch/arm/mach-omap2/voltagedomains44xx_data.c |    6 ------
 arch/arm/mach-omap2/vp.c                      |   16 +++++-----------
 4 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index 641597c..363eee4 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -131,7 +131,6 @@ struct omap_volt_pmic_info {
  * @vfsm                : voltage manager FSM data
  * @debug_dir		: debug directory for this voltage domain.
  * @curr_volt		: current voltage for this vdd.
- * @prm_irqst_mod       : PRM module id used for PRM IRQ status register access
  * @vp_enabled		: flag to keep track of whether vp is enabled or not
  * @volt_scale		: API to scale the voltage of the vdd.
  */
@@ -145,8 +144,6 @@ struct omap_vdd_info {
 	u32 curr_volt;
 	bool vp_enabled;
 
-	s16 prm_irqst_mod;
-	u8 prm_irqst_reg;
 	u32 (*read_reg) (u16 mod, u8 offset);
 	void (*write_reg) (u32 val, u16 mod, u8 offset);
 	int (*volt_scale) (struct voltagedomain *voltdm,
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index 7cb27ec..ad8f05b 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -38,8 +38,6 @@ static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = {
 };
 
 static struct omap_vdd_info omap3_vdd1_info = {
-	.prm_irqst_mod = OCP_MOD,
-	.prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
 	.vp_data = &omap3_vp1_data,
 	.vfsm = &omap3_vdd1_vfsm_data,
 };
@@ -51,8 +49,6 @@ static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = {
 };
 
 static struct omap_vdd_info omap3_vdd2_info = {
-	.prm_irqst_mod = OCP_MOD,
-	.prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
 	.vp_data = &omap3_vp2_data,
 	.vfsm = &omap3_vdd2_vfsm_data,
 };
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
index a05d90a..43e1d38 100644
--- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
@@ -37,8 +37,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
 };
 
 static struct omap_vdd_info omap4_vdd_mpu_info = {
-	.prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
-	.prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
 	.vp_data = &omap4_vp_mpu_data,
 	.vfsm = &omap4_vdd_mpu_vfsm_data,
 };
@@ -48,8 +46,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
 };
 
 static struct omap_vdd_info omap4_vdd_iva_info = {
-	.prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
-	.prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
 	.vp_data = &omap4_vp_iva_data,
 	.vfsm = &omap4_vdd_iva_vfsm_data,
 };
@@ -59,8 +55,6 @@ static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
 };
 
 static struct omap_vdd_info omap4_vdd_core_info = {
-	.prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
-	.prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
 	.vp_data = &omap4_vp_core_data,
 	.vfsm = &omap4_vdd_core_vfsm_data,
 };
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
index f3503de..113c839 100644
--- a/arch/arm/mach-omap2/vp.c
+++ b/arch/arm/mach-omap2/vp.c
@@ -111,10 +111,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
 	 * is <3us
 	 */
 	while (timeout++ < VP_TRANXDONE_TIMEOUT) {
-		vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
-			       vdd->prm_irqst_mod, vdd->prm_irqst_reg);
-		if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
-		      vp->prm_irqst_data->tranxdone_status))
+		vp->vp_common->ops->clear_txdone(vp->id);
+		if (!vp->vp_common->ops->check_txdone(vp->id))
 			break;
 		udelay(1);
 	}
@@ -146,9 +144,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
 	 * Depends on SMPSWAITTIMEMIN/MAX and voltage change
 	 */
 	timeout = 0;
-	omap_test_timeout((vdd->read_reg(vdd->prm_irqst_mod,
-					 vdd->prm_irqst_reg) &
-			   vp->prm_irqst_data->tranxdone_status),
+	omap_test_timeout(vp->vp_common->ops->check_txdone(vp->id),
 			  VP_TRANXDONE_TIMEOUT, timeout);
 	if (timeout >= VP_TRANXDONE_TIMEOUT)
 		pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
@@ -163,10 +159,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
 	 */
 	timeout = 0;
 	while (timeout++ < VP_TRANXDONE_TIMEOUT) {
-		vdd->write_reg(vp->prm_irqst_data->tranxdone_status,
-			       vdd->prm_irqst_mod, vdd->prm_irqst_reg);
-		if (!(vdd->read_reg(vdd->prm_irqst_mod, vdd->prm_irqst_reg) &
-		      vp->prm_irqst_data->tranxdone_status))
+		vp->vp_common->ops->clear_txdone(vp->id);
+		if (!vp->vp_common->ops->check_txdone(vp->id))
 			break;
 		udelay(1);
 	}
-- 
1.7.6


  parent reply	other threads:[~2011-08-29 17:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 17:35 [PATCH 00/22] OMAP: voltage cleanup part A Kevin Hilman
2011-08-29 17:35 ` [PATCH 01/22] OMAP2+: hwmod: remove unused voltagedomain pointer Kevin Hilman
2011-08-29 17:35 ` [PATCH 02/22] OMAP2+: voltage: move PRCM mod offets into VC/VP structures Kevin Hilman
2011-08-29 17:35 ` [PATCH 03/22] OMAP2+: voltage: move prm_irqst_reg from VP into voltage domain Kevin Hilman
2011-08-29 17:35 ` [PATCH 04/22] OMAP2+: voltage: start towards a new voltagedomain layer Kevin Hilman
2011-08-29 17:35 ` [PATCH 05/22] OMAP3: voltage: rename "mpu" voltagedomain to "mpu_iva" Kevin Hilman
2011-08-29 17:35 ` [PATCH 06/22] OMAP3: voltagedomain data: add wakeup domain Kevin Hilman
2011-08-29 17:35 ` [PATCH 07/22] OMAP3+: voltage: add scalable flag to voltagedomain Kevin Hilman
2011-08-29 17:35 ` [PATCH 08/22] OMAP2+: powerdomain: add voltagedomain to struct powerdomain Kevin Hilman
2011-08-29 17:35 ` [PATCH 09/22] OMAP2: add voltage domains and connect to powerdomains Kevin Hilman
2011-09-07 10:39   ` Jean Pihet
2011-09-09 21:41     ` Kevin Hilman
2011-09-09 21:46     ` Kevin Hilman
2011-08-29 17:35 ` [PATCH 10/22] OMAP3: powerdomain data: add voltage domains Kevin Hilman
2011-08-29 17:35 ` [PATCH 11/22] OMAP4: " Kevin Hilman
2011-09-07  9:04   ` Jean Pihet
2011-09-09 21:48     ` Kevin Hilman
2011-08-29 17:35 ` [PATCH 12/22] OMAP2+: powerdomain: add voltage domain lookup during register Kevin Hilman
2011-08-29 17:35 ` [PATCH 13/22] OMAP2+: voltage: keep track of powerdomains in each voltagedomain Kevin Hilman
2011-09-07  9:23   ` Jean Pihet
2011-09-09 21:52     ` Kevin Hilman
2011-08-29 17:35 ` [PATCH 14/22] OMAP2+: voltage: split voltage controller (VC) code into dedicated layer Kevin Hilman
2011-09-07 10:42   ` Jean Pihet
2011-09-09 21:51     ` Kevin Hilman
2011-08-29 17:35 ` [PATCH 15/22] OMAP2+: voltage: move VC into struct voltagedomain, misc. renames Kevin Hilman
2011-08-29 17:35 ` [PATCH 16/22] OMAP2+: voltage: enable VC bypass scale method when VC is initialized Kevin Hilman
2011-08-29 17:35 ` [PATCH 17/22] OMAP2+: voltage: split out voltage processor (VP) code into new layer Kevin Hilman
2011-09-07  9:52   ` Jean Pihet
2011-08-29 17:35 ` [PATCH 18/22] OMAP2+: VC: support PMICs with separate voltage and command registers Kevin Hilman
2011-08-29 17:35 ` [PATCH 19/22] OMAP2+: add PRM VP functions for checking/clearing VP TX done status Kevin Hilman
2011-08-29 17:35 ` Kevin Hilman [this message]
2011-08-29 17:35 ` [PATCH 21/22] OMAP2+: PRM: add register access functions for VC/VP Kevin Hilman
2011-08-29 17:35 ` [PATCH 22/22] OMAP3+: voltage: convert to PRM register access functions Kevin Hilman
2011-09-07 19:12 ` [PATCH 00/22] OMAP: voltage cleanup part A Jean Pihet

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=1314639355-12713-21-git-send-email-khilman@ti.com \
    --to=khilman@ti.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 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).