mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
drivers: do not declare defines that are used only once
There is no gain at declaring the PID of the mice we support in libratbag-private.h Make it per driver, and remove the extra declarations. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -414,10 +414,12 @@ etekcity_remove(struct ratbag_device *device)
|
|||||||
free(ratbag_get_drv_data(device));
|
free(ratbag_get_drv_data(device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_ETEKCITY 0x1ea7
|
||||||
|
|
||||||
static const struct ratbag_id etekcity_table[] = {
|
static const struct ratbag_id etekcity_table[] = {
|
||||||
{.id = { .bustype = BUS_USB,
|
{.id = { .bustype = BUS_USB,
|
||||||
.vendor = USB_VENDOR_ID_ETEKCITY,
|
.vendor = USB_VENDOR_ID_ETEKCITY,
|
||||||
.product = USB_DEVICE_ID_ETEKCITY_SCROLL_ALPHA,
|
.product = 0x4011,
|
||||||
.version = VERSION_ANY },
|
.version = VERSION_ANY },
|
||||||
.data = 1,
|
.data = 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -140,11 +140,19 @@ unifying_init_feature(struct ratbag_device *device, uint16_t feature)
|
|||||||
}
|
}
|
||||||
case HIDPP_PAGE_SPECIAL_KEYS_BUTTONS: {
|
case HIDPP_PAGE_SPECIAL_KEYS_BUTTONS: {
|
||||||
struct hidpp20_control_id *controls;
|
struct hidpp20_control_id *controls;
|
||||||
|
// int i;
|
||||||
|
|
||||||
log_info(ratbag, "device has programmable keys/buttons\n");
|
log_info(ratbag, "device has programmable keys/buttons\n");
|
||||||
rc = hidpp20_special_key_mouse_get_controls(device, &controls);
|
rc = hidpp20_special_key_mouse_get_controls(device, &controls);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
// for (i = 0; i < rc; i++) {
|
||||||
|
// log_info(ratbag,
|
||||||
|
// "device is at %d dpi (variable between %d and %d).\n",
|
||||||
|
// sensors[0].dpi,
|
||||||
|
// sensors[0].dpi_min,
|
||||||
|
// sensors[0].dpi_max);
|
||||||
|
// }
|
||||||
|
|
||||||
free(controls);
|
free(controls);
|
||||||
drv_data->capabilities |= HIDPP_CAP_BUTTON_KEY_1b04;
|
drv_data->capabilities |= HIDPP_CAP_BUTTON_KEY_1b04;
|
||||||
@@ -235,22 +243,37 @@ unifying_remove(struct ratbag_device *device)
|
|||||||
free(ratbag_get_drv_data(device));
|
free(ratbag_get_drv_data(device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define USB_VENDOR_ID_LOGITECH 0x046d
|
||||||
|
|
||||||
static const struct ratbag_id unifying_table[] = {
|
static const struct ratbag_id unifying_table[] = {
|
||||||
|
/* M705 */
|
||||||
{.id = { .bustype = BUS_USB,
|
{.id = { .bustype = BUS_USB,
|
||||||
.vendor = USB_VENDOR_ID_LOGITECH,
|
.vendor = USB_VENDOR_ID_LOGITECH,
|
||||||
.product = USB_DEVICE_ID_LOGITECH_M705,
|
.product = 0x101b,
|
||||||
.version = VERSION_ANY },
|
.version = VERSION_ANY },
|
||||||
.data = 1,
|
.data = 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* M570 */
|
||||||
{.id = { .bustype = BUS_USB,
|
{.id = { .bustype = BUS_USB,
|
||||||
.vendor = USB_VENDOR_ID_LOGITECH,
|
.vendor = USB_VENDOR_ID_LOGITECH,
|
||||||
.product = USB_DEVICE_ID_LOGITECH_M570,
|
.product = 0x1028,
|
||||||
.version = VERSION_ANY },
|
.version = VERSION_ANY },
|
||||||
.data = 1,
|
.data = 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* MX Master over unifying */
|
||||||
{.id = { .bustype = BUS_USB,
|
{.id = { .bustype = BUS_USB,
|
||||||
.vendor = USB_VENDOR_ID_LOGITECH,
|
.vendor = USB_VENDOR_ID_LOGITECH,
|
||||||
.product = USB_DEVICE_ID_LOGITECH_MX_MASTER,
|
.product = 0x4041,
|
||||||
|
.version = VERSION_ANY },
|
||||||
|
.data = 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
/* MX Master over bluetooth */
|
||||||
|
{.id = { .bustype = BUS_BLUETOOTH,
|
||||||
|
.vendor = USB_VENDOR_ID_LOGITECH,
|
||||||
|
.product = 0xb012,
|
||||||
.version = VERSION_ANY },
|
.version = VERSION_ANY },
|
||||||
.data = 1,
|
.data = 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,15 +30,6 @@
|
|||||||
#include "libratbag.h"
|
#include "libratbag.h"
|
||||||
#include "libratbag-util.h"
|
#include "libratbag-util.h"
|
||||||
|
|
||||||
#define USB_VENDOR_ID_ETEKCITY 0x1ea7
|
|
||||||
#define USB_DEVICE_ID_ETEKCITY_SCROLL_ALPHA 0x4011
|
|
||||||
#define USB_VENDOR_ID_LOGITECH 0x046d
|
|
||||||
#define USB_DEVICE_ID_LOGITECH_M705 0x101b
|
|
||||||
#define USB_DEVICE_ID_LOGITECH_M570 0x1028
|
|
||||||
#define USB_DEVICE_ID_LOGITECH_MX_MASTER 0x4041
|
|
||||||
#define USB_DEVICE_ID_UNIFYING_RECEIVER 0xc52b
|
|
||||||
#define USB_DEVICE_ID_UNIFYING_RECEIVER2 0xc532
|
|
||||||
|
|
||||||
#define BUS_ANY 0xffff
|
#define BUS_ANY 0xffff
|
||||||
#define VENDOR_ANY 0xffff
|
#define VENDOR_ANY 0xffff
|
||||||
#define PRODUCT_ANY 0xffff
|
#define PRODUCT_ANY 0xffff
|
||||||
|
|||||||
Reference in New Issue
Block a user