summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorXunlei Pang <pang.xunlei@linaro.org>2015-06-11 23:10:17 -0400
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-06-24 19:13:43 -0400
commit460ea8d70db1ffd9a5d6996c240c34458473334f (patch)
tree2c487bc17c7334a0d59de075830911c9335de919 /arch/sparc
parent9c5150b31b49e3d89c52df9b1c1ebcea4e665ec3 (diff)
sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC
On Sparc systems, update_persistent_clock() uses RTC drivers to do the job, it makes more sense to hand it over to CONFIG_RTC_SYSTOHC. In the long run, all the update_persistent_clock() should migrate to proper class RTC drivers if any and use CONFIG_RTC_SYSTOHC instead. Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/kernel/time_32.c21
-rw-r--r--arch/sparc/kernel/time_64.c14
3 files changed, 1 insertions, 36 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index e49502acbab4..56442d2d7bbc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -25,6 +25,7 @@ config SPARC
25 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 25 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
26 select RTC_CLASS 26 select RTC_CLASS
27 select RTC_DRV_M48T59 27 select RTC_DRV_M48T59
28 select RTC_SYSTOHC
28 select HAVE_DMA_ATTRS 29 select HAVE_DMA_ATTRS
29 select HAVE_DMA_API_DEBUG 30 select HAVE_DMA_API_DEBUG
30 select HAVE_ARCH_JUMP_LABEL if SPARC64 31 select HAVE_ARCH_JUMP_LABEL if SPARC64
@@ -35,7 +36,6 @@ config SPARC
35 select HAVE_BPF_JIT 36 select HAVE_BPF_JIT
36 select HAVE_DEBUG_BUGVERBOSE 37 select HAVE_DEBUG_BUGVERBOSE
37 select GENERIC_SMP_IDLE_THREAD 38 select GENERIC_SMP_IDLE_THREAD
38 select GENERIC_CMOS_UPDATE
39 select GENERIC_CLOCKEVENTS 39 select GENERIC_CLOCKEVENTS
40 select GENERIC_STRNCPY_FROM_USER 40 select GENERIC_STRNCPY_FROM_USER
41 select GENERIC_STRNLEN_USER 41 select GENERIC_STRNLEN_USER
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 8caf45ee81d9..c9692f387cee 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -23,7 +23,6 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/rtc.h>
27#include <linux/rtc/m48t59.h> 26#include <linux/rtc/m48t59.h>
28#include <linux/timex.h> 27#include <linux/timex.h>
29#include <linux/clocksource.h> 28#include <linux/clocksource.h>
@@ -65,8 +64,6 @@ DEFINE_PER_CPU(struct clock_event_device, sparc32_clockevent);
65DEFINE_SPINLOCK(rtc_lock); 64DEFINE_SPINLOCK(rtc_lock);
66EXPORT_SYMBOL(rtc_lock); 65EXPORT_SYMBOL(rtc_lock);
67 66
68static int set_rtc_mmss(unsigned long);
69
70unsigned long profile_pc(struct pt_regs *regs) 67unsigned long profile_pc(struct pt_regs *regs)
71{ 68{
72 extern char __copy_user_begin[], __copy_user_end[]; 69 extern char __copy_user_begin[], __copy_user_end[];
@@ -87,11 +84,6 @@ EXPORT_SYMBOL(profile_pc);
87 84
88volatile u32 __iomem *master_l10_counter; 85volatile u32 __iomem *master_l10_counter;
89 86
90int update_persistent_clock(struct timespec now)
91{
92 return set_rtc_mmss(now.tv_sec);
93}
94
95irqreturn_t notrace timer_interrupt(int dummy, void *dev_id) 87irqreturn_t notrace timer_interrupt(int dummy, void *dev_id)
96{ 88{
97 if (timer_cs_enabled) { 89 if (timer_cs_enabled) {
@@ -362,16 +354,3 @@ void __init time_init(void)
362 sbus_time_init(); 354 sbus_time_init();
363} 355}
364 356
365
366static int set_rtc_mmss(unsigned long secs)
367{
368 struct rtc_device *rtc = rtc_class_open("rtc0");
369 int err = -1;
370
371 if (rtc) {
372 err = rtc_set_mmss(rtc, secs);
373 rtc_class_close(rtc);
374 }
375
376 return err;
377}
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index edbbeb157d46..2e6035c0a8ca 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -28,7 +28,6 @@
28#include <linux/cpufreq.h> 28#include <linux/cpufreq.h>
29#include <linux/percpu.h> 29#include <linux/percpu.h>
30#include <linux/miscdevice.h> 30#include <linux/miscdevice.h>
31#include <linux/rtc.h>
32#include <linux/rtc/m48t59.h> 31#include <linux/rtc/m48t59.h>
33#include <linux/kernel_stat.h> 32#include <linux/kernel_stat.h>
34#include <linux/clockchips.h> 33#include <linux/clockchips.h>
@@ -394,19 +393,6 @@ static struct sparc64_tick_ops hbtick_operations __read_mostly = {
394 393
395static unsigned long timer_ticks_per_nsec_quotient __read_mostly; 394static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
396 395
397int update_persistent_clock(struct timespec now)
398{
399 struct rtc_device *rtc = rtc_class_open("rtc0");
400 int err = -1;
401
402 if (rtc) {
403 err = rtc_set_mmss(rtc, now.tv_sec);
404 rtc_class_close(rtc);
405 }
406
407 return err;
408}
409
410unsigned long cmos_regs; 396unsigned long cmos_regs;
411EXPORT_SYMBOL(cmos_regs); 397EXPORT_SYMBOL(cmos_regs);
412 398