]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
dm: usb: Adjust the USB_DEVICE() macro naming
authorSimon Glass <sjg@chromium.org>
Mon, 6 Jul 2015 22:47:51 +0000 (16:47 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:48:58 +0000 (13:48 +0200)
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>
common/usb_hub.c
common/usb_kbd.c
common/usb_storage.c
drivers/usb/Kconfig
drivers/usb/eth/usb_ether.c
include/usb.h

index be01f4f257d9a1ec3ae2f9294d39e734ba683cc4..f621ddb9ab5debe7c6b65514f2b04ee408167bfc 100644 (file)
@@ -652,6 +652,6 @@ static const struct usb_device_id hub_id_table[] = {
        { }     /* Terminating entry */
 };
 
-USB_DEVICE(usb_generic_hub, hub_id_table);
+U_BOOT_USB_DEVICE(usb_generic_hub, hub_id_table);
 
 #endif
index e2af67d2f0a783c13709f57bd15d1b9d87f5f7ce..0227024441710041a4cbcb2fd5c30920ad9078a6 100644 (file)
@@ -540,8 +540,8 @@ int drv_usb_kbd_init(void)
        debug("%s: Probing for keyboard\n", __func__);
 #ifdef CONFIG_DM_USB
        /*
-        * TODO: We should add USB_DEVICE() declarations to each USB ethernet
-        * driver and then most of this file can be removed.
+        * TODO: We should add U_BOOT_USB_DEVICE() declarations to each USB
+        * keyboard driver and then most of this file can be removed.
         */
        struct udevice *bus;
        struct uclass *uc;
index cc9b3e37a1cbec27ce9acbab1bbb7f9e973f5374..b9784304086ecdc7ec7beaaeedb853af513824de 100644 (file)
@@ -1442,6 +1442,6 @@ static const struct usb_device_id mass_storage_id_table[] = {
        { }             /* Terminating entry */
 };
 
-USB_DEVICE(usb_mass_storage, mass_storage_id_table);
+U_BOOT_USB_DEVICE(usb_mass_storage, mass_storage_id_table);
 
 #endif
index 637ef3d567e88c348d8c362d6a145cf1d074c733..3fa5b2e37e81c86171e35a8167116c2a469a9e6e 100644 (file)
@@ -46,8 +46,8 @@ config DM_USB
 
          Much of the code is shared but with this option enabled the USB
          uclass takes care of device enumeration. USB devices can be
-         declared with the USB_DEVICE() macro and will be automatically
-         probed when found on the bus.
+         declared with the U_BOOT_USB_DEVICE() macro and will be
+         automatically probed when found on the bus.
 
 source "drivers/usb/host/Kconfig"
 
index 07d230988329fce83c9e5b4852c9314dce7f9e53..63785a9c598195cbb9d9465154622c059ba24ff4 100644 (file)
@@ -266,8 +266,8 @@ int usb_host_eth_scan(int mode)
        usb_max_eth_dev = 0;
 #ifdef CONFIG_DM_USB
        /*
-        * TODO: We should add USB_DEVICE() declarations to each USB ethernet
-        * driver and then most of this file can be removed.
+        * TODO: We should add U_BOOT_USB_DEVICE() declarations to each USB
+        * Ethernet driver and then most of this file can be removed.
         */
        struct udevice *bus;
        struct uclass *uc;
index 110ac693552f5f963861353a446870843ce0dc29..cf00ffdf53234a83d2981d582c04e23ca7b6e76b 100644 (file)
@@ -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, \