Import 2.3.16
[davej-history.git] / include / asm-ppc / m48t35.h
blob2e45f4f0b7ea1ce0ae6ef8fead62cf19a49abda9
1 /*
2 * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
3 */
5 #ifndef __PPC_M48T35_H
6 #define __PPC_M48T35_H
8 /* RTC offsets */
9 #define M48T35_RTC_CONTROL 0
10 #define M48T35_RTC_SECONDS 1
11 #define M48T35_RTC_MINUTES 2
12 #define M48T35_RTC_HOURS 3
13 #define M48T35_RTC_DAY 4
14 #define M48T35_RTC_DOM 5
15 #define M48T35_RTC_MONTH 6
16 #define M48T35_RTC_YEAR 7
18 #define M48T35_RTC_SET 0x80
19 #define M48T35_RTC_STOPPED 0x80
20 #define M48T35_RTC_READ 0x40
22 #ifndef BCD_TO_BIN
23 #define BCD_TO_BIN(x) ((x)=((x)&15) + ((x)>>4)*10)
24 #endif
26 #ifndef BIN_TO_BCD
27 #define BIN_TO_BCD(x) ((x)=(((x)/10)<<4) + (x)%10)
28 #endif
30 #endif