summaryrefslogtreecommitdiff
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@mail.ru>2005-02-04 15:39:25 +0100
committerVojtech Pavlik <vojtech@suse.cz>2005-02-04 15:39:25 +0100
commite122050fef4216632a43bf6ebcaa44c3ad6b07cf (patch)
treee5525272fe8ba4577107d3572f72bbb06799ad33 /drivers/input/mouse
parent8f9ba920e5efff59cff044749a6cae9748f8b6f8 (diff)
Input: replace serio's type field with serio_id structure and
add id_table to serio drivers to split initial matching and probing routines for better sysfs integration and to assist hotplug scripts in loading proper drivers. Add serio_hotplug to notify userspace about new ports. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/psmouse-base.c30
-rw-r--r--drivers/input/mouse/sermouse.c58
-rw-r--r--drivers/input/mouse/synaptics.c2
-rw-r--r--drivers/input/mouse/vsxxxaa.c18
4 files changed, 88 insertions, 20 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 9151d1812da0..fdc0e457adfc 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -654,7 +654,7 @@ static void psmouse_disconnect(struct serio *serio)
psmouse = serio_get_drvdata(serio);
psmouse_set_state(psmouse, PSMOUSE_CMD_MODE);
- if (serio->parent && (serio->type & SERIO_TYPE) == SERIO_PS_PSTHRU) {
+ if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
parent = serio_get_drvdata(serio->parent);
if (parent->pt_deactivate)
parent->pt_deactivate(parent);
@@ -679,15 +679,11 @@ static void psmouse_connect(struct serio *serio, struct serio_driver *drv)
{
struct psmouse *psmouse, *parent = NULL;
- if ((serio->type & SERIO_TYPE) != SERIO_8042 &&
- (serio->type & SERIO_TYPE) != SERIO_PS_PSTHRU)
- return;
-
/*
* If this is a pass-through port deactivate parent so the device
* connected to this port can be successfully identified
*/
- if (serio->parent && (serio->type & SERIO_TYPE) == SERIO_PS_PSTHRU) {
+ if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
parent = serio_get_drvdata(serio->parent);
psmouse_deactivate(parent);
}
@@ -787,7 +783,7 @@ static int psmouse_reconnect(struct serio *serio)
return -1;
}
- if (serio->parent && (serio->type & SERIO_TYPE) == SERIO_PS_PSTHRU) {
+ if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
parent = serio_get_drvdata(serio->parent);
psmouse_deactivate(parent);
}
@@ -822,12 +818,30 @@ out:
return rc;
}
+static struct serio_device_id psmouse_serio_ids[] = {
+ {
+ .type = SERIO_8042,
+ .proto = SERIO_ANY,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_PS_PSTHRU,
+ .proto = SERIO_ANY,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ { 0 }
+};
+
+MODULE_DEVICE_TABLE(serio, psmouse_serio_ids);
static struct serio_driver psmouse_drv = {
.driver = {
.name = "psmouse",
},
.description = DRIVER_DESC,
+ .id_table = psmouse_serio_ids,
.interrupt = psmouse_interrupt,
.connect = psmouse_connect,
.reconnect = psmouse_reconnect,
@@ -874,7 +888,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun
goto out;
}
- if (serio->parent && (serio->type & SERIO_TYPE) == SERIO_PS_PSTHRU) {
+ if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
parent = serio_get_drvdata(serio->parent);
psmouse_deactivate(parent);
}
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
index 6e9b645149d3..590513e35338 100644
--- a/drivers/input/mouse/sermouse.c
+++ b/drivers/input/mouse/sermouse.c
@@ -246,10 +246,7 @@ static void sermouse_connect(struct serio *serio, struct serio_driver *drv)
struct sermouse *sermouse;
unsigned char c;
- if ((serio->type & SERIO_TYPE) != SERIO_RS232)
- return;
-
- if (!(serio->type & SERIO_PROTO) || ((serio->type & SERIO_PROTO) > SERIO_MZPP))
+ if (!serio->id.proto || serio->id.proto > SERIO_MZPP)
return;
if (!(sermouse = kmalloc(sizeof(struct sermouse), GFP_KERNEL)))
@@ -263,8 +260,8 @@ static void sermouse_connect(struct serio *serio, struct serio_driver *drv)
sermouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
sermouse->dev.private = sermouse;
- sermouse->type = serio->type & SERIO_PROTO;
- c = (serio->type & SERIO_EXTRA) >> 16;
+ sermouse->type = serio->id.proto;
+ c = serio->id.extra;
if (c & 0x01) set_bit(BTN_MIDDLE, sermouse->dev.keybit);
if (c & 0x02) set_bit(BTN_SIDE, sermouse->dev.keybit);
@@ -295,11 +292,60 @@ static void sermouse_connect(struct serio *serio, struct serio_driver *drv)
printk(KERN_INFO "input: %s on %s\n", sermouse_protocols[sermouse->type], serio->phys);
}
+static struct serio_device_id sermouse_serio_ids[] = {
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MSC,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_SUN,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MS,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MP,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MZ,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MZP,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_MZPP,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ { 0 }
+};
+
+MODULE_DEVICE_TABLE(serio, sermouse_serio_ids);
+
static struct serio_driver sermouse_drv = {
.driver = {
.name = "sermouse",
},
.description = DRIVER_DESC,
+ .id_table = sermouse_serio_ids,
.interrupt = sermouse_interrupt,
.connect = sermouse_connect,
.disconnect = sermouse_disconnect,
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 838b308bdd88..40931824ab75 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -288,7 +288,7 @@ static void synaptics_pt_create(struct psmouse *psmouse)
memset(serio, 0, sizeof(struct serio));
- serio->type = SERIO_PS_PSTHRU;
+ serio->id.type = SERIO_PS_PSTHRU;
strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name));
strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name));
serio->write = synaptics_pt_write;
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index 52974563c0d7..4544561cebd7 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -494,11 +494,6 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
{
struct vsxxxaa *mouse;
- if ((serio->type & SERIO_TYPE) != SERIO_RS232)
- return;
- if ((serio->type & SERIO_PROTO) != SERIO_VSXXXAA)
- return;
-
if (!(mouse = kmalloc (sizeof (struct vsxxxaa), GFP_KERNEL)))
return;
@@ -551,11 +546,24 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
printk (KERN_INFO "input: %s on %s\n", mouse->name, mouse->phys);
}
+static struct serio_device_id vsxxaa_serio_ids[] = {
+ {
+ .type = SERIO_RS232,
+ .proto = SERIO_VSXXXAA,
+ .id = SERIO_ANY,
+ .extra = SERIO_ANY,
+ },
+ { 0 }
+};
+
+MODULE_DEVICE_TABLE(serio, vsxxaa_serio_ids);
+
static struct serio_driver vsxxxaa_drv = {
.driver = {
.name = "vsxxxaa",
},
.description = DRIVER_DESC,
+ .id_table = vsxxaa_serio_ids,
.connect = vsxxxaa_connect,
.interrupt = vsxxxaa_interrupt,
.disconnect = vsxxxaa_disconnect,