diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-04-16 17:19:50 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-04-19 13:11:43 +0200 |
commit | b5e5a37e36cd4d355b875665312d7aaae4e5833c (patch) | |
tree | 0c78a6367e115004ef5ebb237d3bc14d63e93d9d /drivers/hid/hid-core.c | |
parent | 75c28df87eb6d8e1389af67f26fbe2394e28385e (diff) | |
download | linux-stable-b5e5a37e36cd4d355b875665312d7aaae4e5833c.tar.gz linux-stable-b5e5a37e36cd4d355b875665312d7aaae4e5833c.tar.bz2 linux-stable-b5e5a37e36cd4d355b875665312d7aaae4e5833c.zip |
HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE
Add two quirks to make it possible for usbhid module options to
override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).
Passing HID_QUIRK_NO_IGNORE for your device means that it will
not be ignored by the HID layer, even if present in a blacklist.
HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
device, making it accessible from user-space.
Tested with an Apple IR Receiver, switching it from using appleir
to using lirc's macmini driver.
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8617aa97a9c8..468c6c2d4ad5 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1168,6 +1168,8 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) unsigned int i; int len; + if (hdev->quirks & HID_QUIRK_HIDDEV_FORCE) + connect_mask |= (HID_CONNECT_HIDDEV_FORCE | HID_CONNECT_HIDDEV); if (hdev->bus != BUS_USB) connect_mask &= ~HID_CONNECT_HIDDEV; if (hid_hiddev(hdev)) @@ -1757,7 +1759,7 @@ int hid_add_device(struct hid_device *hdev) /* we need to kill them here, otherwise they will stay allocated to * wait for coming driver */ - if (hid_ignore(hdev)) + if (!(hdev->quirks & HID_QUIRK_NO_IGNORE) && hid_ignore(hdev)) return -ENODEV; /* XXX hack, any other cleaner solution after the driver core |