diff options
Diffstat (limited to 'drivers/char/mmtimer.c')
-rw-r--r-- | drivers/char/mmtimer.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index e6d75627c6c8..33dc2298af73 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -53,6 +53,8 @@ MODULE_LICENSE("GPL"); | |||
53 | 53 | ||
54 | #define RTC_BITS 55 /* 55 bits for this implementation */ | 54 | #define RTC_BITS 55 /* 55 bits for this implementation */ |
55 | 55 | ||
56 | static struct k_clock sgi_clock; | ||
57 | |||
56 | extern unsigned long sn_rtc_cycles_per_second; | 58 | extern unsigned long sn_rtc_cycles_per_second; |
57 | 59 | ||
58 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) | 60 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) |
@@ -487,7 +489,7 @@ static int sgi_clock_get(clockid_t clockid, struct timespec *tp) | |||
487 | return 0; | 489 | return 0; |
488 | }; | 490 | }; |
489 | 491 | ||
490 | static int sgi_clock_set(clockid_t clockid, struct timespec *tp) | 492 | static int sgi_clock_set(const clockid_t clockid, const struct timespec *tp) |
491 | { | 493 | { |
492 | 494 | ||
493 | u64 nsec; | 495 | u64 nsec; |
@@ -763,15 +765,21 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, | |||
763 | return err; | 765 | return err; |
764 | } | 766 | } |
765 | 767 | ||
768 | static int sgi_clock_getres(const clockid_t which_clock, struct timespec *tp) | ||
769 | { | ||
770 | tp->tv_sec = 0; | ||
771 | tp->tv_nsec = sgi_clock_period; | ||
772 | return 0; | ||
773 | } | ||
774 | |||
766 | static struct k_clock sgi_clock = { | 775 | static struct k_clock sgi_clock = { |
767 | .res = 0, | 776 | .clock_set = sgi_clock_set, |
768 | .clock_set = sgi_clock_set, | 777 | .clock_get = sgi_clock_get, |
769 | .clock_get = sgi_clock_get, | 778 | .clock_getres = sgi_clock_getres, |
770 | .timer_create = sgi_timer_create, | 779 | .timer_create = sgi_timer_create, |
771 | .nsleep = do_posix_clock_nonanosleep, | 780 | .timer_set = sgi_timer_set, |
772 | .timer_set = sgi_timer_set, | 781 | .timer_del = sgi_timer_del, |
773 | .timer_del = sgi_timer_del, | 782 | .timer_get = sgi_timer_get |
774 | .timer_get = sgi_timer_get | ||
775 | }; | 783 | }; |
776 | 784 | ||
777 | /** | 785 | /** |
@@ -831,8 +839,8 @@ static int __init mmtimer_init(void) | |||
831 | (unsigned long) node); | 839 | (unsigned long) node); |
832 | } | 840 | } |
833 | 841 | ||
834 | sgi_clock_period = sgi_clock.res = NSEC_PER_SEC / sn_rtc_cycles_per_second; | 842 | sgi_clock_period = NSEC_PER_SEC / sn_rtc_cycles_per_second; |
835 | register_posix_clock(CLOCK_SGI_CYCLE, &sgi_clock); | 843 | posix_timers_register_clock(CLOCK_SGI_CYCLE, &sgi_clock); |
836 | 844 | ||
837 | printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION, | 845 | printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION, |
838 | sn_rtc_cycles_per_second/(unsigned long)1E6); | 846 | sn_rtc_cycles_per_second/(unsigned long)1E6); |