[MIPS] vr41xx: Move IRQ numbers to asm-mips/vr41xx/irq.h
[linux-2.6/linux-mips.git] / include / asm-mips / vr41xx / vrc4173.h
blobe5e6ad1d2f864a8a0a575b428e10384ba749c46b
1 /*
2 * vrc4173.h, Include file for NEC VRC4173.
4 * Copyright (C) 2000 Michael R. McDonald
5 * Copyright (C) 2001-2003 Montavista Software Inc.
6 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7 * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
8 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef __NEC_VRC4173_H
25 #define __NEC_VRC4173_H
27 #include <asm/io.h>
30 * PCI I/O accesses
32 #ifdef CONFIG_VRC4173
34 extern unsigned long vrc4173_io_offset;
36 #define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0)
38 #define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port))
39 #define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port))
40 #define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port))
41 #define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port))
42 #define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port))
43 #define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port))
45 #define vrc4173_inb(port) inb(vrc4173_io_offset+(port))
46 #define vrc4173_inw(port) inw(vrc4173_io_offset+(port))
47 #define vrc4173_inl(port) inl(vrc4173_io_offset+(port))
48 #define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port))
49 #define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port))
50 #define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port))
52 #define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count))
53 #define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count))
54 #define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count))
56 #define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count))
57 #define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count))
58 #define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count))
60 #else
62 #define set_vrc4173_io_offset(offset) do {} while (0)
64 #define vrc4173_outb(val,port) do {} while (0)
65 #define vrc4173_outw(val,port) do {} while (0)
66 #define vrc4173_outl(val,port) do {} while (0)
67 #define vrc4173_outb_p(val,port) do {} while (0)
68 #define vrc4173_outw_p(val,port) do {} while (0)
69 #define vrc4173_outl_p(val,port) do {} while (0)
71 #define vrc4173_inb(port) 0
72 #define vrc4173_inw(port) 0
73 #define vrc4173_inl(port) 0
74 #define vrc4173_inb_p(port) 0
75 #define vrc4173_inw_p(port) 0
76 #define vrc4173_inl_p(port) 0
78 #define vrc4173_outsb(port,addr,count) do {} while (0)
79 #define vrc4173_outsw(port,addr,count) do {} while (0)
80 #define vrc4173_outsl(port,addr,count) do {} while (0)
82 #define vrc4173_insb(port,addr,count) do {} while (0)
83 #define vrc4173_insw(port,addr,count) do {} while (0)
84 #define vrc4173_insl(port,addr,count) do {} while (0)
86 #endif
89 * Clock Mask Unit
91 typedef enum vrc4173_clock {
92 VRC4173_PIU_CLOCK,
93 VRC4173_KIU_CLOCK,
94 VRC4173_AIU_CLOCK,
95 VRC4173_PS2_CH1_CLOCK,
96 VRC4173_PS2_CH2_CLOCK,
97 VRC4173_USBU_PCI_CLOCK,
98 VRC4173_CARDU1_PCI_CLOCK,
99 VRC4173_CARDU2_PCI_CLOCK,
100 VRC4173_AC97U_PCI_CLOCK,
101 VRC4173_USBU_48MHz_CLOCK,
102 VRC4173_EXT_48MHz_CLOCK,
103 VRC4173_48MHz_CLOCK,
104 } vrc4173_clock_t;
106 #ifdef CONFIG_VRC4173
108 extern void vrc4173_supply_clock(vrc4173_clock_t clock);
109 extern void vrc4173_mask_clock(vrc4173_clock_t clock);
111 #else
113 static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {}
114 static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {}
116 #endif
119 * Interupt Control Unit
122 #define VRC4173_PIUINT_COMMAND 0x0040
123 #define VRC4173_PIUINT_DATA 0x0020
124 #define VRC4173_PIUINT_PAGE1 0x0010
125 #define VRC4173_PIUINT_PAGE0 0x0008
126 #define VRC4173_PIUINT_DATALOST 0x0004
127 #define VRC4173_PIUINT_STATUSCHANGE 0x0001
129 #ifdef CONFIG_VRC4173
131 extern void vrc4173_enable_piuint(uint16_t mask);
132 extern void vrc4173_disable_piuint(uint16_t mask);
134 #else
136 static inline void vrc4173_enable_piuint(uint16_t mask) {}
137 static inline void vrc4173_disable_piuint(uint16_t mask) {}
139 #endif
141 #define VRC4173_AIUINT_INPUT_DMAEND 0x0800
142 #define VRC4173_AIUINT_INPUT_DMAHALT 0x0400
143 #define VRC4173_AIUINT_INPUT_DATALOST 0x0200
144 #define VRC4173_AIUINT_INPUT_DATA 0x0100
145 #define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008
146 #define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004
147 #define VRC4173_AIUINT_OUTPUT_NODATA 0x0002
149 #ifdef CONFIG_VRC4173
151 extern void vrc4173_enable_aiuint(uint16_t mask);
152 extern void vrc4173_disable_aiuint(uint16_t mask);
154 #else
156 static inline void vrc4173_enable_aiuint(uint16_t mask) {}
157 static inline void vrc4173_disable_aiuint(uint16_t mask) {}
159 #endif
161 #define VRC4173_KIUINT_DATALOST 0x0004
162 #define VRC4173_KIUINT_DATAREADY 0x0002
163 #define VRC4173_KIUINT_SCAN 0x0001
165 #ifdef CONFIG_VRC4173
167 extern void vrc4173_enable_kiuint(uint16_t mask);
168 extern void vrc4173_disable_kiuint(uint16_t mask);
170 #else
172 static inline void vrc4173_enable_kiuint(uint16_t mask) {}
173 static inline void vrc4173_disable_kiuint(uint16_t mask) {}
175 #endif
178 * General-Purpose I/O Unit
180 typedef enum vrc4173_function {
181 PS2_CHANNEL1,
182 PS2_CHANNEL2,
183 TOUCHPANEL,
184 KEYBOARD_8SCANLINES,
185 KEYBOARD_10SCANLINES,
186 KEYBOARD_12SCANLINES,
187 GPIO_0_15PINS,
188 GPIO_16_20PINS,
189 } vrc4173_function_t;
191 #ifdef CONFIG_VRC4173
193 extern void vrc4173_select_function(vrc4173_function_t function);
195 #else
197 static inline void vrc4173_select_function(vrc4173_function_t function) {}
199 #endif
201 #endif /* __NEC_VRC4173_H */