diff options
Diffstat (limited to 'arch/sh/boards/mach-sh03/rtc.c')
-rw-r--r-- | arch/sh/boards/mach-sh03/rtc.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/arch/sh/boards/mach-sh03/rtc.c b/arch/sh/boards/mach-sh03/rtc.c index a8b9f844ab5b..1b200990500c 100644 --- a/arch/sh/boards/mach-sh03/rtc.c +++ b/arch/sh/boards/mach-sh03/rtc.c | |||
@@ -44,15 +44,15 @@ unsigned long get_cmos_time(void) | |||
44 | spin_lock(&sh03_rtc_lock); | 44 | spin_lock(&sh03_rtc_lock); |
45 | again: | 45 | again: |
46 | do { | 46 | do { |
47 | sec = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10; | 47 | sec = (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10; |
48 | min = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10; | 48 | min = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10; |
49 | hour = (ctrl_inb(RTC_HOU1) & 0xf) + (ctrl_inb(RTC_HOU10) & 0xf) * 10; | 49 | hour = (__raw_readb(RTC_HOU1) & 0xf) + (__raw_readb(RTC_HOU10) & 0xf) * 10; |
50 | day = (ctrl_inb(RTC_DAY1) & 0xf) + (ctrl_inb(RTC_DAY10) & 0xf) * 10; | 50 | day = (__raw_readb(RTC_DAY1) & 0xf) + (__raw_readb(RTC_DAY10) & 0xf) * 10; |
51 | mon = (ctrl_inb(RTC_MON1) & 0xf) + (ctrl_inb(RTC_MON10) & 0xf) * 10; | 51 | mon = (__raw_readb(RTC_MON1) & 0xf) + (__raw_readb(RTC_MON10) & 0xf) * 10; |
52 | year = (ctrl_inb(RTC_YEA1) & 0xf) + (ctrl_inb(RTC_YEA10) & 0xf) * 10 | 52 | year = (__raw_readb(RTC_YEA1) & 0xf) + (__raw_readb(RTC_YEA10) & 0xf) * 10 |
53 | + (ctrl_inb(RTC_YEA100 ) & 0xf) * 100 | 53 | + (__raw_readb(RTC_YEA100 ) & 0xf) * 100 |
54 | + (ctrl_inb(RTC_YEA1000) & 0xf) * 1000; | 54 | + (__raw_readb(RTC_YEA1000) & 0xf) * 1000; |
55 | } while (sec != (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10); | 55 | } while (sec != (__raw_readb(RTC_SEC1) & 0xf) + (__raw_readb(RTC_SEC10) & 0x7) * 10); |
56 | if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 || | 56 | if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 || |
57 | hour > 23 || min > 59 || sec > 59) { | 57 | hour > 23 || min > 59 || sec > 59) { |
58 | printk(KERN_ERR | 58 | printk(KERN_ERR |
@@ -60,16 +60,16 @@ unsigned long get_cmos_time(void) | |||
60 | printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n", | 60 | printk("year=%d, mon=%d, day=%d, hour=%d, min=%d, sec=%d\n", |
61 | year, mon, day, hour, min, sec); | 61 | year, mon, day, hour, min, sec); |
62 | 62 | ||
63 | ctrl_outb(0, RTC_SEC1); ctrl_outb(0, RTC_SEC10); | 63 | __raw_writeb(0, RTC_SEC1); __raw_writeb(0, RTC_SEC10); |
64 | ctrl_outb(0, RTC_MIN1); ctrl_outb(0, RTC_MIN10); | 64 | __raw_writeb(0, RTC_MIN1); __raw_writeb(0, RTC_MIN10); |
65 | ctrl_outb(0, RTC_HOU1); ctrl_outb(0, RTC_HOU10); | 65 | __raw_writeb(0, RTC_HOU1); __raw_writeb(0, RTC_HOU10); |
66 | ctrl_outb(6, RTC_WEE1); | 66 | __raw_writeb(6, RTC_WEE1); |
67 | ctrl_outb(1, RTC_DAY1); ctrl_outb(0, RTC_DAY10); | 67 | __raw_writeb(1, RTC_DAY1); __raw_writeb(0, RTC_DAY10); |
68 | ctrl_outb(1, RTC_MON1); ctrl_outb(0, RTC_MON10); | 68 | __raw_writeb(1, RTC_MON1); __raw_writeb(0, RTC_MON10); |
69 | ctrl_outb(0, RTC_YEA1); ctrl_outb(0, RTC_YEA10); | 69 | __raw_writeb(0, RTC_YEA1); __raw_writeb(0, RTC_YEA10); |
70 | ctrl_outb(0, RTC_YEA100); | 70 | __raw_writeb(0, RTC_YEA100); |
71 | ctrl_outb(2, RTC_YEA1000); | 71 | __raw_writeb(2, RTC_YEA1000); |
72 | ctrl_outb(0, RTC_CTL); | 72 | __raw_writeb(0, RTC_CTL); |
73 | goto again; | 73 | goto again; |
74 | } | 74 | } |
75 | 75 | ||
@@ -93,9 +93,9 @@ static int set_rtc_mmss(unsigned long nowtime) | |||
93 | /* gets recalled with irq locally disabled */ | 93 | /* gets recalled with irq locally disabled */ |
94 | spin_lock(&sh03_rtc_lock); | 94 | spin_lock(&sh03_rtc_lock); |
95 | for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ | 95 | for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ |
96 | if (!(ctrl_inb(RTC_CTL) & RTC_BUSY)) | 96 | if (!(__raw_readb(RTC_CTL) & RTC_BUSY)) |
97 | break; | 97 | break; |
98 | cmos_minutes = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10; | 98 | cmos_minutes = (__raw_readb(RTC_MIN1) & 0xf) + (__raw_readb(RTC_MIN10) & 0xf) * 10; |
99 | real_seconds = nowtime % 60; | 99 | real_seconds = nowtime % 60; |
100 | real_minutes = nowtime / 60; | 100 | real_minutes = nowtime / 60; |
101 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) | 101 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) |
@@ -103,10 +103,10 @@ static int set_rtc_mmss(unsigned long nowtime) | |||
103 | real_minutes %= 60; | 103 | real_minutes %= 60; |
104 | 104 | ||
105 | if (abs(real_minutes - cmos_minutes) < 30) { | 105 | if (abs(real_minutes - cmos_minutes) < 30) { |
106 | ctrl_outb(real_seconds % 10, RTC_SEC1); | 106 | __raw_writeb(real_seconds % 10, RTC_SEC1); |
107 | ctrl_outb(real_seconds / 10, RTC_SEC10); | 107 | __raw_writeb(real_seconds / 10, RTC_SEC10); |
108 | ctrl_outb(real_minutes % 10, RTC_MIN1); | 108 | __raw_writeb(real_minutes % 10, RTC_MIN1); |
109 | ctrl_outb(real_minutes / 10, RTC_MIN10); | 109 | __raw_writeb(real_minutes / 10, RTC_MIN10); |
110 | } else { | 110 | } else { |
111 | printk(KERN_WARNING | 111 | printk(KERN_WARNING |
112 | "set_rtc_mmss: can't update from %d to %d\n", | 112 | "set_rtc_mmss: can't update from %d to %d\n", |