Mark Salter | 730c1fa | 2010-10-27 17:28:57 +0100 | [diff] [blame] | 1 | /* MN10300 clocksource |
| 2 | * |
| 3 | * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by Mark Salter (msalter@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public Licence |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the Licence, or (at your option) any later version. |
| 10 | */ |
| 11 | #include <linux/clocksource.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <asm/timex.h> |
| 14 | #include "internal.h" |
| 15 | |
| 16 | static cycle_t mn10300_read(struct clocksource *cs) |
| 17 | { |
| 18 | return read_timestamp_counter(); |
| 19 | } |
| 20 | |
| 21 | static struct clocksource clocksource_mn10300 = { |
| 22 | .name = "TSC", |
| 23 | .rating = 200, |
| 24 | .read = mn10300_read, |
| 25 | .mask = CLOCKSOURCE_MASK(32), |
| 26 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 27 | }; |
| 28 | |
| 29 | int __init init_clocksource(void) |
| 30 | { |
| 31 | startup_timestamp_counter(); |
Thomas Gleixner | 817890b | 2011-03-18 16:52:50 +0000 | [diff] [blame] | 32 | clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK); |
Mark Salter | 730c1fa | 2010-10-27 17:28:57 +0100 | [diff] [blame] | 33 | return 0; |
| 34 | } |