Source
* NOTE: Other system software (e.g. firmware) that reads the same hardware must
/*
* RTC driver for Rockchip RK808
*
* Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
*
* Author: Chris Zhong <zyw@rock-chips.com>
* Author: Zhang Qing <zhangqing@rock-chips.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
/* RTC_CTRL_REG bitfields */
/* RK808 has a shadowed register for saving a "frozen" RTC time.
* When user setting "GET_TIME" to 1, the time will save in this shadowed
* register. If set "READSEL" to 1, user read rtc time register, actually
* get the time of that moment. If we need the real time, clr this bit.
*/
/* REG_SECONDS_REG through REG_YEARS_REG is how many registers? */
struct rk808_rtc {
struct rk808 *rk808;
struct rtc_device *rtc;
int irq;
};
/*
* The Rockchip calendar used by the RK808 counts November with 31 days. We use
* these translation functions to convert its dates to/from the Gregorian
* calendar used by the rest of the world. We arbitrarily define Jan 1st, 2016
* as the day when both calendars were in sync, and treat all other dates