mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-22 13:58:19 +08:00
636c1e702d
Add the new section of input device driver, vinput[1]. Also, update the Acknowledgements. [1] https://github.com/sysprog21/vinput
46 lines
880 B
C
46 lines
880 B
C
#ifndef VINPUT_H
|
|
#define VINPUT_H
|
|
|
|
#include <linux/input.h>
|
|
#include <linux/spinlock.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);
|
|
|
|
#endif
|