rtc-mcp795.c (0337966d121ebebf73a1c346123e8112796e684e) rtc-mcp795.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0)
1/*
2 * SPI Driver for Microchip MCP795 RTC
3 *
4 * Copyright (C) Josef Gajdusek <atx@atx.name>
5 *
6 * based on other Linux RTC drivers
7 *
8 * Device datasheet:

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

257 tim->tm_mday = bcd2bin(data[4] & 0x3F);
258 tim->tm_mon = bcd2bin(data[5] & 0x1F) - 1;
259 tim->tm_year = bcd2bin(data[6]) + 100; /* Assume we are in 20xx */
260
261 dev_dbg(dev, "Read from mcp795: %04d-%02d-%02d(%d) %02d:%02d:%02d\n",
262 tim->tm_year + 1900, tim->tm_mon, tim->tm_mday,
263 tim->tm_wday, tim->tm_hour, tim->tm_min, tim->tm_sec);
264
1/*
2 * SPI Driver for Microchip MCP795 RTC
3 *
4 * Copyright (C) Josef Gajdusek <atx@atx.name>
5 *
6 * based on other Linux RTC drivers
7 *
8 * Device datasheet:

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

257 tim->tm_mday = bcd2bin(data[4] & 0x3F);
258 tim->tm_mon = bcd2bin(data[5] & 0x1F) - 1;
259 tim->tm_year = bcd2bin(data[6]) + 100; /* Assume we are in 20xx */
260
261 dev_dbg(dev, "Read from mcp795: %04d-%02d-%02d(%d) %02d:%02d:%02d\n",
262 tim->tm_year + 1900, tim->tm_mon, tim->tm_mday,
263 tim->tm_wday, tim->tm_hour, tim->tm_min, tim->tm_sec);
264
265 return rtc_valid_tm(tim);
265 return 0;
266}
267
268static int mcp795_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
269{
270 struct rtc_time now_tm;
271 time64_t now;
272 time64_t later;
273 u8 tmp[6];

--- 184 unchanged lines hidden ---
266}
267
268static int mcp795_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
269{
270 struct rtc_time now_tm;
271 time64_t now;
272 time64_t later;
273 u8 tmp[6];

--- 184 unchanged lines hidden ---