aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/sibyte
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-10-18 23:28:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 11:52:41 -0400
commit02112dbc925f664bc4d24ff098686b9d21bfbfb1 (patch)
tree9ff51ea5a819ad3d828563d96121e5544b7b8eba /arch/mips/sibyte
parente232cfdc3d087d435c9ee767ddd4e6f52457d02a (diff)
mips: use bcd2bin/bin2bcd
Changes mips to use the new bcd2bin/bin2bcd functions instead of the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros. Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/sibyte')
-rw-r--r--arch/mips/sibyte/swarm/rtc_m41t81.c26
-rw-r--r--arch/mips/sibyte/swarm/rtc_xicor1241.c26
2 files changed, 26 insertions, 26 deletions
diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c
index 26fbff4c15b1..b732600b47f5 100644
--- a/arch/mips/sibyte/swarm/rtc_m41t81.c
+++ b/arch/mips/sibyte/swarm/rtc_m41t81.c
@@ -156,32 +156,32 @@ int m41t81_set_time(unsigned long t)
156 */ 156 */
157 157
158 spin_lock_irqsave(&rtc_lock, flags); 158 spin_lock_irqsave(&rtc_lock, flags);
159 tm.tm_sec = BIN2BCD(tm.tm_sec); 159 tm.tm_sec = bin2bcd(tm.tm_sec);
160 m41t81_write(M41T81REG_SC, tm.tm_sec); 160 m41t81_write(M41T81REG_SC, tm.tm_sec);
161 161
162 tm.tm_min = BIN2BCD(tm.tm_min); 162 tm.tm_min = bin2bcd(tm.tm_min);
163 m41t81_write(M41T81REG_MN, tm.tm_min); 163 m41t81_write(M41T81REG_MN, tm.tm_min);
164 164
165 tm.tm_hour = BIN2BCD(tm.tm_hour); 165 tm.tm_hour = bin2bcd(tm.tm_hour);
166 tm.tm_hour = (tm.tm_hour & 0x3f) | (m41t81_read(M41T81REG_HR) & 0xc0); 166 tm.tm_hour = (tm.tm_hour & 0x3f) | (m41t81_read(M41T81REG_HR) & 0xc0);
167 m41t81_write(M41T81REG_HR, tm.tm_hour); 167 m41t81_write(M41T81REG_HR, tm.tm_hour);
168 168
169 /* tm_wday starts from 0 to 6 */ 169 /* tm_wday starts from 0 to 6 */
170 if (tm.tm_wday == 0) tm.tm_wday = 7; 170 if (tm.tm_wday == 0) tm.tm_wday = 7;
171 tm.tm_wday = BIN2BCD(tm.tm_wday); 171 tm.tm_wday = bin2bcd(tm.tm_wday);
172 m41t81_write(M41T81REG_DY, tm.tm_wday); 172 m41t81_write(M41T81REG_DY, tm.tm_wday);
173 173
174 tm.tm_mday = BIN2BCD(tm.tm_mday); 174 tm.tm_mday = bin2bcd(tm.tm_mday);
175 m41t81_write(M41T81REG_DT, tm.tm_mday); 175 m41t81_write(M41T81REG_DT, tm.tm_mday);
176 176
177 /* tm_mon starts from 0, *ick* */ 177 /* tm_mon starts from 0, *ick* */
178 tm.tm_mon ++; 178 tm.tm_mon ++;
179 tm.tm_mon = BIN2BCD(tm.tm_mon); 179 tm.tm_mon = bin2bcd(tm.tm_mon);
180 m41t81_write(M41T81REG_MO, tm.tm_mon); 180 m41t81_write(M41T81REG_MO, tm.tm_mon);
181 181
182 /* we don't do century, everything is beyond 2000 */ 182 /* we don't do century, everything is beyond 2000 */
183 tm.tm_year %= 100; 183 tm.tm_year %= 100;
184 tm.tm_year = BIN2BCD(tm.tm_year); 184 tm.tm_year = bin2bcd(tm.tm_year);
185 m41t81_write(M41T81REG_YR, tm.tm_year); 185 m41t81_write(M41T81REG_YR, tm.tm_year);
186 spin_unlock_irqrestore(&rtc_lock, flags); 186 spin_unlock_irqrestore(&rtc_lock, flags);
187 187
@@ -209,12 +209,12 @@ unsigned long m41t81_get_time(void)
209 year = m41t81_read(M41T81REG_YR); 209 year = m41t81_read(M41T81REG_YR);
210 spin_unlock_irqrestore(&rtc_lock, flags); 210 spin_unlock_irqrestore(&rtc_lock, flags);
211 211
212 sec = BCD2BIN(sec); 212 sec = bcd2bin(sec);
213 min = BCD2BIN(min); 213 min = bcd2bin(min);
214 hour = BCD2BIN(hour); 214 hour = bcd2bin(hour);
215 day = BCD2BIN(day); 215 day = bcd2bin(day);
216 mon = BCD2BIN(mon); 216 mon = bcd2bin(mon);
217 year = BCD2BIN(year); 217 year = bcd2bin(year);
218 218
219 year += 2000; 219 year += 2000;
220 220
diff --git a/arch/mips/sibyte/swarm/rtc_xicor1241.c b/arch/mips/sibyte/swarm/rtc_xicor1241.c
index ff3e5dabb348..4438b2195c44 100644
--- a/arch/mips/sibyte/swarm/rtc_xicor1241.c
+++ b/arch/mips/sibyte/swarm/rtc_xicor1241.c
@@ -124,18 +124,18 @@ int xicor_set_time(unsigned long t)
124 xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL); 124 xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL);
125 125
126 /* trivial ones */ 126 /* trivial ones */
127 tm.tm_sec = BIN2BCD(tm.tm_sec); 127 tm.tm_sec = bin2bcd(tm.tm_sec);
128 xicor_write(X1241REG_SC, tm.tm_sec); 128 xicor_write(X1241REG_SC, tm.tm_sec);
129 129
130 tm.tm_min = BIN2BCD(tm.tm_min); 130 tm.tm_min = bin2bcd(tm.tm_min);
131 xicor_write(X1241REG_MN, tm.tm_min); 131 xicor_write(X1241REG_MN, tm.tm_min);
132 132
133 tm.tm_mday = BIN2BCD(tm.tm_mday); 133 tm.tm_mday = bin2bcd(tm.tm_mday);
134 xicor_write(X1241REG_DT, tm.tm_mday); 134 xicor_write(X1241REG_DT, tm.tm_mday);
135 135
136 /* tm_mon starts from 0, *ick* */ 136 /* tm_mon starts from 0, *ick* */
137 tm.tm_mon ++; 137 tm.tm_mon ++;
138 tm.tm_mon = BIN2BCD(tm.tm_mon); 138 tm.tm_mon = bin2bcd(tm.tm_mon);
139 xicor_write(X1241REG_MO, tm.tm_mon); 139 xicor_write(X1241REG_MO, tm.tm_mon);
140 140
141 /* year is split */ 141 /* year is split */
@@ -148,7 +148,7 @@ int xicor_set_time(unsigned long t)
148 tmp = xicor_read(X1241REG_HR); 148 tmp = xicor_read(X1241REG_HR);
149 if (tmp & X1241REG_HR_MIL) { 149 if (tmp & X1241REG_HR_MIL) {
150 /* 24 hour format */ 150 /* 24 hour format */
151 tm.tm_hour = BIN2BCD(tm.tm_hour); 151 tm.tm_hour = bin2bcd(tm.tm_hour);
152 tmp = (tmp & ~0x3f) | (tm.tm_hour & 0x3f); 152 tmp = (tmp & ~0x3f) | (tm.tm_hour & 0x3f);
153 } else { 153 } else {
154 /* 12 hour format, with 0x2 for pm */ 154 /* 12 hour format, with 0x2 for pm */
@@ -157,7 +157,7 @@ int xicor_set_time(unsigned long t)
157 tmp |= 0x20; 157 tmp |= 0x20;
158 tm.tm_hour -= 12; 158 tm.tm_hour -= 12;
159 } 159 }
160 tm.tm_hour = BIN2BCD(tm.tm_hour); 160 tm.tm_hour = bin2bcd(tm.tm_hour);
161 tmp |= tm.tm_hour; 161 tmp |= tm.tm_hour;
162 } 162 }
163 xicor_write(X1241REG_HR, tmp); 163 xicor_write(X1241REG_HR, tmp);
@@ -191,13 +191,13 @@ unsigned long xicor_get_time(void)
191 y2k = xicor_read(X1241REG_Y2K); 191 y2k = xicor_read(X1241REG_Y2K);
192 spin_unlock_irqrestore(&rtc_lock, flags); 192 spin_unlock_irqrestore(&rtc_lock, flags);
193 193
194 sec = BCD2BIN(sec); 194 sec = bcd2bin(sec);
195 min = BCD2BIN(min); 195 min = bcd2bin(min);
196 hour = BCD2BIN(hour); 196 hour = bcd2bin(hour);
197 day = BCD2BIN(day); 197 day = bcd2bin(day);
198 mon = BCD2BIN(mon); 198 mon = bcd2bin(mon);
199 year = BCD2BIN(year); 199 year = bcd2bin(year);
200 y2k = BCD2BIN(y2k); 200 y2k = bcd2bin(y2k);
201 201
202 year += (y2k * 100); 202 year += (y2k * 100);
203 203