Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313367
b: refs/heads/master
c: b7b4ff7
h: refs/heads/master
i:
  313365: 1a5fd6c
  313363: 618a1f4
  313359: d401ff5
v: v3
  • Loading branch information
Jon Hunter authored and Tony Lindgren committed Jun 14, 2012
1 parent 7daa6e6 commit 4c6af9b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 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: 26fe4e454bfee3248bc7f7bab38b4888db33528e
refs/heads/master: b7b4ff764f7bf903e47eebdab661b1c38e791c6d
9 changes: 2 additions & 7 deletions trunk/arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
#define OMAP3_SECURE_TIMER 1
#endif

static u32 sys_timer_reserved;

/* Clockevent code */

static struct omap_dm_timer clkev;
Expand Down Expand Up @@ -177,7 +175,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,

omap_hwmod_enable(oh);

sys_timer_reserved |= (1 << (gptimer_id - 1));
if (omap_dm_timer_reserve_systimer(gptimer_id))
return -ENODEV;

if (gptimer_id != 12) {
struct clk *src;
Expand Down Expand Up @@ -501,10 +500,6 @@ 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;

pwrdm = omap_hwmod_get_pwrdm(oh);
pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
#ifdef CONFIG_PM
Expand Down
18 changes: 17 additions & 1 deletion trunk/arch/arm/plat-omap/dmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

#include <mach/hardware.h>

static u32 omap_reserved_systimers;
static LIST_HEAD(omap_timer_list);
static DEFINE_SPINLOCK(dm_timer_lock);

Expand Down Expand Up @@ -152,6 +153,21 @@ int omap_dm_timer_prepare(struct omap_dm_timer *timer)
return ret;
}

static inline u32 omap_dm_timer_reserved_systimer(int id)
{
return (omap_reserved_systimers & (1 << (id - 1))) ? 1 : 0;
}

int omap_dm_timer_reserve_systimer(int id)
{
if (omap_dm_timer_reserved_systimer(id))
return -ENODEV;

omap_reserved_systimers |= (1 << (id - 1));

return 0;
}

struct omap_dm_timer *omap_dm_timer_request(void)
{
struct omap_dm_timer *timer = NULL, *t;
Expand Down Expand Up @@ -674,7 +690,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->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;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/plat-omap/include/plat/dmtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ 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;

bool loses_context;

int (*get_context_loss_count)(struct device *dev);
};

int omap_dm_timer_reserve_systimer(int id);
struct omap_dm_timer *omap_dm_timer_request(void);
struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
int omap_dm_timer_free(struct omap_dm_timer *timer);
Expand Down

0 comments on commit 4c6af9b

Please sign in to comment.