rtc-max6916.c (f26e8817b235d8764363bffcc9cbfc61867371f2) | rtc-max6916.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0) |
---|---|
1/* rtc-max6916.c 2 * 3 * Driver for MAXIM max6916 Low Current, SPI Compatible 4 * Real Time Clock 5 * 6 * Author : Venkat Prashanth B U <venkat.prashanth2498@gmail.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 61 unchanged lines hidden (view full) --- 70 dt->tm_sec = bcd2bin(buf[0]); 71 dt->tm_min = bcd2bin(buf[1]); 72 dt->tm_hour = bcd2bin(buf[2] & 0x3F); 73 dt->tm_mday = bcd2bin(buf[3]); 74 dt->tm_mon = bcd2bin(buf[4]) - 1; 75 dt->tm_wday = bcd2bin(buf[5]) - 1; 76 dt->tm_year = bcd2bin(buf[6]) + 100; 77 | 1/* rtc-max6916.c 2 * 3 * Driver for MAXIM max6916 Low Current, SPI Compatible 4 * Real Time Clock 5 * 6 * Author : Venkat Prashanth B U <venkat.prashanth2498@gmail.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 61 unchanged lines hidden (view full) --- 70 dt->tm_sec = bcd2bin(buf[0]); 71 dt->tm_min = bcd2bin(buf[1]); 72 dt->tm_hour = bcd2bin(buf[2] & 0x3F); 73 dt->tm_mday = bcd2bin(buf[3]); 74 dt->tm_mon = bcd2bin(buf[4]) - 1; 75 dt->tm_wday = bcd2bin(buf[5]) - 1; 76 dt->tm_year = bcd2bin(buf[6]) + 100; 77 |
78 return rtc_valid_tm(dt); | 78 return 0; |
79} 80 81static int max6916_set_time(struct device *dev, struct rtc_time *dt) 82{ 83 struct spi_device *spi = to_spi_device(dev); 84 unsigned char buf[9]; 85 86 if (dt->tm_year < 100 || dt->tm_year > 199) { --- 78 unchanged lines hidden --- | 79} 80 81static int max6916_set_time(struct device *dev, struct rtc_time *dt) 82{ 83 struct spi_device *spi = to_spi_device(dev); 84 unsigned char buf[9]; 85 86 if (dt->tm_year < 100 || dt->tm_year > 199) { --- 78 unchanged lines hidden --- |