rtc-ds1216.c (f26e8817b235d8764363bffcc9cbfc61867371f2) rtc-ds1216.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0)
1/*
2 * Dallas DS1216 RTC driver
3 *
4 * Copyright (c) 2007 Thomas Bogendoerfer
5 *
6 */
7
8#include <linux/module.h>

--- 85 unchanged lines hidden (view full) ---

94 tm->tm_hour = bcd2bin(regs.hour & 0x3f);
95 tm->tm_wday = (regs.wday & 7) - 1;
96 tm->tm_mday = bcd2bin(regs.mday & 0x3f);
97 tm->tm_mon = bcd2bin(regs.month & 0x1f);
98 tm->tm_year = bcd2bin(regs.year);
99 if (tm->tm_year < 70)
100 tm->tm_year += 100;
101
1/*
2 * Dallas DS1216 RTC driver
3 *
4 * Copyright (c) 2007 Thomas Bogendoerfer
5 *
6 */
7
8#include <linux/module.h>

--- 85 unchanged lines hidden (view full) ---

94 tm->tm_hour = bcd2bin(regs.hour & 0x3f);
95 tm->tm_wday = (regs.wday & 7) - 1;
96 tm->tm_mday = bcd2bin(regs.mday & 0x3f);
97 tm->tm_mon = bcd2bin(regs.month & 0x1f);
98 tm->tm_year = bcd2bin(regs.year);
99 if (tm->tm_year < 70)
100 tm->tm_year += 100;
101
102 return rtc_valid_tm(tm);
102 return 0;
103}
104
105static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm)
106{
107 struct platform_device *pdev = to_platform_device(dev);
108 struct ds1216_priv *priv = platform_get_drvdata(pdev);
109 struct ds1216_regs regs;
110

--- 67 unchanged lines hidden ---
103}
104
105static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm)
106{
107 struct platform_device *pdev = to_platform_device(dev);
108 struct ds1216_priv *priv = platform_get_drvdata(pdev);
109 struct ds1216_regs regs;
110

--- 67 unchanged lines hidden ---