Commit dbf4ccd6 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: psmouse - export protocol as a sysfs per-device attribute

       to allow easy switching at run-time.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 905ab9d1
This diff is collapsed.
......@@ -78,6 +78,7 @@ enum psmouse_type {
PSMOUSE_SYNAPTICS,
PSMOUSE_ALPS,
PSMOUSE_LIFEBOOK,
PSMOUSE_AUTO /* This one should always be last */
};
int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
......
......@@ -42,6 +42,7 @@ MODULE_LICENSE("GPL");
EXPORT_SYMBOL(serio_interrupt);
EXPORT_SYMBOL(__serio_register_port);
EXPORT_SYMBOL(serio_unregister_port);
EXPORT_SYMBOL(serio_unregister_child_port);
EXPORT_SYMBOL(__serio_unregister_port_delayed);
EXPORT_SYMBOL(__serio_register_driver);
EXPORT_SYMBOL(serio_unregister_driver);
......@@ -179,12 +180,12 @@ static void serio_queue_event(void *object, struct module *owner,
spin_lock_irqsave(&serio_event_lock, flags);
/*
* Scan event list for the other events for the same serio port,
* Scan event list for the other events for the same serio port,
* starting with the most recent one. If event is the same we
* do not need add new one. If event is of different type we
* need to add this event and should not look further because
* we need to preseve sequence of distinct events.
*/
*/
list_for_each_entry_reverse(event, &serio_event_list, node) {
if (event->object == object) {
if (event->type == event_type)
......@@ -653,6 +654,19 @@ void serio_unregister_port(struct serio *serio)
up(&serio_sem);
}
/*
* Safely unregisters child port if one is present.
*/
void serio_unregister_child_port(struct serio *serio)
{
down(&serio_sem);
if (serio->child) {
serio_disconnect_port(serio->child);
serio_destroy_port(serio->child);
}
up(&serio_sem);
}
/*
* Submits register request to kseriod for subsequent execution.
* Can be used when it is not obvious whether the serio_sem is
......
......@@ -83,6 +83,7 @@ static inline void serio_register_port(struct serio *serio)
}
void serio_unregister_port(struct serio *serio);
void serio_unregister_child_port(struct serio *serio);
void __serio_unregister_port_delayed(struct serio *serio, struct module *owner);
static inline void serio_unregister_port_delayed(struct serio *serio)
{
......@@ -153,6 +154,11 @@ static inline int serio_pin_driver(struct serio *serio)
return down_interruptible(&serio->drv_sem);
}
static inline void serio_pin_driver_uninterruptible(struct serio *serio)
{
down(&serio->drv_sem);
}
static inline void serio_unpin_driver(struct serio *serio)
{
up(&serio->drv_sem);
......
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