rtc-ds1302.c (e82a82c19f4272ea5437cc76e5711b98e2ee6223) rtc-ds1302.c (34c7b3ac4ccb6a972f81a4102c8ef216ca1fb155)
1/*
2 * Dallas DS1302 RTC Support
3 *
4 * Copyright (C) 2002 David McCullough
5 * Copyright (C) 2003 - 2007 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License version 2. See the file "COPYING" in the main directory of

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

97 time->tm_mday = bcd2bin(buf[RTC_ADDR_DATE]);
98 time->tm_mon = bcd2bin(buf[RTC_ADDR_MON]) - 1;
99 time->tm_year = bcd2bin(buf[RTC_ADDR_YEAR]) + 100;
100
101 /* Time may not be set */
102 return rtc_valid_tm(time);
103}
104
1/*
2 * Dallas DS1302 RTC Support
3 *
4 * Copyright (C) 2002 David McCullough
5 * Copyright (C) 2003 - 2007 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License version 2. See the file "COPYING" in the main directory of

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

97 time->tm_mday = bcd2bin(buf[RTC_ADDR_DATE]);
98 time->tm_mon = bcd2bin(buf[RTC_ADDR_MON]) - 1;
99 time->tm_year = bcd2bin(buf[RTC_ADDR_YEAR]) + 100;
100
101 /* Time may not be set */
102 return rtc_valid_tm(time);
103}
104
105static struct rtc_class_ops ds1302_rtc_ops = {
105static const struct rtc_class_ops ds1302_rtc_ops = {
106 .read_time = ds1302_rtc_get_time,
107 .set_time = ds1302_rtc_set_time,
108};
109
110static int ds1302_probe(struct spi_device *spi)
111{
112 struct rtc_device *rtc;
113 u8 addr;

--- 106 unchanged lines hidden ---
106 .read_time = ds1302_rtc_get_time,
107 .set_time = ds1302_rtc_set_time,
108};
109
110static int ds1302_probe(struct spi_device *spi)
111{
112 struct rtc_device *rtc;
113 u8 addr;

--- 106 unchanged lines hidden ---