Skip to content

Commit 0b1804e

Browse files
mungewellJiri Kosina
authored andcommitted
HID: hid-logitech-hidpp: G920 remove deadzones
Ensure that the G920 is not given the default deadzones. Signed-off-by: Simon Wood <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b466c1d commit 0b1804e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,25 @@ static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
14411441
return 0;
14421442
}
14431443

1444+
static int hidpp_input_mapped(struct hid_device *hdev, struct hid_input *hi,
1445+
struct hid_field *field, struct hid_usage *usage,
1446+
unsigned long **bit, int *max)
1447+
{
1448+
struct hidpp_device *hidpp = hid_get_drvdata(hdev);
1449+
1450+
/* Ensure that Logitech G920 is not given a default fuzz/flat value */
1451+
if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) {
1452+
if (usage->type == EV_ABS && (usage->code == ABS_X ||
1453+
usage->code == ABS_Y || usage->code == ABS_Z ||
1454+
usage->code == ABS_RZ)) {
1455+
field->application = HID_GD_MULTIAXIS;
1456+
}
1457+
}
1458+
1459+
return 0;
1460+
}
1461+
1462+
14441463
static void hidpp_populate_input(struct hidpp_device *hidpp,
14451464
struct input_dev *input, bool origin_is_hid_core)
14461465
{
@@ -1875,6 +1894,7 @@ static struct hid_driver hidpp_driver = {
18751894
.raw_event = hidpp_raw_event,
18761895
.input_configured = hidpp_input_configured,
18771896
.input_mapping = hidpp_input_mapping,
1897+
.input_mapped = hidpp_input_mapped,
18781898
};
18791899

18801900
module_hid_driver(hidpp_driver);

0 commit comments

Comments
 (0)