1 /*
2  * linux/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_rtc.c
3  *
4  * RTC routines for Dallas chip.
5  *
6  * Copyright (C) 2003 TimeSys Corp.
7  *                    S. James Hill (James.Hill@timesys.com)
8  *                                  (sjhill@realitydiluted.com)
9  *
10  *  This program is free software; you can redistribute it and/or modify it
11  *  under the terms of the GNU General Public License as published by the
12  *  Free Software Foundation; either version 2 of the License, or (at your
13  *  option) any later version.
14  *
15  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
21  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
23  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
24  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  *  You should have received a copy of the GNU General Public License along
27  *  with this program; if not, write to the Free Software Foundation, Inc.,
28  *  675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 #include <asm/mc146818rtc.h>
31 
ds1742_rtc_read_data(unsigned long addr)32 static unsigned char ds1742_rtc_read_data(unsigned long addr)
33 {
34 	return readb(addr);
35 }
36 
ds1742_rtc_write_data(unsigned char data,unsigned long addr)37 static void ds1742_rtc_write_data(unsigned char data, unsigned long addr)
38 {
39 	writeb(data, addr);
40 }
41 
ds1742_rtc_bcd_mode(void)42 static int ds1742_rtc_bcd_mode(void)
43 {
44 	return 1;
45 }
46 
47 struct rtc_ops ds1742_rtc_ops = {
48 	&ds1742_rtc_read_data,
49 	&ds1742_rtc_write_data,
50 	&ds1742_rtc_bcd_mode
51 };
52