linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: sony: Fix up nyko core controller
@ 2017-12-11  2:51 Scott Moreau
  2017-12-13  0:24 ` Roderick Colenbrander
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Moreau @ 2017-12-11  2:51 UTC (permalink / raw)
  To: linux-input; +Cc: 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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b9dc3ac..e703024 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -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,12 @@ 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_NO_OUTPUT_REPORTS_ON_INTR_EP;
+		hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
+		sc->defer_initialization = 1;
+
+		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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: sony: Fix up nyko core controller
  2017-12-11  2:51 Scott Moreau
@ 2017-12-13  0:24 ` Roderick Colenbrander
  0 siblings, 0 replies; 4+ messages in thread
From: Roderick Colenbrander @ 2017-12-13  0:24 UTC (permalink / raw)
  To: Scott Moreau; +Cc: linux-input

Hi Scott,

Thanks for your patch. A few additional questions from personal mail
(work mail doesn't do plain text well). In general the patch looks
fine, just curious to what extension you need some of the no output /
skip output quirks. Some are needed apparently for ds3 due to bugs in
our devices. Not sure if the Nyko controller is affected. If not then
there is no need for some of these workarounds. Just something to
sanity check.

Thanks,
Roderick

On Sun, Dec 10, 2017 at 6:51 PM, Scott Moreau <oreaus@gmail.com> wrote:
> 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 | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index b9dc3ac..e703024 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -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,12 @@ 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_NO_OUTPUT_REPORTS_ON_INTR_EP;
> +               hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID;
> +               sc->defer_initialization = 1;
> +
> +               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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] HID: sony: Fix up nyko core controller
@ 2017-12-13  0:54 Scott Moreau
  2017-12-13  2:02 ` Roderick Colenbrander
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Moreau @ 2017-12-13  0:54 UTC (permalink / raw)
  To: linux-input; +Cc: 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(+)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b9dc3ac..1be0a35 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: sony: Fix up nyko core controller
  2017-12-13  0:54 [PATCH] HID: sony: Fix up nyko core controller Scott Moreau
@ 2017-12-13  2:02 ` Roderick Colenbrander
  0 siblings, 0 replies; 4+ messages in thread
From: Roderick Colenbrander @ 2017-12-13  2:02 UTC (permalink / raw)
  To: Scott Moreau; +Cc: linux-input

Alright looks good then.

Acked-by: Roderick Colenbrander <roderick.colenbrander@sony.com>

On Tue, Dec 12, 2017 at 4:54 PM, Scott Moreau <oreaus@gmail.com> wrote:
> 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(+)
>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index b9dc3ac..1be0a35 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-13  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-13  0:54 [PATCH] HID: sony: Fix up nyko core controller Scott Moreau
2017-12-13  2:02 ` Roderick Colenbrander
  -- strict thread matches above, loose matches on Subject: below --
2017-12-11  2:51 Scott Moreau
2017-12-13  0:24 ` Roderick Colenbrander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).