blob: 8250299fd64ff37d78d97910a702f00710157532 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Raw serio device providing access to a raw byte stream from underlying
3 * serio port. Closely emulates behavior of pre-2.6 /dev/psaux device
4 *
5 * Copyright (c) 2004 Dmitry Torokhov
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
Dmitry Torokhovba538cd2011-10-10 18:30:03 -070012#include <linux/kref.h>
Alexey Dobriyand43c36d2009-10-07 17:09:06 +040013#include <linux/sched.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/slab.h>
15#include <linux/poll.h>
16#include <linux/module.h>
17#include <linux/serio.h>
18#include <linux/init.h>
19#include <linux/major.h>
20#include <linux/device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#include <linux/miscdevice.h>
22#include <linux/wait.h>
Arjan van de Venc4e32e92006-02-19 00:21:55 -050023#include <linux/mutex.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
25#define DRIVER_DESC "Raw serio driver"
26
27MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>");
28MODULE_DESCRIPTION(DRIVER_DESC);
29MODULE_LICENSE("GPL");
30
31#define SERIO_RAW_QUEUE_LEN 64
32struct serio_raw {
33 unsigned char queue[SERIO_RAW_QUEUE_LEN];
34 unsigned int tail, head;
35
36 char name[16];
Dmitry Torokhovba538cd2011-10-10 18:30:03 -070037 struct kref kref;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 struct serio *serio;
39 struct miscdevice dev;
40 wait_queue_head_t wait;
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070041 struct list_head client_list;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 struct list_head node;
Dmitry Torokhov85f5b352011-10-10 18:31:04 -070043 bool dead;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044};
45
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070046struct serio_raw_client {
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 struct fasync_struct *fasync;
48 struct serio_raw *serio_raw;
49 struct list_head node;
50};
51
Arjan van de Venc4e32e92006-02-19 00:21:55 -050052static DEFINE_MUTEX(serio_raw_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070053static LIST_HEAD(serio_raw_list);
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55/*********************************************************************
56 * Interface with userspace (file operations) *
57 *********************************************************************/
58
59static int serio_raw_fasync(int fd, struct file *file, int on)
60{
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070061 struct serio_raw_client *client = file->private_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070063 return fasync_helper(fd, file, on, &client->fasync);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064}
65
66static struct serio_raw *serio_raw_locate(int minor)
67{
68 struct serio_raw *serio_raw;
69
70 list_for_each_entry(serio_raw, &serio_raw_list, node) {
71 if (serio_raw->dev.minor == minor)
72 return serio_raw;
73 }
74
75 return NULL;
76}
77
78static int serio_raw_open(struct inode *inode, struct file *file)
79{
80 struct serio_raw *serio_raw;
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070081 struct serio_raw_client *client;
82 int retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
Arjan van de Venc4e32e92006-02-19 00:21:55 -050084 retval = mutex_lock_interruptible(&serio_raw_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 if (retval)
Thadeu Lima de Souza Cascardo77554b42010-03-09 20:38:47 -080086 return retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
Thadeu Lima de Souza Cascardo77554b42010-03-09 20:38:47 -080088 serio_raw = serio_raw_locate(iminor(inode));
89 if (!serio_raw) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 retval = -ENODEV;
91 goto out;
92 }
93
Dmitry Torokhov85f5b352011-10-10 18:31:04 -070094 if (serio_raw->dead) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 retval = -ENODEV;
96 goto out;
97 }
98
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -070099 client = kzalloc(sizeof(struct serio_raw_client), GFP_KERNEL);
100 if (!client) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 retval = -ENOMEM;
102 goto out;
103 }
104
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700105 client->serio_raw = serio_raw;
106 file->private_data = client;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107
Dmitry Torokhovba538cd2011-10-10 18:30:03 -0700108 kref_get(&serio_raw->kref);
Dmitry Torokhov843e7842011-10-10 18:30:26 -0700109
110 serio_pause_rx(serio_raw->serio);
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700111 list_add_tail(&client->node, &serio_raw->client_list);
Dmitry Torokhov843e7842011-10-10 18:30:26 -0700112 serio_continue_rx(serio_raw->serio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
114out:
Arjan van de Venc4e32e92006-02-19 00:21:55 -0500115 mutex_unlock(&serio_raw_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 return retval;
117}
118
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700119static void serio_raw_free(struct kref *kref)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120{
Dmitry Torokhovba538cd2011-10-10 18:30:03 -0700121 struct serio_raw *serio_raw =
122 container_of(kref, struct serio_raw, kref);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700124 put_device(&serio_raw->serio->dev);
Dmitry Torokhovba538cd2011-10-10 18:30:03 -0700125 kfree(serio_raw);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126}
127
128static int serio_raw_release(struct inode *inode, struct file *file)
129{
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700130 struct serio_raw_client *client = file->private_data;
131 struct serio_raw *serio_raw = client->serio_raw;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700133 serio_pause_rx(serio_raw->serio);
134 list_del(&client->node);
135 serio_continue_rx(serio_raw->serio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700137 kfree(client);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700139 kref_put(&serio_raw->kref, serio_raw_free);
140
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 return 0;
142}
143
Dmitry Torokhov8c31eb02011-10-10 18:30:36 -0700144static bool serio_raw_fetch_byte(struct serio_raw *serio_raw, char *c)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145{
Dmitry Torokhov8c31eb02011-10-10 18:30:36 -0700146 bool empty;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147
Dmitry Torokhov843e7842011-10-10 18:30:26 -0700148 serio_pause_rx(serio_raw->serio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149
150 empty = serio_raw->head == serio_raw->tail;
151 if (!empty) {
152 *c = serio_raw->queue[serio_raw->tail];
153 serio_raw->tail = (serio_raw->tail + 1) % SERIO_RAW_QUEUE_LEN;
154 }
155
Dmitry Torokhov843e7842011-10-10 18:30:26 -0700156 serio_continue_rx(serio_raw->serio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157
158 return !empty;
159}
160
Dmitry Torokhov15a564d2011-10-10 18:30:56 -0700161static ssize_t serio_raw_read(struct file *file, char __user *buffer,
162 size_t count, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163{
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700164 struct serio_raw_client *client = file->private_data;
165 struct serio_raw *serio_raw = client->serio_raw;
Andrew Morton4f179f72007-07-10 00:38:31 -0400166 char uninitialized_var(c);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 ssize_t retval = 0;
168
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700169 if (serio_raw->dead)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170 return -ENODEV;
171
172 if (serio_raw->head == serio_raw->tail && (file->f_flags & O_NONBLOCK))
173 return -EAGAIN;
174
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700175 retval = wait_event_interruptible(serio_raw->wait,
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700176 serio_raw->head != serio_raw->tail || serio_raw->dead);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177 if (retval)
178 return retval;
179
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700180 if (serio_raw->dead)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 return -ENODEV;
182
183 while (retval < count && serio_raw_fetch_byte(serio_raw, &c)) {
184 if (put_user(c, buffer++))
185 return -EFAULT;
186 retval++;
187 }
188
189 return retval;
190}
191
Dmitry Torokhov15a564d2011-10-10 18:30:56 -0700192static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
193 size_t count, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194{
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700195 struct serio_raw_client *client = file->private_data;
196 struct serio_raw *serio_raw = client->serio_raw;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 ssize_t written = 0;
198 int retval;
199 unsigned char c;
200
Arjan van de Venc4e32e92006-02-19 00:21:55 -0500201 retval = mutex_lock_interruptible(&serio_raw_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 if (retval)
203 return retval;
204
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700205 if (serio_raw->dead) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 retval = -ENODEV;
207 goto out;
208 }
209
210 if (count > 32)
211 count = 32;
212
213 while (count--) {
214 if (get_user(c, buffer++)) {
215 retval = -EFAULT;
216 goto out;
217 }
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700218 if (serio_write(serio_raw->serio, c)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 retval = -EIO;
220 goto out;
221 }
222 written++;
Che-Liang Chioud89c9bc2012-01-10 00:45:12 -0800223 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
225out:
Arjan van de Venc4e32e92006-02-19 00:21:55 -0500226 mutex_unlock(&serio_raw_mutex);
Dmitry Torokhov4fa07712012-01-10 00:45:12 -0800227 return written ?: retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228}
229
230static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
231{
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700232 struct serio_raw_client *client = file->private_data;
233 struct serio_raw *serio_raw = client->serio_raw;
Dmitry Torokhov8c1c10d2011-10-10 18:31:30 -0700234 unsigned int mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700236 poll_wait(file, &serio_raw->wait, wait);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
Dmitry Torokhov8c1c10d2011-10-10 18:31:30 -0700238 mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700239 if (serio_raw->head != serio_raw->tail)
Dmitry Torokhov0c62fbf2012-01-10 00:45:12 -0800240 mask |= POLLIN | POLLRDNORM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
Dmitry Torokhov0c62fbf2012-01-10 00:45:12 -0800242 return mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243}
244
Arjan van de Ven2b8693c2007-02-12 00:55:32 -0800245static const struct file_operations serio_raw_fops = {
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700246 .owner = THIS_MODULE,
247 .open = serio_raw_open,
248 .release = serio_raw_release,
249 .read = serio_raw_read,
250 .write = serio_raw_write,
251 .poll = serio_raw_poll,
252 .fasync = serio_raw_fasync,
253 .llseek = noop_llseek,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254};
255
256
257/*********************************************************************
Dmitry Torokhov15a564d2011-10-10 18:30:56 -0700258 * Interface with serio port *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 *********************************************************************/
260
261static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
David Howells7d12e782006-10-05 14:55:46 +0100262 unsigned int dfl)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263{
264 struct serio_raw *serio_raw = serio_get_drvdata(serio);
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700265 struct serio_raw_client *client;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266 unsigned int head = serio_raw->head;
267
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700268 /* we are holding serio->lock here so we are protected */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269 serio_raw->queue[head] = data;
270 head = (head + 1) % SERIO_RAW_QUEUE_LEN;
271 if (likely(head != serio_raw->tail)) {
272 serio_raw->head = head;
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700273 list_for_each_entry(client, &serio_raw->client_list, node)
274 kill_fasync(&client->fasync, SIGIO, POLL_IN);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 wake_up_interruptible(&serio_raw->wait);
276 }
277
278 return IRQ_HANDLED;
279}
280
281static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
282{
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700283 static atomic_t serio_raw_no = ATOMIC_INIT(0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 struct serio_raw *serio_raw;
285 int err;
286
Dmitry Torokhov15a564d2011-10-10 18:30:56 -0700287 serio_raw = kzalloc(sizeof(struct serio_raw), GFP_KERNEL);
288 if (!serio_raw) {
Dmitry Torokhov8d928472011-10-10 18:30:46 -0700289 dev_dbg(&serio->dev, "can't allocate memory for a device\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290 return -ENOMEM;
291 }
292
Dmitry Torokhov15a564d2011-10-10 18:30:56 -0700293 snprintf(serio_raw->name, sizeof(serio_raw->name),
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700294 "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
Dmitry Torokhovba538cd2011-10-10 18:30:03 -0700295 kref_init(&serio_raw->kref);
Dmitry Torokhov7c5bbb22011-10-10 18:30:14 -0700296 INIT_LIST_HEAD(&serio_raw->client_list);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297 init_waitqueue_head(&serio_raw->wait);
298
Dmitry Torokhov85f5b352011-10-10 18:31:04 -0700299 serio_raw->serio = serio;
300 get_device(&serio->dev);
301
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 serio_set_drvdata(serio, serio_raw);
303
304 err = serio_open(serio, drv);
305 if (err)
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700306 goto err_free;
307
308 err = mutex_lock_killable(&serio_raw_mutex);
309 if (err)
310 goto err_close;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311
312 list_add_tail(&serio_raw->node, &serio_raw_list);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700313 mutex_unlock(&serio_raw_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
315 serio_raw->dev.minor = PSMOUSE_MINOR;
316 serio_raw->dev.name = serio_raw->name;
Greg Kroah-Hartman94fbcde2006-07-27 16:16:04 -0700317 serio_raw->dev.parent = &serio->dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 serio_raw->dev.fops = &serio_raw_fops;
319
320 err = misc_register(&serio_raw->dev);
321 if (err) {
322 serio_raw->dev.minor = MISC_DYNAMIC_MINOR;
323 err = misc_register(&serio_raw->dev);
324 }
325
326 if (err) {
Dmitry Torokhov8d928472011-10-10 18:30:46 -0700327 dev_err(&serio->dev,
328 "failed to register raw access device for %s\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329 serio->phys);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700330 goto err_unlink;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 }
332
Dmitry Torokhov8d928472011-10-10 18:30:46 -0700333 dev_info(&serio->dev, "raw access enabled on %s (%s, minor %d)\n",
334 serio->phys, serio_raw->name, serio_raw->dev.minor);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700335 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700337err_unlink:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 list_del_init(&serio_raw->node);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700339err_close:
340 serio_close(serio);
341err_free:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342 serio_set_drvdata(serio, NULL);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700343 kref_put(&serio_raw->kref, serio_raw_free);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 return err;
345}
346
347static int serio_raw_reconnect(struct serio *serio)
348{
349 struct serio_raw *serio_raw = serio_get_drvdata(serio);
350 struct serio_driver *drv = serio->drv;
351
352 if (!drv || !serio_raw) {
Dmitry Torokhov8d928472011-10-10 18:30:46 -0700353 dev_dbg(&serio->dev,
354 "reconnect request, but serio is disconnected, ignoring...\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355 return -1;
356 }
357
358 /*
359 * Nothing needs to be done here, we just need this method to
360 * keep the same device.
361 */
362 return 0;
363}
364
Dmitry Torokhov8c1c10d2011-10-10 18:31:30 -0700365/*
366 * Wake up users waiting for IO so they can disconnect from
367 * dead device.
368 */
369static void serio_raw_hangup(struct serio_raw *serio_raw)
370{
371 struct serio_raw_client *client;
372
373 serio_pause_rx(serio_raw->serio);
374 list_for_each_entry(client, &serio_raw->client_list, node)
375 kill_fasync(&client->fasync, SIGIO, POLL_HUP);
376 serio_continue_rx(serio_raw->serio);
377
378 wake_up_interruptible(&serio_raw->wait);
379}
380
381
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382static void serio_raw_disconnect(struct serio *serio)
383{
Dmitry Torokhov8c1c10d2011-10-10 18:31:30 -0700384 struct serio_raw *serio_raw = serio_get_drvdata(serio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700386 misc_deregister(&serio_raw->dev);
387
Arjan van de Venc4e32e92006-02-19 00:21:55 -0500388 mutex_lock(&serio_raw_mutex);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700389 serio_raw->dead = true;
390 list_del_init(&serio_raw->node);
391 mutex_unlock(&serio_raw_mutex);
392
393 serio_raw_hangup(serio_raw);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 serio_close(serio);
Dmitry Torokhov550eca72011-10-10 18:31:39 -0700396 kref_put(&serio_raw->kref, serio_raw_free);
Dmitry Torokhov8c1c10d2011-10-10 18:31:30 -0700397
398 serio_set_drvdata(serio, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399}
400
401static struct serio_device_id serio_raw_serio_ids[] = {
402 {
403 .type = SERIO_8042,
404 .proto = SERIO_ANY,
405 .id = SERIO_ANY,
406 .extra = SERIO_ANY,
407 },
Niels de Vosd19497e2008-09-04 22:20:11 -0400408 {
409 .type = SERIO_8042_XL,
410 .proto = SERIO_ANY,
411 .id = SERIO_ANY,
412 .extra = SERIO_ANY,
413 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 { 0 }
415};
416
417MODULE_DEVICE_TABLE(serio, serio_raw_serio_ids);
418
419static struct serio_driver serio_raw_drv = {
420 .driver = {
421 .name = "serio_raw",
422 },
423 .description = DRIVER_DESC,
424 .id_table = serio_raw_serio_ids,
425 .interrupt = serio_raw_interrupt,
426 .connect = serio_raw_connect,
427 .reconnect = serio_raw_reconnect,
428 .disconnect = serio_raw_disconnect,
Dmitry Torokhov8c31eb02011-10-10 18:30:36 -0700429 .manual_bind = true,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430};
431
432static int __init serio_raw_init(void)
433{
Akinobu Mita153a9df02006-11-23 23:35:10 -0500434 return serio_register_driver(&serio_raw_drv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435}
436
437static void __exit serio_raw_exit(void)
438{
439 serio_unregister_driver(&serio_raw_drv);
440}
441
442module_init(serio_raw_init);
443module_exit(serio_raw_exit);