From: Nishanth Menon <nm@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>, Benoit Cousson <b-cousson@ti.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>,
Paul Walmsley <paul@pwsan.com>, Romit Dasgupta <romit@ti.com>,
Sanjeev Premi <premi@ti.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Sergio Alberto Aguirre Rodriguez <saaguirre@ti.com>,
Thara Gopinath <thara@ti.com>,
Vishwanath Sripathy <vishwanath.bs@ti.com>
Subject: [PATCH 01/10] omap3: pm: introduce enabled flag to omap_opp
Date: Tue, 24 Nov 2009 22:09:10 -0600 [thread overview]
Message-ID: <1259122159-1583-2-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1259122159-1583-1-git-send-email-nm@ti.com>
We used to enable and disable OPPs based on rate being set to 0, this
has been confusing in general. So, we now allow specific OPPs to be
now enabled/disabled by an explicit enabled flag instead of re-using
rate flag itself.
Tested on: SDP3430
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Romit Dasgupta <romit@ti.com>
Cc: Sanjeev Premi <premi@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Sergio Alberto Aguirre Rodriguez <saaguirre@ti.com>
Cc: Thara Gopinath <thara@ti.com>
Cc: Vishwanath Sripathy <vishwanath.bs@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
arch/arm/mach-omap2/omap3-opp.h | 32 ++++++++++++++--------------
arch/arm/mach-omap2/resource34xx.c | 4 +++
arch/arm/plat-omap/include/plat/omap-pm.h | 2 +
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-omap2/omap3-opp.h b/arch/arm/mach-omap2/omap3-opp.h
index c773ea7..42557e1 100644
--- a/arch/arm/mach-omap2/omap3-opp.h
+++ b/arch/arm/mach-omap2/omap3-opp.h
@@ -22,41 +22,41 @@
#define S166M 166000000
static struct omap_opp omap3_mpu_rate_table[] = {
- {0, 0, 0},
+ {0, 0, 0, 0},
/*OPP1*/
- {S125M, VDD1_OPP1, 0x1E},
+ {true, S125M, VDD1_OPP1, 0x1E},
/*OPP2*/
- {S250M, VDD1_OPP2, 0x26},
+ {true, S250M, VDD1_OPP2, 0x26},
/*OPP3*/
- {S500M, VDD1_OPP3, 0x30},
+ {true, S500M, VDD1_OPP3, 0x30},
/*OPP4*/
- {S550M, VDD1_OPP4, 0x36},
+ {true, S550M, VDD1_OPP4, 0x36},
/*OPP5*/
- {S600M, VDD1_OPP5, 0x3C},
+ {true, S600M, VDD1_OPP5, 0x3C},
};
static struct omap_opp omap3_l3_rate_table[] = {
- {0, 0, 0},
+ {0, 0, 0, 0},
/*OPP1*/
- {0, VDD2_OPP1, 0x1E},
+ {false, 0, VDD2_OPP1, 0x1E},
/*OPP2*/
- {S83M, VDD2_OPP2, 0x24},
+ {true, S83M, VDD2_OPP2, 0x24},
/*OPP3*/
- {S166M, VDD2_OPP3, 0x2C},
+ {true, S166M, VDD2_OPP3, 0x2C},
};
static struct omap_opp omap3_dsp_rate_table[] = {
- {0, 0, 0},
+ {0, 0, 0, 0},
/*OPP1*/
- {S90M, VDD1_OPP1, 0x1E},
+ {true, S90M, VDD1_OPP1, 0x1E},
/*OPP2*/
- {S180M, VDD1_OPP2, 0x26},
+ {true, S180M, VDD1_OPP2, 0x26},
/*OPP3*/
- {S360M, VDD1_OPP3, 0x30},
+ {true, S360M, VDD1_OPP3, 0x30},
/*OPP4*/
- {S400M, VDD1_OPP4, 0x36},
+ {true, S400M, VDD1_OPP4, 0x36},
/*OPP5*/
- {S430M, VDD1_OPP5, 0x3C},
+ {true, S430M, VDD1_OPP5, 0x3C},
};
#endif
diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c
index 04be4d2..af6b3c1 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -285,6 +285,10 @@ static int program_opp(int res, struct omap_opp *opp, int target_level,
c_opp = ID_VDD(res) | ID_OPP_NO(opp[current_level].opp_id);
#endif
+ /* Only allow enabled OPPs */
+ if (!opp[target_level].enabled)
+ return -EINVAL;
+
/* Sanity check of the OPP params before attempting to set */
if (!opp[target_level].rate || !opp[target_level].vsel)
return -EINVAL;
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index 583e540..5dc2048 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -21,6 +21,7 @@
/**
* struct omap_opp - clock frequency-to-OPP ID table for DSP, MPU
+ * @enabled: enabled if true, disabled if false
* @rate: target clock rate
* @opp_id: OPP ID
* @min_vdd: minimum VDD1 voltage (in millivolts) for this OPP
@@ -28,6 +29,7 @@
* Operating performance point data. Can vary by OMAP chip and board.
*/
struct omap_opp {
+ bool enabled;
unsigned long rate;
u8 opp_id;
u16 vsel;
--
1.6.3.3
next prev parent reply other threads:[~2009-11-25 4:09 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 4:09 [PATCH 00/10 v3] omap3: pm: introduce support for 3630 OPPs Nishanth Menon
2009-11-25 4:09 ` Nishanth Menon [this message]
2009-11-25 4:09 ` [PATCH 02/10 V3] omap3: pm: introduce opp accessor functions Nishanth Menon
2009-11-25 4:09 ` [PATCH 03/10 V3] omap3: pm: use opp accessor functions for omap34xx Nishanth Menon
2009-11-25 4:09 ` [PATCH 04/10 V3] omap3: pm: srf: use opp accessor functions Nishanth Menon
2009-11-25 4:09 ` [PATCH 05/10 V3] omap3: pm: sr: replace get_opp with freq_to_opp Nishanth Menon
2009-11-25 4:09 ` [PATCH 06/10 V3] omap3: pm: use opp accessor functions for omap-target Nishanth Menon
2009-11-25 4:09 ` [PATCH 07/10 V3] omap3: clk: use pm accessor functions for cpufreq table Nishanth Menon
2009-11-25 4:09 ` [PATCH 08/10] omap3: pm: remove VDDx_MIN/MAX macros Nishanth Menon
2009-11-25 4:09 ` [PATCH 09/10 V3] omap3: pm: introduce 3630 opps Nishanth Menon
2009-11-25 4:09 ` [PATCH 10/10] omap3: pm: omap3630 boards: enable 3630 opp tables Nishanth Menon
2009-12-08 7:49 ` [PATCH 09/10 V3] omap3: pm: introduce 3630 opps Eduardo Valentin
2009-12-08 10:59 ` Menon, Nishanth
2009-12-08 11:18 ` Eduardo Valentin
2009-12-08 11:31 ` Menon, Nishanth
2009-12-08 11:40 ` Eduardo Valentin
2009-12-08 14:15 ` Nishanth Menon
2009-12-07 16:54 ` [PATCH 07/10 V3] omap3: clk: use pm accessor functions for cpufreq table Tero.Kristo
2009-12-08 11:09 ` Menon, Nishanth
2009-12-08 7:54 ` Eduardo Valentin
2009-11-25 17:56 ` [PATCH 06/10 V3] omap3: pm: use opp accessor functions for omap-target Kevin Hilman
2009-12-08 7:59 ` Eduardo Valentin
2009-12-07 16:59 ` [PATCH 04/10 V3] omap3: pm: srf: use opp accessor functions Tero.Kristo
2009-12-08 11:14 ` Menon, Nishanth
2009-11-25 17:22 ` [PATCH 03/10 V3] omap3: pm: use opp accessor functions for omap34xx Kevin Hilman
2009-11-25 17:27 ` Kevin Hilman
2009-12-07 17:02 ` Tero.Kristo
2009-12-08 11:16 ` Menon, Nishanth
2009-12-08 8:08 ` Eduardo Valentin
2009-11-25 16:30 ` [PATCH 02/10 V3] omap3: pm: introduce opp accessor functions Kevin Hilman
2009-11-25 20:31 ` Nishanth Menon
2009-11-25 23:46 ` Kevin Hilman
2009-11-26 0:22 ` Menon, Nishanth
2009-12-08 8:23 ` Eduardo Valentin
2009-12-08 11:01 ` Menon, Nishanth
2009-11-25 15:24 ` [PATCH 00/10 v3] omap3: pm: introduce support for 3630 OPPs Kevin Hilman
-- strict thread matches above, loose matches on Subject: below --
2009-12-09 6:17 [PATCH 00/10 v4] " Nishanth Menon
2009-12-09 6:17 ` [PATCH 01/10] omap3: pm: introduce enabled flag to omap_opp Nishanth Menon
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=1259122159-1583-2-git-send-email-nm@ti.com \
--to=nm@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=madhu.cr@ti.com \
--cc=paul@pwsan.com \
--cc=premi@ti.com \
--cc=romit@ti.com \
--cc=saaguirre@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=thara@ti.com \
--cc=vishwanath.bs@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