Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Generic linux-input device driver for keyboard devices |
| 3 | * |
| 4 | * Copyright (c) 2001 Brian S. Julin |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Redistribution and use in source and binary forms, with or without |
| 8 | * modification, are permitted provided that the following conditions |
| 9 | * are met: |
| 10 | * 1. Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions, and the following disclaimer, |
| 12 | * without modification. |
| 13 | * 2. The name of the author may not be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * Alternatively, this software may be distributed under the terms of the |
| 17 | * GNU General Public License ("GPL"). |
| 18 | * |
| 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR |
| 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 28 | * |
| 29 | * References: |
| 30 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #include <linux/hil.h> |
| 35 | #include <linux/input.h> |
| 36 | #include <linux/serio.h> |
| 37 | #include <linux/kernel.h> |
| 38 | #include <linux/module.h> |
| 39 | #include <linux/init.h> |
| 40 | #include <linux/slab.h> |
| 41 | #include <linux/pci_ids.h> |
| 42 | |
| 43 | #define PREFIX "HIL KEYB: " |
| 44 | #define HIL_GENERIC_NAME "HIL keyboard" |
| 45 | |
| 46 | MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>"); |
| 47 | MODULE_DESCRIPTION(HIL_GENERIC_NAME " driver"); |
| 48 | MODULE_LICENSE("Dual BSD/GPL"); |
| 49 | |
| 50 | #define HIL_KBD_MAX_LENGTH 16 |
| 51 | |
| 52 | #define HIL_KBD_SET1_UPBIT 0x01 |
| 53 | #define HIL_KBD_SET1_SHIFT 1 |
| 54 | static unsigned int hil_kbd_set1[HIL_KEYCODES_SET1_TBLSIZE] = |
| 55 | { HIL_KEYCODES_SET1 }; |
| 56 | |
| 57 | #define HIL_KBD_SET2_UPBIT 0x01 |
| 58 | #define HIL_KBD_SET2_SHIFT 1 |
| 59 | /* Set2 is user defined */ |
| 60 | |
| 61 | #define HIL_KBD_SET3_UPBIT 0x80 |
| 62 | #define HIL_KBD_SET3_SHIFT 0 |
| 63 | static unsigned int hil_kbd_set3[HIL_KEYCODES_SET3_TBLSIZE] = |
| 64 | { HIL_KEYCODES_SET3 }; |
| 65 | |
| 66 | static char hil_language[][16] = { HIL_LOCALE_MAP }; |
| 67 | |
| 68 | struct hil_kbd { |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 69 | struct input_dev *dev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | struct serio *serio; |
| 71 | |
| 72 | /* Input buffer and index for packets from HIL bus. */ |
| 73 | hil_packet data[HIL_KBD_MAX_LENGTH]; |
| 74 | int idx4; /* four counts per packet */ |
| 75 | |
| 76 | /* Raw device info records from HIL bus, see hil.h for fields. */ |
| 77 | char idd[HIL_KBD_MAX_LENGTH]; /* DID byte and IDD record */ |
| 78 | char rsc[HIL_KBD_MAX_LENGTH]; /* RSC record */ |
| 79 | char exd[HIL_KBD_MAX_LENGTH]; /* EXD record */ |
| 80 | char rnm[HIL_KBD_MAX_LENGTH + 1]; /* RNM record + NULL term. */ |
| 81 | |
| 82 | /* Something to sleep around with. */ |
| 83 | struct semaphore sem; |
| 84 | }; |
| 85 | |
| 86 | /* Process a complete packet after transfer from the HIL */ |
| 87 | static void hil_kbd_process_record(struct hil_kbd *kbd) |
| 88 | { |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 89 | struct input_dev *dev = kbd->dev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | hil_packet *data = kbd->data; |
| 91 | hil_packet p; |
| 92 | int idx, i, cnt; |
| 93 | |
| 94 | idx = kbd->idx4/4; |
| 95 | p = data[idx - 1]; |
| 96 | |
| 97 | if ((p & ~HIL_CMDCT_POL) == |
| 98 | (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_POL)) goto report; |
| 99 | if ((p & ~HIL_CMDCT_RPL) == |
| 100 | (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_RPL)) goto report; |
| 101 | |
| 102 | /* Not a poll response. See if we are loading config records. */ |
| 103 | switch (p & HIL_PKT_DATA_MASK) { |
| 104 | case HIL_CMD_IDD: |
| 105 | for (i = 0; i < idx; i++) |
| 106 | kbd->idd[i] = kbd->data[i] & HIL_PKT_DATA_MASK; |
| 107 | for (; i < HIL_KBD_MAX_LENGTH; i++) |
| 108 | kbd->idd[i] = 0; |
| 109 | break; |
| 110 | case HIL_CMD_RSC: |
| 111 | for (i = 0; i < idx; i++) |
| 112 | kbd->rsc[i] = kbd->data[i] & HIL_PKT_DATA_MASK; |
| 113 | for (; i < HIL_KBD_MAX_LENGTH; i++) |
| 114 | kbd->rsc[i] = 0; |
| 115 | break; |
| 116 | case HIL_CMD_EXD: |
| 117 | for (i = 0; i < idx; i++) |
| 118 | kbd->exd[i] = kbd->data[i] & HIL_PKT_DATA_MASK; |
| 119 | for (; i < HIL_KBD_MAX_LENGTH; i++) |
| 120 | kbd->exd[i] = 0; |
| 121 | break; |
| 122 | case HIL_CMD_RNM: |
| 123 | for (i = 0; i < idx; i++) |
| 124 | kbd->rnm[i] = kbd->data[i] & HIL_PKT_DATA_MASK; |
| 125 | for (; i < HIL_KBD_MAX_LENGTH + 1; i++) |
| 126 | kbd->rnm[i] = '\0'; |
| 127 | break; |
| 128 | default: |
| 129 | /* These occur when device isn't present */ |
| 130 | if (p == (HIL_ERR_INT | HIL_PKT_CMD)) break; |
| 131 | /* Anything else we'd like to know about. */ |
| 132 | printk(KERN_WARNING PREFIX "Device sent unknown record %x\n", p); |
| 133 | break; |
| 134 | } |
| 135 | goto out; |
| 136 | |
| 137 | report: |
| 138 | cnt = 1; |
| 139 | switch (kbd->data[0] & HIL_POL_CHARTYPE_MASK) { |
| 140 | case HIL_POL_CHARTYPE_NONE: |
| 141 | break; |
| 142 | case HIL_POL_CHARTYPE_ASCII: |
| 143 | while (cnt < idx - 1) |
| 144 | input_report_key(dev, kbd->data[cnt++] & 0x7f, 1); |
| 145 | break; |
| 146 | case HIL_POL_CHARTYPE_RSVD1: |
| 147 | case HIL_POL_CHARTYPE_RSVD2: |
| 148 | case HIL_POL_CHARTYPE_BINARY: |
| 149 | while (cnt < idx - 1) |
| 150 | input_report_key(dev, kbd->data[cnt++], 1); |
| 151 | break; |
| 152 | case HIL_POL_CHARTYPE_SET1: |
| 153 | while (cnt < idx - 1) { |
| 154 | unsigned int key; |
| 155 | int up; |
| 156 | key = kbd->data[cnt++]; |
| 157 | up = key & HIL_KBD_SET1_UPBIT; |
| 158 | key &= (~HIL_KBD_SET1_UPBIT & 0xff); |
| 159 | key = hil_kbd_set1[key >> HIL_KBD_SET1_SHIFT]; |
| 160 | if (key != KEY_RESERVED) |
| 161 | input_report_key(dev, key, !up); |
| 162 | } |
| 163 | break; |
| 164 | case HIL_POL_CHARTYPE_SET2: |
| 165 | while (cnt < idx - 1) { |
| 166 | unsigned int key; |
| 167 | int up; |
| 168 | key = kbd->data[cnt++]; |
| 169 | up = key & HIL_KBD_SET2_UPBIT; |
| 170 | key &= (~HIL_KBD_SET1_UPBIT & 0xff); |
| 171 | key = key >> HIL_KBD_SET2_SHIFT; |
| 172 | if (key != KEY_RESERVED) |
| 173 | input_report_key(dev, key, !up); |
| 174 | } |
| 175 | break; |
| 176 | case HIL_POL_CHARTYPE_SET3: |
| 177 | while (cnt < idx - 1) { |
| 178 | unsigned int key; |
| 179 | int up; |
| 180 | key = kbd->data[cnt++]; |
| 181 | up = key & HIL_KBD_SET3_UPBIT; |
| 182 | key &= (~HIL_KBD_SET1_UPBIT & 0xff); |
| 183 | key = hil_kbd_set3[key >> HIL_KBD_SET3_SHIFT]; |
| 184 | if (key != KEY_RESERVED) |
| 185 | input_report_key(dev, key, !up); |
| 186 | } |
| 187 | break; |
| 188 | } |
| 189 | out: |
| 190 | kbd->idx4 = 0; |
| 191 | up(&kbd->sem); |
| 192 | } |
| 193 | |
| 194 | static void hil_kbd_process_err(struct hil_kbd *kbd) { |
| 195 | printk(KERN_WARNING PREFIX "errored HIL packet\n"); |
| 196 | kbd->idx4 = 0; |
| 197 | up(&kbd->sem); |
| 198 | } |
| 199 | |
| 200 | static irqreturn_t hil_kbd_interrupt(struct serio *serio, |
| 201 | unsigned char data, unsigned int flags, struct pt_regs *regs) |
| 202 | { |
| 203 | struct hil_kbd *kbd; |
| 204 | hil_packet packet; |
| 205 | int idx; |
| 206 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 207 | kbd = serio_get_drvdata(serio); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | if (kbd == NULL) { |
| 209 | BUG(); |
| 210 | return IRQ_HANDLED; |
| 211 | } |
| 212 | |
| 213 | if (kbd->idx4 >= (HIL_KBD_MAX_LENGTH * sizeof(hil_packet))) { |
| 214 | hil_kbd_process_err(kbd); |
| 215 | return IRQ_HANDLED; |
| 216 | } |
| 217 | idx = kbd->idx4/4; |
| 218 | if (!(kbd->idx4 % 4)) kbd->data[idx] = 0; |
| 219 | packet = kbd->data[idx]; |
| 220 | packet |= ((hil_packet)data) << ((3 - (kbd->idx4 % 4)) * 8); |
| 221 | kbd->data[idx] = packet; |
| 222 | |
| 223 | /* Records of N 4-byte hil_packets must terminate with a command. */ |
| 224 | if ((++(kbd->idx4)) % 4) return IRQ_HANDLED; |
| 225 | if ((packet & 0xffff0000) != HIL_ERR_INT) { |
| 226 | hil_kbd_process_err(kbd); |
| 227 | return IRQ_HANDLED; |
| 228 | } |
| 229 | if (packet & HIL_PKT_CMD) hil_kbd_process_record(kbd); |
| 230 | return IRQ_HANDLED; |
| 231 | } |
| 232 | |
| 233 | static void hil_kbd_disconnect(struct serio *serio) |
| 234 | { |
| 235 | struct hil_kbd *kbd; |
| 236 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 237 | kbd = serio_get_drvdata(serio); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | if (kbd == NULL) { |
| 239 | BUG(); |
| 240 | return; |
| 241 | } |
| 242 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | serio_close(serio); |
Kyle McMartin | cd7a920 | 2006-03-30 11:47:32 -0500 | [diff] [blame] | 244 | input_unregister_device(kbd->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | kfree(kbd); |
| 246 | } |
| 247 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 248 | static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | { |
| 250 | struct hil_kbd *kbd; |
| 251 | uint8_t did, *idd; |
| 252 | int i; |
| 253 | |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 254 | kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 255 | if (!kbd) |
| 256 | return -ENOMEM; |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 257 | |
| 258 | kbd->dev = input_allocate_device(); |
| 259 | if (!kbd->dev) goto bail1; |
| 260 | kbd->dev->private = kbd; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | |
| 262 | if (serio_open(serio, drv)) goto bail0; |
| 263 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 264 | serio_set_drvdata(serio, kbd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | kbd->serio = serio; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | |
| 267 | init_MUTEX_LOCKED(&(kbd->sem)); |
| 268 | |
| 269 | /* Get device info. MLC driver supplies devid/status/etc. */ |
| 270 | serio->write(serio, 0); |
| 271 | serio->write(serio, 0); |
| 272 | serio->write(serio, HIL_PKT_CMD >> 8); |
| 273 | serio->write(serio, HIL_CMD_IDD); |
| 274 | down(&(kbd->sem)); |
| 275 | |
| 276 | serio->write(serio, 0); |
| 277 | serio->write(serio, 0); |
| 278 | serio->write(serio, HIL_PKT_CMD >> 8); |
| 279 | serio->write(serio, HIL_CMD_RSC); |
| 280 | down(&(kbd->sem)); |
| 281 | |
| 282 | serio->write(serio, 0); |
| 283 | serio->write(serio, 0); |
| 284 | serio->write(serio, HIL_PKT_CMD >> 8); |
| 285 | serio->write(serio, HIL_CMD_RNM); |
| 286 | down(&(kbd->sem)); |
| 287 | |
| 288 | serio->write(serio, 0); |
| 289 | serio->write(serio, 0); |
| 290 | serio->write(serio, HIL_PKT_CMD >> 8); |
| 291 | serio->write(serio, HIL_CMD_EXD); |
| 292 | down(&(kbd->sem)); |
| 293 | |
| 294 | up(&(kbd->sem)); |
| 295 | |
| 296 | did = kbd->idd[0]; |
| 297 | idd = kbd->idd + 1; |
| 298 | switch (did & HIL_IDD_DID_TYPE_MASK) { |
| 299 | case HIL_IDD_DID_TYPE_KB_INTEGRAL: |
| 300 | case HIL_IDD_DID_TYPE_KB_ITF: |
| 301 | case HIL_IDD_DID_TYPE_KB_RSVD: |
| 302 | case HIL_IDD_DID_TYPE_CHAR: |
| 303 | printk(KERN_INFO PREFIX "HIL keyboard found (did = 0x%02x, lang = %s)\n", |
| 304 | did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]); |
| 305 | break; |
| 306 | default: |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 307 | goto bail2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) { |
| 311 | printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n"); |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 312 | goto bail2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 316 | kbd->dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); |
| 317 | kbd->dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); |
| 318 | kbd->dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; |
| 319 | kbd->dev->keycodesize = sizeof(hil_kbd_set1[0]); |
| 320 | kbd->dev->keycode = hil_kbd_set1; |
| 321 | kbd->dev->name = strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME; |
| 322 | kbd->dev->phys = "hpkbd/input0"; /* XXX */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 324 | kbd->dev->id.bustype = BUS_HIL; |
| 325 | kbd->dev->id.vendor = PCI_VENDOR_ID_HP; |
| 326 | kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */ |
| 327 | kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */ |
| 328 | kbd->dev->dev = &serio->dev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | |
| 330 | for (i = 0; i < 128; i++) { |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 331 | set_bit(hil_kbd_set1[i], kbd->dev->keybit); |
| 332 | set_bit(hil_kbd_set3[i], kbd->dev->keybit); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | } |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 334 | clear_bit(0, kbd->dev->keybit); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 336 | input_register_device(kbd->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | printk(KERN_INFO "input: %s, ID: %d\n", |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 338 | kbd->dev->name, did); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | |
| 340 | serio->write(serio, 0); |
| 341 | serio->write(serio, 0); |
| 342 | serio->write(serio, HIL_PKT_CMD >> 8); |
| 343 | serio->write(serio, HIL_CMD_EK1); /* Enable Keyswitch Autorepeat 1 */ |
| 344 | down(&(kbd->sem)); |
| 345 | up(&(kbd->sem)); |
| 346 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 347 | return 0; |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 348 | bail2: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | serio_close(serio); |
Helge Deller | 102c8c7 | 2006-03-26 07:41:55 -0700 | [diff] [blame] | 350 | bail1: |
| 351 | input_free_device(kbd->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | bail0: |
| 353 | kfree(kbd); |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 354 | serio_set_drvdata(serio, NULL); |
| 355 | return -EIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | } |
| 357 | |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 358 | static struct serio_device_id hil_kbd_ids[] = { |
| 359 | { |
| 360 | .type = SERIO_HIL_MLC, |
| 361 | .proto = SERIO_HIL, |
| 362 | .id = SERIO_ANY, |
| 363 | .extra = SERIO_ANY, |
| 364 | }, |
| 365 | { 0 } |
| 366 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | |
| 368 | struct serio_driver hil_kbd_serio_drv = { |
| 369 | .driver = { |
| 370 | .name = "hil_kbd", |
| 371 | }, |
| 372 | .description = "HP HIL keyboard driver", |
Matthew Wilcox | 6ab0f5c | 2005-10-21 22:58:51 -0400 | [diff] [blame] | 373 | .id_table = hil_kbd_ids, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | .connect = hil_kbd_connect, |
| 375 | .disconnect = hil_kbd_disconnect, |
| 376 | .interrupt = hil_kbd_interrupt |
| 377 | }; |
| 378 | |
| 379 | static int __init hil_kbd_init(void) |
| 380 | { |
| 381 | serio_register_driver(&hil_kbd_serio_drv); |
| 382 | return 0; |
| 383 | } |
| 384 | |
| 385 | static void __exit hil_kbd_exit(void) |
| 386 | { |
| 387 | serio_unregister_driver(&hil_kbd_serio_drv); |
| 388 | } |
| 389 | |
| 390 | module_init(hil_kbd_init); |
| 391 | module_exit(hil_kbd_exit); |