File: mc146818rtc.h

package info (click to toggle)
kernel-source-2.4.14 2.4.14-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 139,160 kB
  • ctags: 428,423
  • sloc: ansic: 2,435,554; asm: 141,119; makefile: 8,258; sh: 3,099; perl: 2,561; yacc: 1,177; cpp: 755; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (49 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Machine dependent access functions for RTC registers.
 */
#ifndef _ASM_MC146818RTC_H
#define _ASM_MC146818RTC_H

#include <linux/config.h>
#include <asm/atarihw.h>

#ifdef CONFIG_ATARI
/* RTC in Atari machines */

#include <asm/atarihw.h>
#include <asm/atariints.h>
#include <asm/io.h>
#define RTC_HAS_IRQ	(ATARIHW_PRESENT(TT_MFP))
#define RTC_IRQ 	IRQ_TT_MFP_RTC
#define RTC_IRQ_FLAGS	IRQ_TYPE_FAST
#define RTC_PORT(x)	(TT_RTC_BAS + 2*(x))
#define RTC_ALWAYS_BCD	0	/* TOS uses binary mode, Linux should be able
				 * to deal with both modes */

#define RTC_CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
#define RTC_MACH_INIT()							\
    do {								\
	epoch = atari_rtc_year_offset + 1900;				\
	if (RTC_HAS_IRQ)						\
	    /* select RTC int on H->L edge */				\
	    tt_mfp.active_edge &= ~0x40;				\
    } while(0)
#define RTC_MACH_EXIT()

/* On Atari, the year was stored with base 1970 in old TOS versions (before
 * 3.06). Later, Atari recognized that this broke leap year recognition, and
 * changed the base to 1968. Medusa and Hades always use the new version. */
#define RTC_CENTURY_SWITCH	-1	/* no century switch */
#define RTC_MINYEAR		epoch

#define CMOS_READ(addr) ({ \
atari_outb_p((addr),RTC_PORT(0)); \
atari_inb_p(RTC_PORT(1)); \
})
#define CMOS_WRITE(val, addr) ({ \
atari_outb_p((addr),RTC_PORT(0)); \
atari_outb_p((val),RTC_PORT(1)); \
})
#endif /* CONFIG_ATARI */

#endif /* _ASM_MC146818RTC_H */