rtc-ds1347.c (0cce284537fb42d9c28b9b31038ffc9b464555f5) | rtc-ds1347.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0) |
---|---|
1/* rtc-ds1347.c 2 * 3 * Driver for Dallas Semiconductor DS1347 Low Current, SPI Compatible 4 * Real Time Clock 5 * 6 * Author : Raghavendra Chandra Ganiga <ravi23ganiga@gmail.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 52 unchanged lines hidden (view full) --- 61 dt->tm_sec = bcd2bin(buf[0]); 62 dt->tm_min = bcd2bin(buf[1]); 63 dt->tm_hour = bcd2bin(buf[2] & 0x3F); 64 dt->tm_mday = bcd2bin(buf[3]); 65 dt->tm_mon = bcd2bin(buf[4]) - 1; 66 dt->tm_wday = bcd2bin(buf[5]) - 1; 67 dt->tm_year = bcd2bin(buf[6]) + 100; 68 | 1/* rtc-ds1347.c 2 * 3 * Driver for Dallas Semiconductor DS1347 Low Current, SPI Compatible 4 * Real Time Clock 5 * 6 * Author : Raghavendra Chandra Ganiga <ravi23ganiga@gmail.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 52 unchanged lines hidden (view full) --- 61 dt->tm_sec = bcd2bin(buf[0]); 62 dt->tm_min = bcd2bin(buf[1]); 63 dt->tm_hour = bcd2bin(buf[2] & 0x3F); 64 dt->tm_mday = bcd2bin(buf[3]); 65 dt->tm_mon = bcd2bin(buf[4]) - 1; 66 dt->tm_wday = bcd2bin(buf[5]) - 1; 67 dt->tm_year = bcd2bin(buf[6]) + 100; 68 |
69 return rtc_valid_tm(dt); | 69 return 0; |
70} 71 72static int ds1347_set_time(struct device *dev, struct rtc_time *dt) 73{ 74 struct spi_device *spi = to_spi_device(dev); 75 struct regmap *map; 76 unsigned char buf[8]; 77 --- 98 unchanged lines hidden --- | 70} 71 72static int ds1347_set_time(struct device *dev, struct rtc_time *dt) 73{ 74 struct spi_device *spi = to_spi_device(dev); 75 struct regmap *map; 76 unsigned char buf[8]; 77 --- 98 unchanged lines hidden --- |