aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2012-06-05 13:34:57 -0400
committerTony Lindgren <tony@atomide.com>2012-06-14 05:39:47 -0400
commit6615975bc58a1234bd401a7ff231dae85631fd58 (patch)
treeb914fe87fc136aba2b23c166b540b8cf973adfe0 /arch/arm/plat-omap
parent0b30ec1cb7f1b0134b16670f886baaf3521b083c (diff)
ARM: OMAP: Add flag to indicate if a timer needs a manual reset
For OMAP1 devices, it is necessary to perform a manual reset of the timer. Currently, this is indicating by setting the "needs_manual_reset" variable in the platform data. Instead of using an extra variable to indicate this add a new timer capabilities flag to indicate this and remove the "needs_manual_reset" member from the platform data. Signed-off-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/dmtimer.c9
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7875eefd0474..e3e22b3dc5c2 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -135,7 +135,6 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer)
135 135
136int omap_dm_timer_prepare(struct omap_dm_timer *timer) 136int omap_dm_timer_prepare(struct omap_dm_timer *timer)
137{ 137{
138 struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
139 int ret; 138 int ret;
140 139
141 timer->fclk = clk_get(&timer->pdev->dev, "fck"); 140 timer->fclk = clk_get(&timer->pdev->dev, "fck");
@@ -145,7 +144,7 @@ int omap_dm_timer_prepare(struct omap_dm_timer *timer)
145 return -EINVAL; 144 return -EINVAL;
146 } 145 }
147 146
148 if (pdata->needs_manual_reset) 147 if (timer->capability & OMAP_TIMER_NEEDS_RESET)
149 omap_dm_timer_reset(timer); 148 omap_dm_timer_reset(timer);
150 149
151 ret = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); 150 ret = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
@@ -363,13 +362,11 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_start);
363int omap_dm_timer_stop(struct omap_dm_timer *timer) 362int omap_dm_timer_stop(struct omap_dm_timer *timer)
364{ 363{
365 unsigned long rate = 0; 364 unsigned long rate = 0;
366 struct dmtimer_platform_data *pdata;
367 365
368 if (unlikely(!timer)) 366 if (unlikely(!timer))
369 return -EINVAL; 367 return -EINVAL;
370 368
371 pdata = timer->pdev->dev.platform_data; 369 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET))
372 if (!pdata->needs_manual_reset)
373 rate = clk_get_rate(timer->fclk); 370 rate = clk_get_rate(timer->fclk);
374 371
375 __omap_dm_timer_stop(timer, timer->posted, rate); 372 __omap_dm_timer_stop(timer, timer->posted, rate);
@@ -694,7 +691,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
694 timer->capability = pdata->timer_capability; 691 timer->capability = pdata->timer_capability;
695 692
696 /* Skip pm_runtime_enable for OMAP1 */ 693 /* Skip pm_runtime_enable for OMAP1 */
697 if (!pdata->needs_manual_reset) { 694 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
698 pm_runtime_enable(&pdev->dev); 695 pm_runtime_enable(&pdev->dev);
699 pm_runtime_irq_safe(&pdev->dev); 696 pm_runtime_irq_safe(&pdev->dev);
700 } 697 }
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index e11c9ea7ec53..c039e84bca7e 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -59,6 +59,7 @@
59#define OMAP_TIMER_SECURE 0x80000000 59#define OMAP_TIMER_SECURE 0x80000000
60#define OMAP_TIMER_ALWON 0x40000000 60#define OMAP_TIMER_ALWON 0x40000000
61#define OMAP_TIMER_HAS_PWM 0x20000000 61#define OMAP_TIMER_HAS_PWM 0x20000000
62#define OMAP_TIMER_NEEDS_RESET 0x10000000
62 63
63struct omap_timer_capability_dev_attr { 64struct omap_timer_capability_dev_attr {
64 u32 timer_capability; 65 u32 timer_capability;
@@ -90,7 +91,6 @@ struct timer_regs {
90 91
91struct dmtimer_platform_data { 92struct dmtimer_platform_data {
92 int (*set_timer_src)(struct platform_device *pdev, int source); 93 int (*set_timer_src)(struct platform_device *pdev, int source);
93 u32 needs_manual_reset:1;
94 u32 timer_capability; 94 u32 timer_capability;
95}; 95};
96 96