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) ...@@ -92,8 +92,9 @@ static void serio_find_driver(struct serio *serio)
struct serio_driver *drv; struct serio_driver *drv;
list_for_each_entry(drv, &serio_driver_list, node) list_for_each_entry(drv, &serio_driver_list, node)
if (serio_bind_driver(serio, drv)) if (!drv->manual_bind)
break; if (serio_bind_driver(serio, drv))
break;
} }
/* /*
...@@ -494,6 +495,9 @@ void serio_register_driver(struct serio_driver *drv) ...@@ -494,6 +495,9 @@ void serio_register_driver(struct serio_driver *drv)
driver_register(&drv->driver); driver_register(&drv->driver);
driver_create_file(&drv->driver, &driver_attr_description); driver_create_file(&drv->driver, &driver_attr_description);
if (drv->manual_bind)
goto out;
start_over: start_over:
list_for_each_entry(serio, &serio_list, node) { list_for_each_entry(serio, &serio_list, node) {
if (!serio->drv) { if (!serio->drv) {
...@@ -507,6 +511,7 @@ void serio_register_driver(struct serio_driver *drv) ...@@ -507,6 +511,7 @@ void serio_register_driver(struct serio_driver *drv)
} }
} }
out:
up(&serio_sem); up(&serio_sem);
} }
......
...@@ -55,6 +55,8 @@ struct serio_driver { ...@@ -55,6 +55,8 @@ struct serio_driver {
void *private; void *private;
char *description; char *description;
int manual_bind;
void (*write_wakeup)(struct serio *); void (*write_wakeup)(struct serio *);
irqreturn_t (*interrupt)(struct serio *, unsigned char, irqreturn_t (*interrupt)(struct serio *, unsigned char,
unsigned int, struct pt_regs *); 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