initial commit with v2.6.9
[linux-2.6.9-moxart.git] / drivers / input / serio / i8042-io.h
blobb567c116a4eeeebd149b0828e6cd926b58bb1435
1 #ifndef _I8042_IO_H
2 #define _I8042_IO_H
4 /*
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */
11 * Names.
14 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
15 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
16 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
19 * IRQs.
22 #ifdef __alpha__
23 # define I8042_KBD_IRQ 1
24 # define I8042_AUX_IRQ (RTC_PORT(0) == 0x170 ? 9 : 12) /* Jensen is special */
25 #elif defined(__ia64__)
26 # define I8042_KBD_IRQ isa_irq_to_vector(1)
27 # define I8042_AUX_IRQ isa_irq_to_vector(12)
28 #elif defined(__arm__)
29 /* defined in include/asm-arm/arch-xxx/irqs.h */
30 #include <asm/irq.h>
31 #elif defined(CONFIG_SUPERH64)
32 #include <asm/irq.h>
33 #else
34 # define I8042_KBD_IRQ 1
35 # define I8042_AUX_IRQ 12
36 #endif
39 * Register numbers.
42 #define I8042_COMMAND_REG 0x64
43 #define I8042_STATUS_REG 0x64
44 #define I8042_DATA_REG 0x60
46 static inline int i8042_read_data(void)
48 return inb(I8042_DATA_REG);
51 static inline int i8042_read_status(void)
53 return inb(I8042_STATUS_REG);
56 static inline void i8042_write_data(int val)
58 outb(val, I8042_DATA_REG);
59 return;
62 static inline void i8042_write_command(int val)
64 outb(val, I8042_COMMAND_REG);
65 return;
68 #if defined(__i386__)
70 #include <linux/dmi.h>
72 static struct dmi_system_id __initdata i8042_dmi_table[] = {
74 .ident = "Compaq Proliant 8500",
75 .matches = {
76 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
77 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
78 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
82 .ident = "Compaq Proliant DL760",
83 .matches = {
84 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
85 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
86 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
89 { }
91 #endif
93 static inline int i8042_platform_init(void)
96 * On ix86 platforms touching the i8042 data register region can do really
97 * bad things. Because of this the region is always reserved on ix86 boxes.
99 #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__) && !defined(__mips__)
100 if (!request_region(I8042_DATA_REG, 16, "i8042"))
101 return -1;
102 #endif
104 #if !defined(__i386__) && !defined(__x86_64__)
105 i8042_reset = 1;
106 #endif
108 #if defined(__i386__)
109 if (dmi_check_system(i8042_dmi_table))
110 i8042_noloop = 1;
111 #endif
113 return 0;
116 static inline void i8042_platform_exit(void)
118 #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__)
119 release_region(I8042_DATA_REG, 16);
120 #endif
123 #endif /* _I8042_IO_H */