Add LOGITECH_DEVICE macro for declaring Logitech devices in drivers

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2015-08-21 13:34:19 -04:00
parent 7b984b86ef
commit 5b8b2319e5
2 changed files with 16 additions and 30 deletions

View File

@@ -135,28 +135,21 @@ hidpp10drv_remove(struct ratbag_device *device)
}
#define USB_VENDOR_ID_LOGITECH 0x046d
#define LOGITECH_DEVICE(_bus, _pid) \
{ .bustype = (_bus), \
.vendor = USB_VENDOR_ID_LOGITECH, \
.product = (_pid), \
.version = VERSION_ANY },
static const struct ratbag_id hidpp10drv_table[] = {
/* M705 */
{.id = { .bustype = BUS_USB,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0x101b,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_USB, 0x101b) },
/* M570 */
{.id = { .bustype = BUS_USB,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0x1028,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_USB, 0x1028) },
/* G500s */
{.id = { .bustype = BUS_USB,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0xc24e,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_USB, 0xc24e) },
{ },
};

View File

@@ -372,28 +372,21 @@ hidpp20drv_remove(struct ratbag_device *device)
}
#define USB_VENDOR_ID_LOGITECH 0x046d
#define LOGITECH_DEVICE(_bus, _pid) \
{ .bustype = (_bus), \
.vendor = USB_VENDOR_ID_LOGITECH, \
.product = (_pid), \
.version = VERSION_ANY },
static const struct ratbag_id hidpp20drv_table[] = {
/* MX Master over unifying */
{.id = { .bustype = BUS_USB,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0x4041,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_USB, 0x4041) },
/* MX Master over bluetooth */
{.id = { .bustype = BUS_BLUETOOTH,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0xb012,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_BLUETOOTH, 0xb012) },
/* T650 over unifying */
{.id = { .bustype = BUS_USB,
.vendor = USB_VENDOR_ID_LOGITECH,
.product = 0x4101,
.version = VERSION_ANY },
},
{ .id = LOGITECH_DEVICE(BUS_USB, 0x4101) },
{ },
};