From 7f8d4cad1e4e11a45d02bd6e024cc2812963c38a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 8 Oct 2012 09:07:24 -0700 Subject: Input: extend the number of event (and other) devices Extend the amount of character devices, such as eventX, mouseX and jsX, from a hard limit of 32 per input handler to about 1024 shared across all handlers. To be compatible with legacy installations input handlers will start creating char devices with minors in their legacy range, however once legacy range is exhausted they will start allocating minors from the dynamic range 256-1024. Reviewed-by: David Herrmann Signed-off-by: Dmitry Torokhov --- include/linux/input.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/linux/input.h') diff --git a/include/linux/input.h b/include/linux/input.h index ba4874302939..15464ba6bf53 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -1396,8 +1396,8 @@ struct input_handle; * @start: starts handler for given handle. This function is called by * input core right after connect() method and also when a process * that "grabbed" a device releases it - * @fops: file operations this driver implements - * @minor: beginning of range of 32 minors for devices this driver + * @legacy_minors: set to %true by drivers using legacy minor ranges + * @minor: beginning of range of 32 legacy minors for devices this driver * can provide * @name: name of the handler, to be shown in /proc/bus/input/handlers * @id_table: pointer to a table of input_device_ids this driver can @@ -1431,7 +1431,7 @@ struct input_handler { void (*disconnect)(struct input_handle *handle); void (*start)(struct input_handle *handle); - const struct file_operations *fops; + bool legacy_minors; int minor; const char *name; @@ -1499,6 +1499,10 @@ void input_reset_device(struct input_dev *); int __must_check input_register_handler(struct input_handler *); void input_unregister_handler(struct input_handler *); +int __must_check input_get_new_minor(int legacy_base, unsigned int legacy_num, + bool allow_dynamic); +void input_free_minor(unsigned int minor); + int input_handler_for_each_handle(struct input_handler *, void *data, int (*fn)(struct input_handle *, void *)); -- cgit v1.2.3