mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Andrew Duggan <aduggan@synaptics.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCH] HID: rmi: fix masks for x and w_x data
Date: Thu, 15 May 2014 21:11:23 +0000	[thread overview]
Message-ID: <20140515211123.GA10497@mail.corp.redhat.com> (raw)
In-Reply-To: <1400187149-7619-1-git-send-email-aduggan@synaptics.com>

On May 15 2014 or thereabouts, Andrew Duggan wrote:
> The F11 data in the HID report contains four bits of data for w_x and the least significant bits
> of x. Currently only the first three bits are being used which is resulting in small jumps in
> the position data on the x axis and in the w_x data.
> 
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
> ---

Good catch. I might have considered that 3:0 means 3 bits, not 4. I must
have been tired while writing it :)

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>  drivers/hid/hid-rmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
> index 7ebdc96..c529b03 100644
> --- a/drivers/hid/hid-rmi.c
> +++ b/drivers/hid/hid-rmi.c
> @@ -277,9 +277,9 @@ static void rmi_f11_process_touch(struct rmi_data *hdata, int slot,
>  	input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER,
>  			finger_state == 0x01);
>  	if (finger_state == 0x01) {
> -		x = (touch_data[0] << 4) | (touch_data[2] & 0x07);
> +		x = (touch_data[0] << 4) | (touch_data[2] & 0x0F);
>  		y = (touch_data[1] << 4) | (touch_data[2] >> 4);
> -		wx = touch_data[3] & 0x07;
> +		wx = touch_data[3] & 0x0F;
>  		wy = touch_data[3] >> 4;
>  		wide = (wx > wy);
>  		major = max(wx, wy);
> -- 
> 1.9.1
> 

  reply	other threads:[~2014-05-15 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 20:52 Andrew Duggan
2014-05-15 21:11 ` Benjamin Tissoires [this message]
2014-05-16  9:14   ` Jiri Kosina

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=20140515211123.GA10497@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=aduggan@synaptics.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome