20 #include <linux/module.h>
21 #include <linux/errno.h>
22 #include <linux/input.h>
27 #include <linux/sched.h>
35 MODULE_AUTHOR(
"Philip Blundell, Matthew Wilcox, Helge Deller");
40 #if defined(CONFIG_PARISC)
45 static unsigned long hil_base;
46 static unsigned int hil_irq;
47 #define HILBASE hil_base
48 #define HIL_DATA 0x800
50 #define HIL_IRQ hil_irq
51 #define hil_readb(p) gsc_readb(p)
52 #define hil_writeb(v,p) gsc_writeb((v),(p))
54 #elif defined(CONFIG_HP300)
56 #define HILBASE 0xf0428000UL
60 #define hil_readb(p) readb(p)
61 #define hil_writeb(v,p) writeb((v),(p))
64 #error "HIL is not supported on this platform"
71 #define hil_busy() (hil_readb(HILBASE + HIL_CMD) & HIL_BUSY)
72 #define hil_data_available() (hil_readb(HILBASE + HIL_CMD) & HIL_DATA_RDY)
73 #define hil_status() (hil_readb(HILBASE + HIL_CMD))
74 #define hil_command(x) do { hil_writeb((x), HILBASE + HIL_CMD); } while (0)
75 #define hil_read_data() (hil_readb(HILBASE + HIL_DATA))
76 #define hil_write_data(x) do { hil_writeb((x), HILBASE + HIL_DATA); } while (0)
81 #define HIL_DATA_RDY 0x01
83 #define HIL_SETARD 0xA0
84 #define HIL_SETARR 0xA2
85 #define HIL_SETTONE 0xA3
87 #define HIL_INTON 0x5C
88 #define HIL_INTOFF 0x5D
90 #define HIL_READKBDSADR 0xF9
91 #define HIL_WRITEKBDSADR 0xE9
98 struct input_dev *
dev;
114 static void poll_finished(
void)
124 key = hphilkeyb_keycode[scode];
132 static inline void handle_status(
unsigned char s,
unsigned char c)
149 static inline void handle_data(
unsigned char s,
unsigned char c)
185 static void hil_do(
unsigned char cmd,
unsigned char *
data,
unsigned int len)
198 spin_unlock_irqrestore(&
hil_dev.lock, flags);
206 unsigned int i, kbid;
259 hil_dev.
dev->keycodesize=
sizeof(hphilkeyb_keycode[0]);
275 printk(
KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n",
289 static void __devexit hil_keyb_exit(
void)
301 #if defined(CONFIG_PARISC)
310 (
void *)dev->
hpa.start);
314 hil_base = dev->
hpa.start;
318 printk(
KERN_INFO "Found HIL bus at 0x%08lx, IRQ %d\n", hil_base, hil_irq);
320 return hil_keyb_init();
343 .probe = hil_probe_chip,
347 static int __init hil_init(
void)
352 static void __exit hil_exit(
void)
359 static int __init hil_init(
void)
380 error = hil_keyb_init();
389 static void __exit hil_exit(
void)