Skip to contentSkip to conversation

HID: sony: Fix up nyko core controller

PATCH Superseded Scott Moreau 2 participants 2 messages Dec 13, 2017 – Dec 19, 2017 HID

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 HID: sony: Fix up nyko core controller

This fixes missing d-pad axis broken since e19a267b99. The axis mapping for the nyko controller has the d-pad as axis 0x39 instead of d-pad as buttons. This is handled by the default hid mapping so we return 0 in sony_mapping. This controller also has no accelerometer so avoid initializing it with a condition in sony_input_configured() to setup these controllers.

---
 drivers/hid/hid-sony.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hid/hid-sony.c +7 -0
index b9dc3ac..1be0a35 100644
@@ -1225,6 +1225,9 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
 	if (sc->quirks & NAVIGATION_CONTROLLER)
 		return navigation_mapping(hdev, hi, field, usage, bit, max);
 
+	if (sc->quirks & SINO_LITE_CONTROLLER)
+		return 0;
+
 	if (sc->quirks & SIXAXIS_CONTROLLER)
 		return sixaxis_mapping(hdev, hi, field, usage, bit, max);
 
@@ -2566,6 +2569,10 @@ static int sony_input_configured(struct hid_device *hdev,
 		}
 
 		sony_init_output_report(sc, sixaxis_send_output_report);
+	} else if (sc->quirks & SINO_LITE_CONTROLLER) {
+		hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
+
+		sony_init_output_report(sc, sixaxis_send_output_report);
 	} else if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
 		/*
 		 * The Sony Sixaxis does not handle HID Output Reports on the
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#1 lore raw

(From personal email as work email, doesn't do plain text well..)

Quoted 41 lines · Scott Moreau

This fixes missing d-pad axis broken since e19a267b99. The axis mapping for the nyko controller has the d-pad as axis 0x39 instead of d-pad as buttons. This is handled by the default hid mapping so we return 0 in sony_mapping. This controller also has no accelerometer so avoid initializing it with a condition in sony_input_configured() to setup these controllers.

---
 drivers/hid/hid-sony.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hid/hid-sony.c +7 -1
index b9dc3ac..1be0a35 100644
@@ -1225,6 +1225,9 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi,
        if (sc->quirks & NAVIGATION_CONTROLLER)
                return navigation_mapping(hdev, hi, field, usage, bit, max);
 
+       if (sc->quirks & SINO_LITE_CONTROLLER)
+               return 0;
+
        if (sc->quirks & SIXAXIS_CONTROLLER)
                return sixaxis_mapping(hdev, hi, field, usage, bit, max);
 
@@ -2566,6 +2569,10 @@ static int sony_input_configured(struct hid_device *hdev,
                }
 
                sony_init_output_report(sc, sixaxis_send_output_report);
+       } else if (sc->quirks & SINO_LITE_CONTROLLER) {
+               hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
+
+               sony_init_output_report(sc, sixaxis_send_output_report);
        } else if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
                /*
                 * The Sony Sixaxis does not handle HID Output Reports on the
--

2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html