PATCH 9/19] serio manual bind

From: Dmitry Torokhov
Date: Mon Jun 28 2004 - 00:36:22 EST



===================================================================


ChangeSet@xxxxxx, 2004-06-27 15:56:35-05:00, dtor_core@xxxxxxxxxxxxx
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: Dmitry Torokhov <dtor@xxxxxxx>


drivers/input/serio/serio.c | 9 +++++++--
include/linux/serio.h | 2 ++
2 files changed, 9 insertions(+), 2 deletions(-)


===================================================================



diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c 2004-06-27 17:49:39 -05:00
+++ b/drivers/input/serio/serio.c 2004-06-27 17:49:39 -05:00
@@ -92,8 +92,9 @@
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;
}

/*
@@ -502,6 +503,9 @@
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) {
@@ -515,6 +519,7 @@
}
}

+out:
up(&serio_sem);
}

diff -Nru a/include/linux/serio.h b/include/linux/serio.h
--- a/include/linux/serio.h 2004-06-27 17:49:39 -05:00
+++ b/include/linux/serio.h 2004-06-27 17:49:39 -05:00
@@ -55,6 +55,8 @@
void *private;
char *description;

+ int manual_bind;
+
void (*write_wakeup)(struct serio *);
irqreturn_t (*interrupt)(struct serio *, unsigned char,
unsigned int, struct pt_regs *);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/