diff options
Diffstat (limited to 'drivers/rtc/rtc-rs5c313.c')
-rw-r--r-- | drivers/rtc/rtc-rs5c313.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-rs5c313.c b/drivers/rtc/rtc-rs5c313.c index 1c14d4497c4d..e6ea3f5ee1eb 100644 --- a/drivers/rtc/rtc-rs5c313.c +++ b/drivers/rtc/rtc-rs5c313.c | |||
@@ -235,33 +235,33 @@ static int rs5c313_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
235 | 235 | ||
236 | data = rs5c313_read_reg(RS5C313_ADDR_SEC); | 236 | data = rs5c313_read_reg(RS5C313_ADDR_SEC); |
237 | data |= (rs5c313_read_reg(RS5C313_ADDR_SEC10) << 4); | 237 | data |= (rs5c313_read_reg(RS5C313_ADDR_SEC10) << 4); |
238 | tm->tm_sec = BCD2BIN(data); | 238 | tm->tm_sec = bcd2bin(data); |
239 | 239 | ||
240 | data = rs5c313_read_reg(RS5C313_ADDR_MIN); | 240 | data = rs5c313_read_reg(RS5C313_ADDR_MIN); |
241 | data |= (rs5c313_read_reg(RS5C313_ADDR_MIN10) << 4); | 241 | data |= (rs5c313_read_reg(RS5C313_ADDR_MIN10) << 4); |
242 | tm->tm_min = BCD2BIN(data); | 242 | tm->tm_min = bcd2bin(data); |
243 | 243 | ||
244 | data = rs5c313_read_reg(RS5C313_ADDR_HOUR); | 244 | data = rs5c313_read_reg(RS5C313_ADDR_HOUR); |
245 | data |= (rs5c313_read_reg(RS5C313_ADDR_HOUR10) << 4); | 245 | data |= (rs5c313_read_reg(RS5C313_ADDR_HOUR10) << 4); |
246 | tm->tm_hour = BCD2BIN(data); | 246 | tm->tm_hour = bcd2bin(data); |
247 | 247 | ||
248 | data = rs5c313_read_reg(RS5C313_ADDR_DAY); | 248 | data = rs5c313_read_reg(RS5C313_ADDR_DAY); |
249 | data |= (rs5c313_read_reg(RS5C313_ADDR_DAY10) << 4); | 249 | data |= (rs5c313_read_reg(RS5C313_ADDR_DAY10) << 4); |
250 | tm->tm_mday = BCD2BIN(data); | 250 | tm->tm_mday = bcd2bin(data); |
251 | 251 | ||
252 | data = rs5c313_read_reg(RS5C313_ADDR_MON); | 252 | data = rs5c313_read_reg(RS5C313_ADDR_MON); |
253 | data |= (rs5c313_read_reg(RS5C313_ADDR_MON10) << 4); | 253 | data |= (rs5c313_read_reg(RS5C313_ADDR_MON10) << 4); |
254 | tm->tm_mon = BCD2BIN(data) - 1; | 254 | tm->tm_mon = bcd2bin(data) - 1; |
255 | 255 | ||
256 | data = rs5c313_read_reg(RS5C313_ADDR_YEAR); | 256 | data = rs5c313_read_reg(RS5C313_ADDR_YEAR); |
257 | data |= (rs5c313_read_reg(RS5C313_ADDR_YEAR10) << 4); | 257 | data |= (rs5c313_read_reg(RS5C313_ADDR_YEAR10) << 4); |
258 | tm->tm_year = BCD2BIN(data); | 258 | tm->tm_year = bcd2bin(data); |
259 | 259 | ||
260 | if (tm->tm_year < 70) | 260 | if (tm->tm_year < 70) |
261 | tm->tm_year += 100; | 261 | tm->tm_year += 100; |
262 | 262 | ||
263 | data = rs5c313_read_reg(RS5C313_ADDR_WEEK); | 263 | data = rs5c313_read_reg(RS5C313_ADDR_WEEK); |
264 | tm->tm_wday = BCD2BIN(data); | 264 | tm->tm_wday = bcd2bin(data); |
265 | 265 | ||
266 | RS5C313_CEDISABLE; | 266 | RS5C313_CEDISABLE; |
267 | ndelay(700); /* CE:L */ | 267 | ndelay(700); /* CE:L */ |
@@ -294,31 +294,31 @@ static int rs5c313_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
294 | } | 294 | } |
295 | } | 295 | } |
296 | 296 | ||
297 | data = BIN2BCD(tm->tm_sec); | 297 | data = bin2bcd(tm->tm_sec); |
298 | rs5c313_write_reg(RS5C313_ADDR_SEC, data); | 298 | rs5c313_write_reg(RS5C313_ADDR_SEC, data); |
299 | rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4)); | 299 | rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4)); |
300 | 300 | ||
301 | data = BIN2BCD(tm->tm_min); | 301 | data = bin2bcd(tm->tm_min); |
302 | rs5c313_write_reg(RS5C313_ADDR_MIN, data ); | 302 | rs5c313_write_reg(RS5C313_ADDR_MIN, data ); |
303 | rs5c313_write_reg(RS5C313_ADDR_MIN10, (data >> 4)); | 303 | rs5c313_write_reg(RS5C313_ADDR_MIN10, (data >> 4)); |
304 | 304 | ||
305 | data = BIN2BCD(tm->tm_hour); | 305 | data = bin2bcd(tm->tm_hour); |
306 | rs5c313_write_reg(RS5C313_ADDR_HOUR, data); | 306 | rs5c313_write_reg(RS5C313_ADDR_HOUR, data); |
307 | rs5c313_write_reg(RS5C313_ADDR_HOUR10, (data >> 4)); | 307 | rs5c313_write_reg(RS5C313_ADDR_HOUR10, (data >> 4)); |
308 | 308 | ||
309 | data = BIN2BCD(tm->tm_mday); | 309 | data = bin2bcd(tm->tm_mday); |
310 | rs5c313_write_reg(RS5C313_ADDR_DAY, data); | 310 | rs5c313_write_reg(RS5C313_ADDR_DAY, data); |
311 | rs5c313_write_reg(RS5C313_ADDR_DAY10, (data>> 4)); | 311 | rs5c313_write_reg(RS5C313_ADDR_DAY10, (data>> 4)); |
312 | 312 | ||
313 | data = BIN2BCD(tm->tm_mon + 1); | 313 | data = bin2bcd(tm->tm_mon + 1); |
314 | rs5c313_write_reg(RS5C313_ADDR_MON, data); | 314 | rs5c313_write_reg(RS5C313_ADDR_MON, data); |
315 | rs5c313_write_reg(RS5C313_ADDR_MON10, (data >> 4)); | 315 | rs5c313_write_reg(RS5C313_ADDR_MON10, (data >> 4)); |
316 | 316 | ||
317 | data = BIN2BCD(tm->tm_year % 100); | 317 | data = bin2bcd(tm->tm_year % 100); |
318 | rs5c313_write_reg(RS5C313_ADDR_YEAR, data); | 318 | rs5c313_write_reg(RS5C313_ADDR_YEAR, data); |
319 | rs5c313_write_reg(RS5C313_ADDR_YEAR10, (data >> 4)); | 319 | rs5c313_write_reg(RS5C313_ADDR_YEAR10, (data >> 4)); |
320 | 320 | ||
321 | data = BIN2BCD(tm->tm_wday); | 321 | data = bin2bcd(tm->tm_wday); |
322 | rs5c313_write_reg(RS5C313_ADDR_WEEK, data); | 322 | rs5c313_write_reg(RS5C313_ADDR_WEEK, data); |
323 | 323 | ||
324 | RS5C313_CEDISABLE; /* CE:H */ | 324 | RS5C313_CEDISABLE; /* CE:H */ |