ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-m68knommu / shglports.h
1
2 /* Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
3  *         1997, 1998  D. Jeff Dionne <jeff@lineo.ca>,
4  */
5
6 #ifndef _M68K_SHGLPORTS_H
7 #define _M68K_SHGLPORTS_H
8
9 #include <linux/config.h>
10 #include <linux/sched.h>
11
12 #ifdef CONFIG_SHGLCORE
13
14 extern struct semaphore porte_interlock;
15
16 struct SHGLCORE_PORT_QS { 
17   unsigned char
18   nullqs:1, /* COM1TX */ 
19   sbin:1,   /* PQS6 (PCS3) */
20   sbclk:1,  /* PQS5 (PCS2) */
21   sbout:1,  /* PQS4 (PCS1) */
22   null4:4;  /* MISO, MOSI, SCLK, /SS=PCS0 */
23 };
24
25 #define PORT_QS ((volatile struct SHGLCORE_PORT_QS*)PORTQS_ADDR)
26
27 struct SHGLCORE_PORT_E {
28   unsigned char
29   dead:1,       /* LED */
30   sbirigb:1,    /* PE6 */
31   ds:1,         /* /DS */
32   nulle1:1,     /* na */ 
33   sbpll:1,      /* PE3 */
34   avec:1,       /* /AVEC */
35   sbsrom:1,     /* PE1 */
36   sbpanel:1;    /* PE0 */
37 };
38
39 #define PORT_E ((volatile struct SHGLCORE_PORT_E*)PORTE_ADDR)
40
41 struct SHGLCORE_PORT_F {
42   unsigned char
43   nullf1:4,
44   nullf2:4;
45 };
46
47 #define PORT_F ((volatile struct SHGLCORE_PORT_F*)PORTF_ADDR)
48
49 extern int comm_status_led, comm_error_led, alarm_led;
50
51 static inline void SET_COMM_STATUS_LED(int value) {
52         BYTE_REF(SHGLCORE_ACC_ADDR+0x100+0) = comm_status_led = value;
53 }
54 static inline int GET_COMM_STATUS_LED(void) {
55         return comm_status_led;
56 }
57
58
59 static inline void SET_COMM_ERROR_LED(int value) {
60         BYTE_REF(SHGLCORE_ACC_ADDR+0x100+1) = comm_error_led = value;
61 }
62 static inline int GET_COMM_ERROR_LED(void) {
63         return comm_error_led;
64 }
65
66
67 static inline void SET_ALARM_LED(int value) {
68         BYTE_REF(SHGLCORE_ACC_ADDR+0x100+2) = alarm_led = value;
69 }
70 static inline int GET_ALARM_LED(void) {
71         return alarm_led;
72 }
73
74 #endif
75
76 #endif /* _M68K_SHGLPORTS_H */