aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-06-01 03:40:01 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-06-01 03:40:01 -0400
commitdbf4ccd6043e58ed32fbf253fb3f0a9991e4c13a (patch)
treedeeb41b5006f28967466ae2775af09542d10ca7e /drivers/input/serio
parent905ab9d13694d0f75d1cb8c076ff2027538312ce (diff)
Input: psmouse - export protocol as a sysfs per-device attribute
to allow easy switching at run-time. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/serio.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index b82815a0b65b..615bf62ad468 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -42,6 +42,7 @@ MODULE_LICENSE("GPL");
42EXPORT_SYMBOL(serio_interrupt); 42EXPORT_SYMBOL(serio_interrupt);
43EXPORT_SYMBOL(__serio_register_port); 43EXPORT_SYMBOL(__serio_register_port);
44EXPORT_SYMBOL(serio_unregister_port); 44EXPORT_SYMBOL(serio_unregister_port);
45EXPORT_SYMBOL(serio_unregister_child_port);
45EXPORT_SYMBOL(__serio_unregister_port_delayed); 46EXPORT_SYMBOL(__serio_unregister_port_delayed);
46EXPORT_SYMBOL(__serio_register_driver); 47EXPORT_SYMBOL(__serio_register_driver);
47EXPORT_SYMBOL(serio_unregister_driver); 48EXPORT_SYMBOL(serio_unregister_driver);
@@ -179,12 +180,12 @@ static void serio_queue_event(void *object, struct module *owner,
179 spin_lock_irqsave(&serio_event_lock, flags); 180 spin_lock_irqsave(&serio_event_lock, flags);
180 181
181 /* 182 /*
182 * Scan event list for the other events for the same serio port, 183 * Scan event list for the other events for the same serio port,
183 * starting with the most recent one. If event is the same we 184 * starting with the most recent one. If event is the same we
184 * do not need add new one. If event is of different type we 185 * do not need add new one. If event is of different type we
185 * need to add this event and should not look further because 186 * need to add this event and should not look further because
186 * we need to preseve sequence of distinct events. 187 * we need to preseve sequence of distinct events.
187 */ 188 */
188 list_for_each_entry_reverse(event, &serio_event_list, node) { 189 list_for_each_entry_reverse(event, &serio_event_list, node) {
189 if (event->object == object) { 190 if (event->object == object) {
190 if (event->type == event_type) 191 if (event->type == event_type)
@@ -654,6 +655,19 @@ void serio_unregister_port(struct serio *serio)
654} 655}
655 656
656/* 657/*
658 * Safely unregisters child port if one is present.
659 */
660void serio_unregister_child_port(struct serio *serio)
661{
662 down(&serio_sem);
663 if (serio->child) {
664 serio_disconnect_port(serio->child);
665 serio_destroy_port(serio->child);
666 }
667 up(&serio_sem);
668}
669
670/*
657 * Submits register request to kseriod for subsequent execution. 671 * Submits register request to kseriod for subsequent execution.
658 * Can be used when it is not obvious whether the serio_sem is 672 * Can be used when it is not obvious whether the serio_sem is
659 * taken or not and when delayed execution is feasible. 673 * taken or not and when delayed execution is feasible.