-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathvinput.h
47 lines (37 loc) · 953 Bytes
/
vinput.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
#define VINPUT_MAX_LEN 128
#define MAX_VINPUT 32
#define VINPUT_MINORS MAX_VINPUT
#define dev_to_vinput(dev) container_of(dev, struct vinput, dev)
struct vinput_device;
struct vinput {
long id;
long devno;
long last_entry;
spinlock_t lock;
void *priv_data;
struct device dev;
struct list_head list;
struct input_dev *input;
struct vinput_device *type;
};
struct vinput_ops {
int (*init) (struct vinput *);
int (*kill) (struct vinput *);
int (*send) (struct vinput *, char *, int);
int (*read) (struct vinput *, char *, int);
};
struct vinput_device {
char name[16];
struct list_head list;
struct vinput_ops *ops;
};
int vinput_register(struct vinput_device *dev);
void vinput_unregister(struct vinput_device *dev);