All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To: Simon Wood <simon@mungewell.org>
Cc: linux-input <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Jiri Kosina" <jkosina@suse.cz>, Edwin <Edwin@velds.nl>,
	"Michal Malý" <madcatxster@devoid-pointer.net>,
	"elias vanderstuyft" <elias.vds@gmail.com>,
	"Benjamin Tissoires" <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH 6/6] HID: hid-logitech-hidpp: G920 remove deadzones
Date: Mon, 9 Nov 2015 09:24:30 +0100	[thread overview]
Message-ID: <CAN+gG=HhE1JOqocKXt9hoOk1=Qs3ipJXarkPLi47T+B89QFnXA@mail.gmail.com> (raw)
In-Reply-To: <1446912609-2573-7-git-send-email-simon@mungewell.org>

On Sat, Nov 7, 2015 at 5:10 PM, Simon Wood <simon@mungewell.org> wrote:
> Ensure that the G920 is not given the default deadzones.
>
> Signed-off-by: Simon Wood <simon@mungewell.org>
> ---
>  drivers/hid/hid-logitech-hidpp.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index 03e01be..853b9c2 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -1441,6 +1441,27 @@ static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>         return 0;
>  }
>
> +static int hidpp_input_mapped(struct hid_device *hdev, struct hid_input *hi,
> +               struct hid_field *field, struct hid_usage *usage,
> +               unsigned long **bit, int *max)
> +{
> +       /* Ensure that Logitech G920 is not given a default fuzz/flat value */
> +       if (usage->type == EV_ABS && (usage->code == ABS_X ||
> +                       usage->code == ABS_Y || usage->code == ABS_Z ||
> +                       usage->code == ABS_RZ)) {
> +               switch (hdev->product) {
> +               case USB_DEVICE_ID_LOGITECH_G920_WHEEL:
> +                       field->application = HID_GD_MULTIAXIS;
> +                       break;
> +               default:
> +                       break;
> +               }
> +       }

I'd rather see this as:

if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) {
  if (usage->type == EV_ABS && (usage->code == ABS_X ....
    field->application = HID_GD_MULTIAXIS;
  }
}

Just to make sure we do not enter this code path for other devices.

With this change, and the nitpicks in the other patches, the series is:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

> +
> +       return 0;
> +}
> +
> +
>  static void hidpp_populate_input(struct hidpp_device *hidpp,
>                 struct input_dev *input, bool origin_is_hid_core)
>  {
> @@ -1873,6 +1894,7 @@ static struct hid_driver hidpp_driver = {
>         .raw_event = hidpp_raw_event,
>         .input_configured = hidpp_input_configured,
>         .input_mapping = hidpp_input_mapping,
> +       .input_mapped = hidpp_input_mapped,
>  };
>
>  module_hid_driver(hidpp_driver);
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-11-09  8:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 16:10 HID: Support for the Logitech G920 wheel Simon Wood
2015-11-07 16:10 ` [PATCH 1/6] INPUT: xpad: Add minimal support for Logitech G920 Wheel Simon Wood
2015-11-07 16:10 ` [PATCH 2/6] HID: hid-logitech-hidpp: Add support for very long packets Simon Wood
2015-11-07 16:10 ` [PATCH 3/6] HID: hid-logitech-hidpp: Add basic support for Logitech G920 Simon Wood
2015-11-09  8:11   ` Benjamin Tissoires
2015-11-07 16:10 ` [PATCH 4/6] HID: hid-logitech-hidpp: Add range sysfs " Simon Wood
2015-11-07 16:10 ` [PATCH 5/6] HID: Add vendor specific usage pages " Simon Wood
2015-11-09  8:20   ` Benjamin Tissoires
2015-11-10 21:38     ` Elias Vanderstuyft
2015-11-07 16:10 ` [PATCH 6/6] HID: hid-logitech-hidpp: G920 remove deadzones Simon Wood
2015-11-09  8:24   ` Benjamin Tissoires [this message]
2015-11-10 20:03     ` Simon Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN+gG=HhE1JOqocKXt9hoOk1=Qs3ipJXarkPLi47T+B89QFnXA@mail.gmail.com' \
    --to=benjamin.tissoires@gmail.com \
    --cc=Edwin@velds.nl \
    --cc=benjamin.tissoires@redhat.com \
    --cc=elias.vds@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madcatxster@devoid-pointer.net \
    --cc=simon@mungewell.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.