blob: 5b02d6cb0e60f2a6de4f64096ff35f708cf4b054 [file] [log] [blame]
David Herrmann1ccd7a22012-06-10 15:16:13 +02001/*
2 * User-space I/O driver support for HID subsystem
3 * Copyright (c) 2012 David Herrmann
4 */
5
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 as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 */
12
13#include <linux/atomic.h>
14#include <linux/device.h>
15#include <linux/fs.h>
16#include <linux/hid.h>
17#include <linux/input.h>
18#include <linux/miscdevice.h>
19#include <linux/module.h>
20#include <linux/mutex.h>
21#include <linux/poll.h>
22#include <linux/sched.h>
23#include <linux/spinlock.h>
24#include <linux/uhid.h>
25#include <linux/wait.h>
26
27#define UHID_NAME "uhid"
28
29static struct miscdevice uhid_misc;
30
31static int uhid_char_open(struct inode *inode, struct file *file)
32{
33 return 0;
34}
35
36static int uhid_char_release(struct inode *inode, struct file *file)
37{
38 return 0;
39}
40
41static ssize_t uhid_char_read(struct file *file, char __user *buffer,
42 size_t count, loff_t *ppos)
43{
44 return 0;
45}
46
47static ssize_t uhid_char_write(struct file *file, const char __user *buffer,
48 size_t count, loff_t *ppos)
49{
50 return 0;
51}
52
53static unsigned int uhid_char_poll(struct file *file, poll_table *wait)
54{
55 return 0;
56}
57
58static const struct file_operations uhid_fops = {
59 .owner = THIS_MODULE,
60 .open = uhid_char_open,
61 .release = uhid_char_release,
62 .read = uhid_char_read,
63 .write = uhid_char_write,
64 .poll = uhid_char_poll,
65 .llseek = no_llseek,
66};
67
68static struct miscdevice uhid_misc = {
69 .fops = &uhid_fops,
70 .minor = MISC_DYNAMIC_MINOR,
71 .name = UHID_NAME,
72};
73
74static int __init uhid_init(void)
75{
76 return misc_register(&uhid_misc);
77}
78
79static void __exit uhid_exit(void)
80{
81 misc_deregister(&uhid_misc);
82}
83
84module_init(uhid_init);
85module_exit(uhid_exit);
86MODULE_LICENSE("GPL");
87MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>");
88MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem");