rtc-rs5c313.c (f838bad1b3be8ca0c785ee0e0c570dfda74cf377) rtc-rs5c313.c (2a4e2b8780c6df42b19c053243dada7fa4d311ee)
1/*
2 * Ricoh RS5C313 RTC device/driver
3 * Copyright (C) 2007 Nobuhiro Iwamatsu
4 *
5 * 2005-09-19 modifed by kogiidena
6 *
7 * Based on the old drivers/char/rs5c313_rtc.c by:
8 * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>

--- 214 unchanged lines hidden (view full) ---

223
224 if (!(rs5c313_read_cntreg() & RS5C313_CNTREG_ADJ_BSY))
225 break;
226
227 RS5C313_CEDISABLE;
228 ndelay(700); /* CE:L */
229
230 if (cnt++ > 100) {
1/*
2 * Ricoh RS5C313 RTC device/driver
3 * Copyright (C) 2007 Nobuhiro Iwamatsu
4 *
5 * 2005-09-19 modifed by kogiidena
6 *
7 * Based on the old drivers/char/rs5c313_rtc.c by:
8 * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>

--- 214 unchanged lines hidden (view full) ---

223
224 if (!(rs5c313_read_cntreg() & RS5C313_CNTREG_ADJ_BSY))
225 break;
226
227 RS5C313_CEDISABLE;
228 ndelay(700); /* CE:L */
229
230 if (cnt++ > 100) {
231 dev_err(dev, "%s: timeout error\n", __FUNCTION__);
231 dev_err(dev, "%s: timeout error\n", __func__);
232 return -EIO;
233 }
234 }
235
236 data = rs5c313_read_reg(RS5C313_ADDR_SEC);
237 data |= (rs5c313_read_reg(RS5C313_ADDR_SEC10) << 4);
238 tm->tm_sec = BCD2BIN(data);
239

--- 44 unchanged lines hidden (view full) ---

284
285 if (!(rs5c313_read_cntreg() & RS5C313_CNTREG_ADJ_BSY))
286 break;
287 RS5C313_MISCOP;
288 RS5C313_CEDISABLE;
289 ndelay(700); /* CE:L */
290
291 if (cnt++ > 100) {
232 return -EIO;
233 }
234 }
235
236 data = rs5c313_read_reg(RS5C313_ADDR_SEC);
237 data |= (rs5c313_read_reg(RS5C313_ADDR_SEC10) << 4);
238 tm->tm_sec = BCD2BIN(data);
239

--- 44 unchanged lines hidden (view full) ---

284
285 if (!(rs5c313_read_cntreg() & RS5C313_CNTREG_ADJ_BSY))
286 break;
287 RS5C313_MISCOP;
288 RS5C313_CEDISABLE;
289 ndelay(700); /* CE:L */
290
291 if (cnt++ > 100) {
292 dev_err(dev, "%s: timeout error\n", __FUNCTION__);
292 dev_err(dev, "%s: timeout error\n", __func__);
293 return -EIO;
294 }
295 }
296
297 data = BIN2BCD(tm->tm_sec);
298 rs5c313_write_reg(RS5C313_ADDR_SEC, data);
299 rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4));
300

--- 124 unchanged lines hidden ---
293 return -EIO;
294 }
295 }
296
297 data = BIN2BCD(tm->tm_sec);
298 rs5c313_write_reg(RS5C313_ADDR_SEC, data);
299 rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4));
300

--- 124 unchanged lines hidden ---