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 08/12] ARM: OMAP: Remove loses_context variable from timer platform data
Date: Mon, 4 Jun 2012 14:41:45 -0500 [thread overview]
Message-ID: <1338838909-25356-9-git-send-email-jon-hunter@ti.com> (raw)
In-Reply-To: <1338838909-25356-1-git-send-email-jon-hunter@ti.com>
The platform data variable loses_context is used to determine if the timer may
lose its logic state during power transitions and so needs to be restored. This
information is also provided in the HWMOD device attributes for OMAP2+ devices
via the OMAP_TIMER_ALWON flag. When this flag is set the timer will not lose
context. So use the HWMOD device attributes to determine this.
For OMAP1 devices, loses_context is never set and so set the OMAP_TIMER_ALWON
flag for OMAP1 timers to ensure that code is equivalent.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap1/timer.c | 1 +
arch/arm/mach-omap2/timer.c | 3 ---
arch/arm/plat-omap/dmtimer.c | 8 ++++----
arch/arm/plat-omap/include/plat/dmtimer.h | 3 ---
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 64c65bc..b4bf48c 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -141,6 +141,7 @@ static int __init omap1_dm_timer_init(void)
pdata->set_timer_src = omap1_dm_timer_set_src;
pdata->needs_manual_reset = 1;
+ pdata->timer_capability = OMAP_TIMER_ALWON;
ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
if (ret) {
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index a89f5f4..99e6a93 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -463,7 +463,6 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
struct dmtimer_platform_data *pdata;
struct platform_device *pdev;
struct omap_timer_capability_dev_attr *timer_dev_attr;
- struct powerdomain *pwrdm;
pr_debug("%s: %s\n", __func__, oh->name);
@@ -496,8 +495,6 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
if (timer_dev_attr)
pdata->timer_capability = timer_dev_attr->timer_capability;
- pwrdm = omap_hwmod_get_pwrdm(oh);
- pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
#ifdef CONFIG_PM
pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
#endif
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index d284b5d..823c80e 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -347,7 +347,7 @@ int omap_dm_timer_start(struct omap_dm_timer *timer)
omap_dm_timer_enable(timer);
- if (timer->loses_context) {
+ if (!(timer->capability & OMAP_TIMER_ALWON)) {
u32 ctx_loss_cnt_after =
timer->get_context_loss_count(&timer->pdev->dev);
if (ctx_loss_cnt_after != timer->ctx_loss_count)
@@ -380,7 +380,8 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)
__omap_dm_timer_stop(timer, timer->posted, rate);
- if (timer->loses_context && timer->get_context_loss_count)
+ if (!(timer->capability & OMAP_TIMER_ALWON) &&
+ timer->get_context_loss_count)
timer->ctx_loss_count =
timer->get_context_loss_count(&timer->pdev->dev);
@@ -453,7 +454,7 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
omap_dm_timer_enable(timer);
- if (timer->loses_context) {
+ if (!(timer->capability & OMAP_TIMER_ALWON)) {
u32 ctx_loss_cnt_after =
timer->get_context_loss_count(&timer->pdev->dev);
if (ctx_loss_cnt_after != timer->ctx_loss_count)
@@ -698,7 +699,6 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
timer->irq = irq->start;
timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
timer->pdev = pdev;
- timer->loses_context = pdata->loses_context;
timer->get_context_loss_count = pdata->get_context_loss_count;
timer->capability = pdata->timer_capability;
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 362cf97..0a7ed31 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -91,8 +91,6 @@ struct timer_regs {
struct dmtimer_platform_data {
int (*set_timer_src)(struct platform_device *pdev, int source);
u32 needs_manual_reset:1;
- bool loses_context;
-
int (*get_context_loss_count)(struct device *dev);
u32 timer_capability;
};
@@ -264,7 +262,6 @@ struct omap_dm_timer {
unsigned reserved:1;
unsigned posted:1;
struct timer_regs context;
- bool loses_context;
int ctx_loss_count;
int revision;
u32 capability;
--
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 ` [PATCH V3 07/12] ARM: OMAP2+: Fix external clock support for dmtimers Jon Hunter
2012-06-04 19:41 ` Jon Hunter [this message]
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-9-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