From: Jon Hunter <jon-hunter@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Tony Lindgren <tony@atomide.com>,
Tarun Kanti DebBarma <tarun.kanti@ti.com>,
Jon Hunter <jon-hunter@ti.com>
Subject: [PATCH V3 07/12] ARM: OMAP2+: Fix external clock support for dmtimers
Date: Mon, 4 Jun 2012 14:41:44 -0500 [thread overview]
Message-ID: <1338838909-25356-8-git-send-email-jon-hunter@ti.com> (raw)
In-Reply-To: <1338838909-25356-1-git-send-email-jon-hunter@ti.com>
Currently, the dmtimer determines whether an timer can support an external
clock source (sys_altclk) for driving the timer by the IP version. Only
OMAP24xx devices can support an external clock source, but the IP version
between OMAP24xx and OMAP3xxx is common and so this incorrectly indicates
that OMAP3 devices can use an external clock source.
Rather than use the IP version, just let the clock framework handle this.
If the "alt_ck" does not exist for a timer then the clock framework will fail
to find the clock and hence will return an error. By doing this we can eliminate
the "timer_ip_version" variable passed as part of the platform data and simplify
the code.
We can also remove the timer IP version from the HWMOD data because the dmtimer
driver uses the TIDR register to determine the IP version.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 1 -
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 --
arch/arm/mach-omap2/timer.c | 11 ++---------
arch/arm/plat-omap/include/plat/dmtimer.h | 7 -------
4 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
index 7814e83..afad69c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -68,7 +68,6 @@ static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
.name = "timer",
.sysc = &omap2xxx_timer_sysc,
- .rev = OMAP_TIMER_IP_VERSION_1,
};
/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 7b33094..0ea53bc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -129,7 +129,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = {
static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = {
.name = "timer",
.sysc = &omap3xxx_timer_1ms_sysc,
- .rev = OMAP_TIMER_IP_VERSION_1,
};
static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
@@ -145,7 +144,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
.name = "timer",
.sysc = &omap3xxx_timer_sysc,
- .rev = OMAP_TIMER_IP_VERSION_1,
};
/* secure timers dev attribute */
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index d8a5dc3..a89f5f4 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -418,14 +418,8 @@ static int omap2_dm_timer_set_src(struct platform_device *pdev, int source)
break;
case OMAP_TIMER_SRC_EXT_CLK:
- if (pdata->timer_ip_version == OMAP_TIMER_IP_VERSION_1) {
- parent_name = "alt_ck";
- break;
- }
- dev_err(&pdev->dev, "%s: %d: invalid clk src.\n",
- __func__, __LINE__);
- clk_put(fclk);
- return -EINVAL;
+ parent_name = "alt_ck";
+ break;
}
parent = clk_get(&pdev->dev, parent_name);
@@ -498,7 +492,6 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
sscanf(oh->name, "timer%2d", &id);
pdata->set_timer_src = omap2_dm_timer_set_src;
- pdata->timer_ip_version = oh->class->rev;
if (timer_dev_attr)
pdata->timer_capability = timer_dev_attr->timer_capability;
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 48e54ca..362cf97 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -55,12 +55,6 @@
#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01
#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02
-/*
- * IP revision identifier so that Highlander IP
- * in OMAP4 can be distinguished.
- */
-#define OMAP_TIMER_IP_VERSION_1 0x1
-
/* timer capabilities used in hwmod database */
#define OMAP_TIMER_SECURE 0x80000000
#define OMAP_TIMER_ALWON 0x40000000
@@ -96,7 +90,6 @@ struct timer_regs {
struct dmtimer_platform_data {
int (*set_timer_src)(struct platform_device *pdev, int source);
- int timer_ip_version;
u32 needs_manual_reset:1;
bool loses_context;
--
1.7.9.5
next prev parent reply other threads:[~2012-06-04 19:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 19:41 [PATCH V3 00/12] ARM: OMAP: DMTIMER clean-up and fixes in preparation for device-tree Jon Hunter
2012-06-04 19:41 ` [PATCH V3 01/12] ARM: OMAP: Remove unnecessary clk structure Jon Hunter
2012-06-04 19:41 ` [PATCH V3 02/12] ARM: OMAP2+: Remove unused max number of timers definition Jon Hunter
2012-06-04 19:41 ` [PATCH V3 03/12] ARM: OMAP2+: Add dmtimer platform function to reserve systimers Jon Hunter
2012-06-04 19:41 ` [PATCH V3 04/12] ARM: OMAP: Add DMTIMER capability variable to represent timer features Jon Hunter
2012-06-04 19:41 ` [PATCH V3 05/12] ARM: OMAP2+: HWMOD: Correct timer device attributes Jon Hunter
2012-06-04 19:41 ` [PATCH V3 06/12] ARM: OMAP1: Fix dmtimer support Jon Hunter
2012-06-04 19:47 ` Jon Hunter
2012-06-04 19:41 ` Jon Hunter [this message]
2012-06-04 19:41 ` [PATCH V3 08/12] ARM: OMAP: Remove loses_context variable from timer platform data Jon Hunter
2012-06-04 19:41 ` [PATCH V3 09/12] ARM: OMAP: Remove timer function pointer for context loss counter Jon Hunter
2012-06-04 19:41 ` [PATCH V3 10/12] ARM: OMAP: Add flag to indicate if a timer needs a manual reset Jon Hunter
2012-06-04 19:41 ` [PATCH V3 11/12] ARM: OMAP2+: Move dmtimer clock set function to dmtimer driver Jon Hunter
2012-06-04 19:41 ` [PATCH V3 12/12] ARM: OMAP2+: Simplify dmtimer clock aliases Jon Hunter
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=1338838909-25356-8-git-send-email-jon-hunter@ti.com \
--to=jon-hunter@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=tarun.kanti@ti.com \
--cc=tony@atomide.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