rtc-r9701.c (bba73071b6f71be0a101658d7c13866e30b264a6) | rtc-r9701.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0) |
---|---|
1/* 2 * Driver for Epson RTC-9701JE 3 * 4 * Copyright (C) 2008 Magnus Damm 5 * 6 * Based on rtc-max6902.c 7 * 8 * Copyright (C) 2006 8D Technologies inc. --- 78 unchanged lines hidden (view full) --- 87 dt->tm_mday = bcd2bin(buf[3]); /* RDAYCNT */ 88 dt->tm_mon = bcd2bin(buf[4]) - 1; /* RMONCNT */ 89 dt->tm_year = bcd2bin(buf[5]) + 100; /* RYRCNT */ 90 91 /* the rtc device may contain illegal values on power up 92 * according to the data sheet. make sure they are valid. 93 */ 94 | 1/* 2 * Driver for Epson RTC-9701JE 3 * 4 * Copyright (C) 2008 Magnus Damm 5 * 6 * Based on rtc-max6902.c 7 * 8 * Copyright (C) 2006 8D Technologies inc. --- 78 unchanged lines hidden (view full) --- 87 dt->tm_mday = bcd2bin(buf[3]); /* RDAYCNT */ 88 dt->tm_mon = bcd2bin(buf[4]) - 1; /* RMONCNT */ 89 dt->tm_year = bcd2bin(buf[5]) + 100; /* RYRCNT */ 90 91 /* the rtc device may contain illegal values on power up 92 * according to the data sheet. make sure they are valid. 93 */ 94 |
95 return rtc_valid_tm(dt); | 95 return 0; |
96} 97 98static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) 99{ 100 int ret, year; 101 102 year = dt->tm_year + 1900; 103 if (year >= 2100 || year < 2000) --- 76 unchanged lines hidden --- | 96} 97 98static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) 99{ 100 int ret, year; 101 102 year = dt->tm_year + 1900; 103 if (year >= 2100 || year < 2000) --- 76 unchanged lines hidden --- |