rtc-ds1307.c (59458f40e25915a355d8b1d701425fe9f4f9ea23) | rtc-ds1307.c (11966adc33fa1504c2d9a78e6fc129e5c87bdee1) |
---|---|
1/* 2 * rtc-ds1307.c - RTC driver for some mostly-compatible I2C chips. 3 * 4 * Copyright (C) 2005 James Chapman (ds1337 core) 5 * Copyright (C) 2006 David Brownell 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 127 unchanged lines hidden (view full) --- 136{ 137 struct ds1307 *ds1307 = dev_get_drvdata(dev); 138 int result; 139 int tmp; 140 u8 *buf = ds1307->regs; 141 142 dev_dbg(dev, "%s secs=%d, mins=%d, " 143 "hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n", | 1/* 2 * rtc-ds1307.c - RTC driver for some mostly-compatible I2C chips. 3 * 4 * Copyright (C) 2005 James Chapman (ds1337 core) 5 * Copyright (C) 2006 David Brownell 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 127 unchanged lines hidden (view full) --- 136{ 137 struct ds1307 *ds1307 = dev_get_drvdata(dev); 138 int result; 139 int tmp; 140 u8 *buf = ds1307->regs; 141 142 dev_dbg(dev, "%s secs=%d, mins=%d, " 143 "hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n", |
144 "write", dt->tm_sec, dt->tm_min, 145 dt->tm_hour, dt->tm_mday, 146 dt->tm_mon, dt->tm_year, dt->tm_wday); | 144 "write", t->tm_sec, t->tm_min, 145 t->tm_hour, t->tm_mday, 146 t->tm_mon, t->tm_year, t->tm_wday); |
147 148 *buf++ = 0; /* first register addr */ 149 buf[DS1307_REG_SECS] = BIN2BCD(t->tm_sec); 150 buf[DS1307_REG_MIN] = BIN2BCD(t->tm_min); 151 buf[DS1307_REG_HOUR] = BIN2BCD(t->tm_hour); 152 buf[DS1307_REG_WDAY] = BIN2BCD(t->tm_wday + 1); 153 buf[DS1307_REG_MDAY] = BIN2BCD(t->tm_mday); 154 buf[DS1307_REG_MONTH] = BIN2BCD(t->tm_mon + 1); --- 234 unchanged lines hidden --- | 147 148 *buf++ = 0; /* first register addr */ 149 buf[DS1307_REG_SECS] = BIN2BCD(t->tm_sec); 150 buf[DS1307_REG_MIN] = BIN2BCD(t->tm_min); 151 buf[DS1307_REG_HOUR] = BIN2BCD(t->tm_hour); 152 buf[DS1307_REG_WDAY] = BIN2BCD(t->tm_wday + 1); 153 buf[DS1307_REG_MDAY] = BIN2BCD(t->tm_mday); 154 buf[DS1307_REG_MONTH] = BIN2BCD(t->tm_mon + 1); --- 234 unchanged lines hidden --- |