aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
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-08-26 18:12:12 -0400
commit1289a4da9f715c71d7fce707b330f1c6dc1b9150 (patch)
tree84653db8e715c323551d40ce0386c1d75cb4dfc5 /include/linux
parent0135372d5c4305a59aee0091847da7ce0cf08ffe (diff)
USB: add USB_VENDOR_AND_INTERFACE_INFO() macro
commit d81a5d1956731c453b85c141458d4ff5d6cc5366 upstream. 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')
-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 b08e04cf202..6cd15762977 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -757,6 +757,27 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
757 .bInterfaceSubClass = (sc), \ 757 .bInterfaceSubClass = (sc), \
758 .bInterfaceProtocol = (pr) 758 .bInterfaceProtocol = (pr)
759 759
760/**
761 * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
762 * @vend: the 16 bit USB Vendor ID
763 * @cl: bInterfaceClass value
764 * @sc: bInterfaceSubClass value
765 * @pr: bInterfaceProtocol value
766 *
767 * This macro is used to create a struct usb_device_id that matches a
768 * specific vendor with a specific class of interfaces.
769 *
770 * This is especially useful when explicitly matching devices that have
771 * vendor specific bDeviceClass values, but standards-compliant interfaces.
772 */
773#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
774 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
775 | USB_DEVICE_ID_MATCH_VENDOR, \
776 .idVendor = (vend), \
777 .bInterfaceClass = (cl), \
778 .bInterfaceSubClass = (sc), \
779 .bInterfaceProtocol = (pr)
780
760/* ----------------------------------------------------------------------- */ 781/* ----------------------------------------------------------------------- */
761 782
762/* Stuff for dynamic usb ids */ 783/* Stuff for dynamic usb ids */