patch-2.4.22 linux-2.4.22/include/asm-cris/rtc.h

Next file: linux-2.4.22/include/asm-cris/semaphore-helper.h
Previous file: linux-2.4.22/include/asm-cris/rs485.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-cris/rtc.h linux-2.4.22/include/asm-cris/rtc.h
@@ -1,9 +1,6 @@
-/* $Id: rtc.h,v 1.8 2002/11/20 14:27:25 oskarp Exp $ */
-
 #ifndef __RTC_H__
 #define __RTC_H__
 
-
 #include <linux/config.h>
 
 #ifdef CONFIG_ETRAX_DS1302
@@ -20,13 +17,13 @@
    /* Bits in CONTROL register. */
 #  define RTC_CONTROL_WRITEPROTECT 	0x80
 #  define RTC_TRICKLECHARGER 		8
-  
+
   /* Bits in TRICKLECHARGER register TCS TCS TCS TCS DS DS RS RS. */
 #  define RTC_TCR_PATTERN 	0xA0	/* 1010xxxx */
 #  define RTC_TCR_1DIOD 	0x04	/* xxxx01xx */
 #  define RTC_TCR_2DIOD 	0x08	/* xxxx10xx */
 #  define RTC_TCR_DISABLED 	0x00	/* xxxxxx00 Disabled */
-#  define RTC_TCR_2KOHM 	0x01	/* xxxxxx01 2KOhm */
+#  define RTC_TCR_2KOHM 	0x01	/* xxxxxx01 2kOhm */
 #  define RTC_TCR_4KOHM 	0x02	/* xxxxxx10 4kOhm */
 #  define RTC_TCR_8KOHM 	0x03	/* xxxxxx11 8kOhm */
 
@@ -36,11 +33,11 @@
 #  define RTC_I2C_WRITE		0xa2
 
    /* Phillips PCF8563 registers. */
-#  define RTC_CONTROL1		0x00		/* Control/Status register 1. */
-#  define RTC_CONTROL2		0x01		/* Control/Status register 2. */
-#  define RTC_CLOCKOUT_FREQ	0x0d		/* CLKOUT frequency. */
-#  define RTC_TIMER_CONTROL	0x0e		/* Timer control. */
-#  define RTC_TIMER_CNTDOWN	0x0f		/* Timer countdown. */
+#  define RTC_CONTROL1		0x00	/* Control/Status register 1. */
+#  define RTC_CONTROL2		0x01	/* Control/Status register 2. */
+#  define RTC_CLOCKOUT_FREQ	0x0d	/* CLKOUT frequency. */
+#  define RTC_TIMER_CONTROL	0x0e	/* Timer control. */
+#  define RTC_TIMER_CNTDOWN	0x0f	/* Timer countdown. */
 
    /* BCD encoded clock registers. */
 #  define RTC_SECONDS		0x02
@@ -53,7 +50,26 @@
 #  define RTC_MINUTE_ALARM	0x09
 #  define RTC_HOUR_ALARM	0x0a
 #  define RTC_DAY_ALARM		0x0b
-#  define RTC_WEEKDAY_ALARM 0x0c	/* Not coded in BCD! */
+#  define RTC_WEEKDAY_ALARM	0x0c	/* Not coded in BCD! */
+
+/* Control/Status 2 bits */
+#  define RTC_CTRL2_TIE		0x01	/* Timer Interrupt Enable */
+#  define RTC_CTRL2_AIE		0x02	/* Alarm Interrupt Enable */
+#  define RTC_CTRL2_TF		0x04	/* Timer Flag */
+#  define RTC_CTRL2_AF		0x08	/* Alarm Flag */
+#  define RTC_CTRL2_TP		0x10	/* Timer Pulse */
+
+/* Timer Control bits */
+#  define RTC_TC_TD0		0x01
+#  define RTC_TC_TD1		0x02
+#  define RTC_TC_TE		0x80	/* Timer Enable */
+
+/* Timer source clock frequency */
+#  define RTC_TC_FREQ_MASK	(RTC_TC_TD0 | RTC_TC_TD1)
+#  define RTC_TC_FREQ_4096	(0)
+#  define RTC_TC_FREQ_64	(RTC_TC_TD0)
+#  define RTC_TC_FREQ_1		(RTC_TC_TD1)
+#  define RTC_TC_FREQ_1_60	(RTC_TC_TD0 | RTC_TC_TD1)
 
 #endif
 
@@ -84,7 +100,7 @@
 
 /*
  * The struct used to pass data via the following ioctl. Similar to the
- * struct tm in <time.h>, but it needs to be here so that the kernel 
+ * struct tm in <time.h>, but it needs to be here so that the kernel
  * source is self contained, allowing cross-compiles, etc. etc.
  */
 struct rtc_time {
@@ -101,9 +117,11 @@
 
 /* ioctl() calls that are permitted to the /dev/rtc interface. */
 #define RTC_MAGIC 'p'
-#define RTC_RD_TIME		_IOR(RTC_MAGIC, 0x09, struct rtc_time)	/* Read RTC time. */
-#define RTC_SET_TIME		_IOW(RTC_MAGIC, 0x0a, struct rtc_time)	/* Set RTC time. */
-#define RTC_SET_CHARGE  	_IOW(RTC_MAGIC, 0x0b, int) 		
-#define RTC_MAX_IOCTL 0x0b
+#define RTC_RD_TIME     _IOR(RTC_MAGIC, 0x09, struct rtc_time)	/* Read RTC time. */
+#define RTC_SET_TIME    _IOW(RTC_MAGIC, 0x0a, struct rtc_time)	/* Set RTC time. */
+#define RTC_SET_CHARGE  _IOW(RTC_MAGIC, 0x0b, int)
+#define RTC_VLOW_RD     _IOR(RTC_MAGIC, 0x11, int)  /* Voltage Low detector */
+#define RTC_VLOW_SET    _IO(RTC_MAGIC, 0x12)        /* Clear voltage low information */
+#define RTC_MAX_IOCTL 0x12
 
 #endif /* __RTC_H__ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)