drivers: usb: consolidate USB vendor IDs in one include file
Subsystems (9)
PATCH 1/1 drivers: usb: consolidate USB vendor IDs in one include file
Instead of redefining usb vendor IDs in several places, consolidate into one include file: include/linux/usb/usb_ids.h
--- drivers/hid/hid-ids.h | 15 ++------------ drivers/hid/wacom.h | 4 +--- drivers/input/joydev.c | 5 +---- drivers/input/mouse/bcm5974.c | 3 +-- drivers/input/mouse/synaptics_usb.c | 2 +- drivers/input/tablet/aiptek.c | 3 +-- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +- drivers/usb/serial/io_usbvend.h | 1 - include/linux/usb/usb_ids.h | 24 ++++++++++++++++++++++ 9 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 include/linux/usb/usb_ids.h
drivers/hid/hid-ids.h +2 -13
@@ -14,6 +14,8 @@#ifndef HID_IDS_H_FILE #define HID_IDS_H_FILE +#include <linux/usb/usb_ids.h> +#define USB_VENDOR_ID_258A 0x258a#define USB_DEVICE_ID_258A_6A88 0x6a88
@@ -46,7 +48,6 @@#define USB_VENDOR_ID_AFATECH 0x15a4#define USB_DEVICE_ID_AFATECH_AF9016 0x9016 -#define USB_VENDOR_ID_AIPTEK 0x08ca#define USB_DEVICE_ID_AIPTEK_01 0x0001#define USB_DEVICE_ID_AIPTEK_10 0x0010#define USB_DEVICE_ID_AIPTEK_20 0x0020
@@ -89,7 +90,6 @@#define USB_VENDOR_ID_ANTON 0x1130#define USB_DEVICE_ID_ANTON_TOUCH_PAD 0x3101 -#define USB_VENDOR_ID_APPLE 0x05ac#define BT_VENDOR_ID_APPLE 0x004c#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304#define USB_DEVICE_ID_APPLE_MAGICMOUSE 0x030d
@@ -658,7 +658,6 @@#define USB_VENDOR_ID_KEYTOUCH 0x0926#define USB_DEVICE_ID_KEYTOUCH_IEC 0x3333 -#define USB_VENDOR_ID_KYE 0x0458#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087#define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138#define USB_DEVICE_ID_GENIUS_MANTICORE 0x0153
@@ -715,7 +714,6 @@#define USB_DEVICE_ID_LD_HYBRID 0x2090#define USB_DEVICE_ID_LD_HEATCONTROL 0x20A0 -#define USB_VENDOR_ID_LENOVO 0x17ef#define USB_DEVICE_ID_LENOVO_TPKBD 0x6009#define USB_DEVICE_ID_LENOVO_CUSBKBD 0x6047#define USB_DEVICE_ID_LENOVO_CBTKBD 0x6048
@@ -963,7 +961,6 @@#define USB_VENDOR_ID_RAZER 0x1532#define USB_DEVICE_ID_RAZER_BLADE_14 0x011D -#define USB_VENDOR_ID_REALTEK 0x0bda#define USB_DEVICE_ID_REALTEK_READER 0x0152#define USB_VENDOR_ID_RETROUSB 0xf000
@@ -1029,8 +1026,6 @@#define USB_DEVICE_ID_SMK_NSG_MR5U_REMOTE 0x0368#define USB_DEVICE_ID_SMK_NSG_MR7U_REMOTE 0x0369 - -#define USB_VENDOR_ID_SONY 0x054c#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b#define USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE 0x0374#define USB_DEVICE_ID_SONY_PS3_BDREMOTE 0x0306
@@ -1082,7 +1077,6 @@#define USB_DEVICE_ID_SYMBOL_SCANNER_2 0x1300#define USB_DEVICE_ID_SYMBOL_SCANNER_3 0x1200 -#define USB_VENDOR_ID_SYNAPTICS 0x06cb#define USB_DEVICE_ID_SYNAPTICS_TP 0x0001#define USB_DEVICE_ID_SYNAPTICS_INT_TP 0x0002#define USB_DEVICE_ID_SYNAPTICS_CPAD 0x0003
@@ -1105,12 +1099,8 @@#define USB_VENDOR_ID_THINGM 0x27b8#define USB_DEVICE_ID_BLINK1 0x01ed -#define USB_VENDOR_ID_THQ 0x20d6 -#define USB_DEVICE_ID_THQ_PS3_UDRAW 0xcb17 -#define USB_VENDOR_ID_THRUSTMASTER 0x044f -#define USB_VENDOR_ID_TIVO 0x150a#define USB_DEVICE_ID_TIVO_SLIDE_BT 0x1200#define USB_DEVICE_ID_TIVO_SLIDE 0x1201#define USB_DEVICE_ID_TIVO_SLIDE_PRO 0x1203
@@ -1180,7 +1170,6 @@#define USB_VENDOR_ID_VTL 0x0306#define USB_DEVICE_ID_VTL_MULTITOUCH_FF3F 0xff3f -#define USB_VENDOR_ID_WACOM 0x056a#define USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH 0x81#define USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH 0x00BD
drivers/hid/wacom.h +1 -3
@@ -90,6 +90,7 @@#include <linux/kfifo.h> #include <linux/leds.h> #include <linux/usb/input.h> +#include <linux/usb/usb_ids.h> #include <linux/power_supply.h> #include <asm/unaligned.h>
@@ -100,9 +101,6 @@#define DRIVER_AUTHOR "Vojtech Pavlik <[email protected]>"#define DRIVER_DESC "USB Wacom tablet driver" -#define USB_VENDOR_ID_WACOM 0x056a -#define USB_VENDOR_ID_LENOVO 0x17ef -enum wacom_worker {WACOM_WORKER_WIRELESS ,WACOM_WORKER_BATTERY ,
drivers/input/joydev.c +1 -4
@@ -23,6 +23,7 @@#include <linux/init.h> #include <linux/device.h> #include <linux/cdev.h> +#include <linux/usb/usb_ids.h> MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>" );MODULE_DESCRIPTION ("Joystick device interfaces" );
@@ -747,15 +748,11 @@ static void joydev_cleanup(struct joydev *joydev)* These codes are copied from from hid-ids.h, unfortunately there is no common * usb_ids/bt_ids.h header. */ -#define USB_VENDOR_ID_SONY 0x054c#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268#define USB_DEVICE_ID_SONY_PS4_CONTROLLER 0x05c4#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2 0x09cc#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE 0x0ba0 -#define USB_VENDOR_ID_THQ 0x20d6 -#define USB_DEVICE_ID_THQ_PS3_UDRAW 0xcb17 -#define ACCEL_DEV (vnd, prd) \ { \ .flags = INPUT_DEVICE_ID_MATCH_VENDOR | \
drivers/input/mouse/bcm5974.c +1 -2
@@ -24,12 +24,11 @@#include <linux/slab.h> #include <linux/module.h> #include <linux/usb/input.h> +#include <linux/usb/usb_ids.h> #include <linux/hid.h> #include <linux/mutex.h> #include <linux/input/mt.h> -#define USB_VENDOR_ID_APPLE 0x05ac -/* MacbookAir, aka wellspring */ #define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI 0x0223#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO 0x0224
drivers/input/mouse/synaptics_usb.c +1 -1
@@ -39,10 +39,10 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/usb.h> +#include <linux/usb/usb_ids.h> #include <linux/input.h> #include <linux/usb/input.h> -#define USB_VENDOR_ID_SYNAPTICS 0x06cb#define USB_DEVICE_ID_SYNAPTICS_TP 0x0001/* Synaptics USB TouchPad */ #define USB_DEVICE_ID_SYNAPTICS_INT_TP 0x0002/* Integrated USB TouchPad */ #define USB_DEVICE_ID_SYNAPTICS_CPAD 0x0003/* Synaptics cPad */
drivers/input/tablet/aiptek.c +1 -2
@@ -62,6 +62,7 @@#include <linux/slab.h> #include <linux/module.h> #include <linux/usb/input.h> +#include <linux/usb/usb_ids.h> #include <linux/uaccess.h> #include <asm/unaligned.h>
@@ -162,8 +163,6 @@* (Step 9 can be omitted, but you'll then have no function keys.) */ -#define USB_VENDOR_ID_AIPTEK 0x08ca -#define USB_VENDOR_ID_KYE 0x0458#define USB_REQ_GET_REPORT 0x01#define USB_REQ_SET_REPORT 0x09
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -1
@@ -22,6 +22,7 @@#include <linux/spinlock.h> #include <linux/list.h> #include <linux/usb.h> +#include <linux/usb/usb_ids.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h>
@@ -64,7 +65,6 @@ MODULE_PARM_DESC(dma_agg_timeout, "Set DMA aggregation timeout (range 1-127)");module_param_named (dma_agg_pages, rtl8xxxu_dma_agg_pages, int,0600 );MODULE_PARM_DESC (dma_agg_pages,"Set DMA aggregation pages (range 1-127, 0 to disable)" ); -#define USB_VENDOR_ID_REALTEK 0x0bda#define RTL8XXXU_RX_URBS 32#define RTL8XXXU_RX_URB_PENDING_WATER 8#define RTL8XXXU_TX_URBS 64
drivers/usb/serial/io_usbvend.h +0 -1
@@ -26,7 +26,6 @@// #define USB_VENDOR_ID_ION 0x1608 // Our VID -#define USB_VENDOR_ID_TI 0x0451 // TI VID#define USB_VENDOR_ID_AXIOHM 0x05D9/* Axiohm VID */ //
include/linux/usb/usb_ids.h new file +24 -0
@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* USB Vendor and Device IDs +* +*/ +#ifndef _LINUX_USB_IDS_H +#define _LINUX_USB_IDS_H + +#define USB_VENDOR_ID_AIPTEK 0x08ca +#define USB_VENDOR_ID_APPLE 0x05ac +#define USB_VENDOR_ID_KYE 0x0458 +#define USB_VENDOR_ID_LENOVO 0x17ef +#define USB_VENDOR_ID_REALTEK 0x0bda +#define USB_VENDOR_ID_SONY 0x054c +#define USB_VENDOR_ID_SYNAPTICS 0x06cb + +#define USB_VENDOR_ID_THQ 0x20d6 +#define USB_DEVICE_ID_THQ_PS3_UDRAW 0xcb17 + +#define USB_VENDOR_ID_TI 0x0451 +#define USB_VENDOR_ID_TIVO 0x150a +#define USB_VENDOR_ID_WACOM 0x056a + +#endif /* _LINUX_USB_IDS_H */
Signature · 1 line
2.11.0
Quoted 2 lines · metux IT consult
Instead of redefining usb vendor IDs in several places, consolidate into one include file:
include/linux/usb/usb_ids.h
No, please no.
There's a specific reason we do not have this, unlike other operating systems. It's because merges are a pain, and touching the "big one file" ends up rebuilding too many things.
Read the top of the pci-ids.h file for why I do not want to see us do this for any other type of id. It's best to leave them where they are used, right in the driver itself.
thanks,
greg k-h
Greg KH
maintainerQuoted 2 lines · metux IT consult
Instead of redefining usb vendor IDs in several places, consolidate into one include file:
include/linux/usb/usb_ids.h
Also, you somehow forgot to cc: the USB maintainer, meaning this patch probably wouldn't be accepted anyway :)