Commit 876311cd authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: allow marking some drivers (that don't do HW autodetection)

       as manual bind only. Such drivers will only be bound to a
       serio port if user requests it by echoing driver name into
       port's sysfs driver attribute.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 514c2a8f
......@@ -92,8 +92,9 @@ static void serio_find_driver(struct serio *serio)
struct serio_driver *drv;
list_for_each_entry(drv, &serio_driver_list, node)
if (serio_bind_driver(serio, drv))
break;
if (!drv->manual_bind)
if (serio_bind_driver(serio, drv))
break;
}
/*
......@@ -494,6 +495,9 @@ void serio_register_driver(struct serio_driver *drv)
driver_register(&drv->driver);
driver_create_file(&drv->driver, &driver_attr_description);
if (drv->manual_bind)
goto out;
start_over:
list_for_each_entry(serio, &serio_list, node) {
if (!serio->drv) {
......@@ -507,6 +511,7 @@ void serio_register_driver(struct serio_driver *drv)
}
}
out:
up(&serio_sem);
}
......
......@@ -55,6 +55,8 @@ struct serio_driver {
void *private;
char *description;
int manual_bind;
void (*write_wakeup)(struct serio *);
irqreturn_t (*interrupt)(struct serio *, unsigned char,
unsigned int, struct pt_regs *);
......
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