Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272692
b: refs/heads/master
c: 0dad9fa
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren committed Sep 21, 2011
1 parent eaaacd0 commit 5d8cea7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffe07ceae1ae4b00b776c59694eddd9dd615dcea
refs/heads/master: 0dad9faeaeb0fa3524068a94e1745b91e5597c17
6 changes: 5 additions & 1 deletion trunk/arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
#define MAX_GPTIMER_ID 12

u32 sys_timer_reserved;
static u32 sys_timer_reserved;

/* Clockevent code */

Expand Down Expand Up @@ -463,6 +463,10 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
pdata->set_timer_src = omap2_dm_timer_set_src;
pdata->timer_ip_version = oh->class->rev;

/* Mark clocksource and clockevent timers as reserved */
if ((sys_timer_reserved >> (id - 1)) & 0x1)
pdata->reserved = 1;

od = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
omap2_dmtimer_latency,
ARRAY_SIZE(omap2_dmtimer_latency),
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/arm/plat-omap/dmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)

timer->id = pdev->id;
timer->irq = irq->start;
timer->reserved = pdata->reserved;
timer->pdev = pdev;

/* Skip pm_runtime_enable for OMAP1 */
Expand All @@ -517,6 +518,12 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
pm_runtime_irq_safe(&pdev->dev);
}

if (!timer->reserved) {
pm_runtime_get_sync(&pdev->dev);
__omap_dm_timer_init_regs(timer);
pm_runtime_put(&pdev->dev);
}

/* add the timer element to the list */
spin_lock_irqsave(&dm_timer_lock, flags);
list_add_tail(&timer->node, &omap_timer_list);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/plat-omap/include/plat/dmtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct dmtimer_platform_data {
int (*set_timer_src)(struct platform_device *pdev, int source);
int timer_ip_version;
u32 needs_manual_reset:1;
bool reserved;
};

struct omap_dm_timer *omap_dm_timer_request(void);
Expand Down Expand Up @@ -248,7 +249,6 @@ struct omap_dm_timer {
struct list_head node;
};

extern u32 sys_timer_reserved;
int omap_dm_timer_prepare(struct omap_dm_timer *timer);

static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
Expand Down

0 comments on commit 5d8cea7

Please sign in to comment.