aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-07-10 18:10:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 20:43:04 -0400
commitd81a5d1956731c453b85c141458d4ff5d6cc5366 (patch)
tree528644bc7138ce2c00e4075d9caf4f575f8d92e9 /include/linux/usb.h
parent925aa46ba963a4da6d8ee6ab1d04a02ffa8db62b (diff)
USB: add USB_VENDOR_AND_INTERFACE_INFO() macro
A lot of Broadcom Bluetooth devices provides vendor specific interface class and we are getting flooded by patches adding new device support. This change will help us enable support for any other Broadcom with vendor specific device that arrives in the future. Only the product id changes for those devices, so this macro would be perfect for us: { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) } Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Acked-by: Henrik Rydberg <rydberg@bitmath.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 873956bec25e..30d1ae38eab1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -861,6 +861,27 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
861 .bInterfaceSubClass = (sc), \ 861 .bInterfaceSubClass = (sc), \
862 .bInterfaceProtocol = (pr) 862 .bInterfaceProtocol = (pr)
863 863
864/**
865 * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
866 * @vend: the 16 bit USB Vendor ID
867 * @cl: bInterfaceClass value
868 * @sc: bInterfaceSubClass value
869 * @pr: bInterfaceProtocol value
870 *
871 * This macro is used to create a struct usb_device_id that matches a
872 * specific vendor with a specific class of interfaces.
873 *
874 * This is especially useful when explicitly matching devices that have
875 * vendor specific bDeviceClass values, but standards-compliant interfaces.
876 */
877#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
878 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
879 | USB_DEVICE_ID_MATCH_VENDOR, \
880 .idVendor = (vend), \
881 .bInterfaceClass = (cl), \
882 .bInterfaceSubClass = (sc), \
883 .bInterfaceProtocol = (pr)
884
864/* ----------------------------------------------------------------------- */ 885/* ----------------------------------------------------------------------- */
865 886
866/* Stuff for dynamic usb ids */ 887/* Stuff for dynamic usb ids */