File: /usr/src/linux/include/asm-ppc/m48t35.h
1 /*
2 * BK Id: SCCS/s.m48t35.h 1.5 05/17/01 18:14:25 cort
3 */
4 /*
5 * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
6 */
7
8 #ifndef __PPC_M48T35_H
9 #define __PPC_M48T35_H
10
11 /* RTC offsets */
12 #define M48T35_RTC_CONTROL 0
13 #define M48T35_RTC_SECONDS 1
14 #define M48T35_RTC_MINUTES 2
15 #define M48T35_RTC_HOURS 3
16 #define M48T35_RTC_DAY 4
17 #define M48T35_RTC_DOM 5
18 #define M48T35_RTC_MONTH 6
19 #define M48T35_RTC_YEAR 7
20
21 #define M48T35_RTC_SET 0x80
22 #define M48T35_RTC_STOPPED 0x80
23 #define M48T35_RTC_READ 0x40
24
25 #ifndef BCD_TO_BIN
26 #define BCD_TO_BIN(x) ((x)=((x)&15) + ((x)>>4)*10)
27 #endif
28
29 #ifndef BIN_TO_BCD
30 #define BIN_TO_BCD(x) ((x)=(((x)/10)<<4) + (x)%10)
31 #endif
32
33 #endif
34