summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-06 22:47:51 (GMT)
committerSimon Glass <sjg@chromium.org>2015-07-21 23:39:40 (GMT)
commitabb59cffcf2094cf1e2c9e44333df1c51f623e1e (patch)
tree082c954c380ffc88364f2fd09081038ba18f0d52 /include
parentc8c2797c381054beaf3de89027af92a0b84b36cc (diff)
downloadu-boot-abb59cffcf2094cf1e2c9e44333df1c51f623e1e.tar.xz
dm: usb: Adjust the USB_DEVICE() macro naming
In Linux USB_DEVICE() is used to declare a USB device by vendor/device ID. We should follow the same convention in U-Boot. Rename the existing USB_DEVICE() macro to U_BOOT_USB_DEVICE() and bring in the USB_DEVICE() macro from Linux for use in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/usb.h b/include/usb.h
index 110ac69..cf00ffd 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -501,7 +501,23 @@ struct usb_driver_entry {
const struct usb_device_id *match;
};
-#define USB_DEVICE(__name, __match) \
+#define USB_DEVICE_ID_MATCH_DEVICE \
+ (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
+
+/**
+ * USB_DEVICE - macro used to describe a specific usb device
+ * @vend: the 16 bit USB Vendor ID
+ * @prod: the 16 bit USB Product ID
+ *
+ * This macro is used to create a struct usb_device_id that matches a
+ * specific device.
+ */
+#define USB_DEVICE(vend, prod) \
+ .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \
+ .idVendor = (vend), \
+ .idProduct = (prod)
+
+#define U_BOOT_USB_DEVICE(__name, __match) \
ll_entry_declare(struct usb_driver_entry, __name, usb_driver_entry) = {\
.driver = llsym(struct driver, __name, driver), \
.match = __match, \