Revert "hidpp20: add quirk system"

This reverts commit 196d53e65f.
This commit is contained in:
Peter Hutterer
2019-08-01 09:34:00 +10:00
parent 4f5d0dffec
commit 11f4f32947
5 changed files with 0 additions and 52 deletions

View File

@@ -1560,15 +1560,10 @@ hidpp20drv_probe(struct ratbag_device *device)
goto err;
}
dev->quirk = ratbag_device_data_hidpp20_get_quirk(device->data);
drv_data->dev = dev;
log_debug(device->ratbag, "'%s' is using protocol v%d.%d\n", ratbag_device_get_name(device), dev->proto_major, dev->proto_minor);
if(dev->quirk != HIDPP20_QUIRK_NONE)
log_debug(device->ratbag, "'%s' is quirked (%s)\n", ratbag_device_get_name(device), hidpp20_get_quirk_string(dev->quirk));
/* add some defaults that will be overwritten by the device */
drv_data->num_profiles = 1;
drv_data->num_resolutions = 1;

View File

@@ -99,24 +99,6 @@ hidpp20_sw_led_control_get_mode_string(const enum hidpp20_led_sw_ctrl_led_mode m
str = numeric;
break;
}
return str;
}
const char*
hidpp20_get_quirk_string(unsigned quirk)
{
static char numeric[8];
const char* str = NULL;
switch (quirk)
{
CASE_RETURN_STRING(HIDPP20_QUIRK_NONE);
CASE_RETURN_STRING(HIDPP20_QUIRK_G305);
default:
sprintf_safe(numeric, "%#4x", quirk);
str = numeric;
break;
}
#undef CASE_RETURN_STRING
return str;

View File

@@ -58,15 +58,12 @@ struct hidpp20_device {
unsigned proto_minor;
unsigned feature_count;
struct hidpp20_feature *feature_list;
unsigned quirk;
};
int hidpp20_request_command(struct hidpp20_device *dev, union hidpp20_message *msg);
const char *hidpp20_feature_get_name(uint16_t feature);
const char *hidpp20_get_quirk_string(unsigned quirk);
/* -------------------------------------------------------------------------- */
/* generic hidpp20 device operations */
/* -------------------------------------------------------------------------- */
@@ -77,15 +74,6 @@ hidpp20_device_new(const struct hidpp_device *base, unsigned int idx);
void
hidpp20_device_destroy(struct hidpp20_device *device);
/* -------------------------------------------------------------------------- */
/* quirks */
/* -------------------------------------------------------------------------- */
enum {
HIDPP20_QUIRK_NONE,
}
#define HIDPP20_QUIRK_G305 1
/* -------------------------------------------------------------------------- */
/* 0x0000: Root */
/* -------------------------------------------------------------------------- */

View File

@@ -33,7 +33,6 @@
#include "libratbag.h"
#include "libratbag-private.h"
#include "libratbag-data.h"
#include "hidpp20.h"
#define GROUP_DEVICE "Device"
@@ -55,7 +54,6 @@ enum driver {
struct data_hidpp20 {
int index;
unsigned quirk;
};
struct data_hidpp10 {
@@ -154,7 +152,6 @@ init_data_hidpp20(struct ratbag *ratbag,
const char *group = "Driver/hidpp20";
GError *error = NULL;
int num;
char *str;
data->hidpp20.index = -1;
@@ -163,9 +160,6 @@ init_data_hidpp20(struct ratbag *ratbag,
data->hidpp20.index = num;
if (error)
g_error_free(error);
str = g_key_file_get_string(keyfile, group, "Quirk", NULL);
data->hidpp20.quirk = HIDPP20_QUIRK_NONE;
}
static void
@@ -568,14 +562,6 @@ ratbag_device_data_hidpp20_get_index(const struct ratbag_device_data *data)
return data->hidpp20.index;
}
int
ratbag_device_data_hidpp20_get_quirk(const struct ratbag_device_data *data)
{
assert(data->drivertype == HIDPP20);
return data->hidpp20.quirk;
}
/* SteelSeries */
int

View File

@@ -80,9 +80,6 @@ ratbag_device_data_hidpp10_get_led_count(const struct ratbag_device_data *data);
int
ratbag_device_data_hidpp20_get_index(const struct ratbag_device_data *data);
int
ratbag_device_data_hidpp20_get_quirk(const struct ratbag_device_data *data);
/* SteelSeries */
/**