From 6b1968d5b6e223237bca98879f31c5616b3b325f Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Fri, 9 Mar 2012 13:55:43 +0100 Subject: HID: make it possible to force hid-core claim the device Introduce 'hid_ignore_special_drivers' module parameter that makes hid-core claim the device even if it's listed in hid_have_special_driver[]. This is useful mostly for debugging purposes and specialized initrds, where all the hid drivers are not avaiable. Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/hid') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d76d85a4162..fbecdd3e7cd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -4,7 +4,7 @@ * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2005 Vojtech Pavlik * Copyright (c) 2005 Michael Haboustak for Concept2, Inc - * Copyright (c) 2006-2010 Jiri Kosina + * Copyright (c) 2006-2012 Jiri Kosina */ /* @@ -50,6 +50,10 @@ module_param_named(debug, hid_debug, int, 0600); MODULE_PARM_DESC(debug, "toggle HID debugging messages"); EXPORT_SYMBOL_GPL(hid_debug); +static int hid_ignore_special_drivers = 0; +module_param_named(ignore_special_drivers, hid_ignore_special_drivers, int, 0600); +MODULE_PARM_DESC(debug, "Ignore any special drivers and handle all devices by generic driver"); + /* * Register a new report for a device. */ @@ -1678,7 +1682,7 @@ static int hid_bus_match(struct device *dev, struct device_driver *drv) return 0; /* generic wants all that don't have specialized driver */ - if (!strncmp(hdrv->name, "generic-", 8)) + if (!strncmp(hdrv->name, "generic-", 8) && !hid_ignore_special_drivers) return !hid_match_id(hdev, hid_have_special_driver); return 1; -- cgit v1.2.3