Commit ab910003 authored by Patrick Mochel's avatar Patrick Mochel

Define a struct device_interface for all the input interfaces and register

them with the input device class when started up. 
parent 6d85befd
......@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/input.h>
#include <linux/init.h>
#include <linux/device.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Input driver event debug module");
......@@ -87,8 +88,14 @@ static struct input_handler evbug_handler = {
.id_table = evbug_ids,
};
static struct device_interface evbug_intf = {
.name = "debug",
.devclass = &input_devclass,
};
int __init evbug_init(void)
{
interface_register(&evbug_intf);
input_register_handler(&evbug_handler);
return 0;
}
......@@ -96,6 +103,7 @@ int __init evbug_init(void)
void __exit evbug_exit(void)
{
input_unregister_handler(&evbug_handler);
interface_register(&evbug_intf);
}
module_init(evbug_init);
......
......@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/input.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
struct evdev {
int exist;
......@@ -484,8 +485,14 @@ static struct input_handler evdev_handler = {
.id_table = evdev_ids,
};
static struct device_interface evdev_intf = {
.name = "event",
.devclass = &input_devclass,
};
static int __init evdev_init(void)
{
interface_register(&evdev_intf);
input_register_handler(&evdev_handler);
return 0;
}
......@@ -493,6 +500,7 @@ static int __init evdev_init(void)
static void __exit evdev_exit(void)
{
input_unregister_handler(&evdev_handler);
interface_register(&evdev_intf);
}
module_init(evdev_init);
......
......@@ -42,6 +42,7 @@
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Joystick device interfaces");
......@@ -534,8 +535,14 @@ static struct input_handler joydev_handler = {
.id_table = joydev_ids,
};
static struct device_interface joydev_intf = {
.name = "joystick",
.devclass = &input_devclass,
};
static int __init joydev_init(void)
{
interface_register(&joydev_intf);
input_register_handler(&joydev_handler);
return 0;
}
......@@ -543,6 +550,7 @@ static int __init joydev_init(void)
static void __exit joydev_exit(void)
{
input_unregister_handler(&joydev_handler);
interface_unregister(&joydev_intf);
}
module_init(joydev_init);
......
......@@ -39,6 +39,7 @@
#include <linux/smp_lock.h>
#include <linux/random.h>
#include <linux/major.h>
#include <linux/device.h>
#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
#include <linux/miscdevice.h>
#endif
......@@ -516,8 +517,14 @@ static struct miscdevice psaux_mouse = {
};
#endif
static struct device_interface mousedev_intf = {
.name = "mouse",
.devclass = &input_devclass,
};
static int __init mousedev_init(void)
{
interface_register(&mousedev_intf);
input_register_handler(&mousedev_handler);
memset(&mousedev_mix, 0, sizeof(struct mousedev));
......@@ -542,6 +549,7 @@ static void __exit mousedev_exit(void)
#endif
input_unregister_minor(mousedev_mix.devfs);
input_unregister_handler(&mousedev_handler);
interface_unregister(&mousedev_intf);
}
module_init(mousedev_init);
......
......@@ -40,6 +40,7 @@
#include <linux/smp_lock.h>
#include <linux/random.h>
#include <linux/time.h>
#include <linux/device.h>
#ifndef CONFIG_INPUT_TSDEV_SCREEN_X
#define CONFIG_INPUT_TSDEV_SCREEN_X 240
......@@ -420,8 +421,14 @@ static struct input_handler tsdev_handler = {
.id_table = tsdev_ids,
};
static struct device_interface tsdev_intf = {
.name = "touchscreen",
.devclass = &input_devclass,
};
static int __init tsdev_init(void)
{
interface_register(&tsdev_intf);
input_register_handler(&tsdev_handler);
printk(KERN_INFO "ts: Compaq touchscreen protocol output\n");
return 0;
......@@ -430,6 +437,7 @@ static int __init tsdev_init(void)
static void __exit tsdev_exit(void)
{
input_unregister_handler(&tsdev_handler);
interface_unregister(&tsdev_intf);
}
module_init(tsdev_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment