Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249918
b: refs/heads/master
c: 933e54a
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed May 23, 2011
1 parent 324d02d commit a208e9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 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: 5c61ddcfaf98fae4a0ac8077b06a07fb2ba6864a
refs/heads/master: 933e54a53ccb68543ffb7ea32168ea086c93d09a
23 changes: 6 additions & 17 deletions trunk/arch/arm/mach-omap1/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,24 +190,11 @@ static __init void omap_init_mpu_timer(unsigned long rate)
* ---------------------------------------------------------------------------
*/

static cycle_t mpu_read(struct clocksource *cs)
{
return ~omap_mpu_timer_read(1);
}

static struct clocksource clocksource_mpu = {
.name = "mpu_timer2",
.rating = 300,
.read = mpu_read,
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static DEFINE_CLOCK_DATA(cd);

static inline unsigned long long notrace _omap_mpu_sched_clock(void)
{
u32 cyc = mpu_read(&clocksource_mpu);
u32 cyc = ~omap_mpu_timer_read(1);
return cyc_to_sched_clock(&cd, cyc, (u32)~0);
}

Expand All @@ -225,20 +212,22 @@ static unsigned long long notrace omap_mpu_sched_clock(void)

static void notrace mpu_update_sched_clock(void)
{
u32 cyc = mpu_read(&clocksource_mpu);
u32 cyc = ~omap_mpu_timer_read(1);
update_sched_clock(&cd, cyc, (u32)~0);
}

static void __init omap_init_clocksource(unsigned long rate)
{
omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(1);
static char err[] __initdata = KERN_ERR
"%s: can't register clocksource!\n";

omap_mpu_timer_start(1, ~0, 1);
init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);

if (clocksource_register_hz(&clocksource_mpu, rate))
printk(err, clocksource_mpu.name);
if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate,
300, 32, clocksource_mmio_readl_down))
printk(err, "mpu_timer2");
}

static void __init omap_mpu_timer_init(void)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/plat-omap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ choice
config ARCH_OMAP1
bool "TI OMAP1"
select CLKDEV_LOOKUP
select CLKSRC_MMIO
help
"Systems based on omap7xx, omap15xx or omap16xx"

Expand Down

0 comments on commit a208e9f

Please sign in to comment.