rtc-rx8010.c (10a558374f3751cf4eb55143008975641dfc2cf4) | rtc-rx8010.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0) |
---|---|
1/* 2 * Driver for the Epson RTC module RX-8010 SJ 3 * 4 * Copyright(C) Timesys Corporation 2015 5 * Copyright(C) General Electric Company 2015 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 --- 124 unchanged lines hidden (view full) --- 133 dt->tm_sec = bcd2bin(date[RX8010_SEC - RX8010_SEC] & 0x7f); 134 dt->tm_min = bcd2bin(date[RX8010_MIN - RX8010_SEC] & 0x7f); 135 dt->tm_hour = bcd2bin(date[RX8010_HOUR - RX8010_SEC] & 0x3f); 136 dt->tm_mday = bcd2bin(date[RX8010_MDAY - RX8010_SEC] & 0x3f); 137 dt->tm_mon = bcd2bin(date[RX8010_MONTH - RX8010_SEC] & 0x1f) - 1; 138 dt->tm_year = bcd2bin(date[RX8010_YEAR - RX8010_SEC]) + 100; 139 dt->tm_wday = ffs(date[RX8010_WDAY - RX8010_SEC] & 0x7f); 140 | 1/* 2 * Driver for the Epson RTC module RX-8010 SJ 3 * 4 * Copyright(C) Timesys Corporation 2015 5 * Copyright(C) General Electric Company 2015 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 --- 124 unchanged lines hidden (view full) --- 133 dt->tm_sec = bcd2bin(date[RX8010_SEC - RX8010_SEC] & 0x7f); 134 dt->tm_min = bcd2bin(date[RX8010_MIN - RX8010_SEC] & 0x7f); 135 dt->tm_hour = bcd2bin(date[RX8010_HOUR - RX8010_SEC] & 0x3f); 136 dt->tm_mday = bcd2bin(date[RX8010_MDAY - RX8010_SEC] & 0x3f); 137 dt->tm_mon = bcd2bin(date[RX8010_MONTH - RX8010_SEC] & 0x1f) - 1; 138 dt->tm_year = bcd2bin(date[RX8010_YEAR - RX8010_SEC]) + 100; 139 dt->tm_wday = ffs(date[RX8010_WDAY - RX8010_SEC] & 0x7f); 140 |
141 return rtc_valid_tm(dt); | 141 return 0; |
142} 143 144static int rx8010_set_time(struct device *dev, struct rtc_time *dt) 145{ 146 struct rx8010_data *rx8010 = dev_get_drvdata(dev); 147 u8 date[7]; 148 int ctrl, flagreg; 149 int ret; --- 356 unchanged lines hidden --- | 142} 143 144static int rx8010_set_time(struct device *dev, struct rtc_time *dt) 145{ 146 struct rx8010_data *rx8010 = dev_get_drvdata(dev); 147 u8 date[7]; 148 int ctrl, flagreg; 149 int ret; --- 356 unchanged lines hidden --- |