linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Florian Echtler <floe@butterbrot.org>
Cc: linux-input@vger.kernel.org, Martin Kaltenbrunner <modin@yuri.at>
Subject: Re: [PATCH 1/2] add additional reverse-engineered information
Date: Sun, 9 Jul 2017 14:40:06 -0700	[thread overview]
Message-ID: <20170709214006.GD21945@dtor-ws> (raw)
In-Reply-To: <1499626491-22592-1-git-send-email-floe@butterbrot.org>

On Sun, Jul 09, 2017 at 08:54:50PM +0200, Florian Echtler wrote:
> Due to recent reverse engineering efforts, a lot more information is now 
> available about the internals of the SUR40. We document this in the kernel
> driver for future use.
> 
> Signed-off-by: Martin Kaltenbrunner <modin@yuri.at>
> Signed-off-by: Florian Echtler <floe@butterbrot.org>
> ---
>  drivers/input/touchscreen/sur40.c | 25 +++++++++++++++++--------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
> index 128e5bd..12bdee9 100644
> --- a/drivers/input/touchscreen/sur40.c
> +++ b/drivers/input/touchscreen/sur40.c
> @@ -59,7 +59,7 @@ struct sur40_blob {
>  	__le16 blob_id;
>  
>  	u8 action;         /* 0x02 = enter/exit, 0x03 = update (?) */
> -	u8 unknown;        /* always 0x01 or 0x02 (no idea what this is?) */
> +	u8 type;           /* bitmask (0x01 blob,  0x02 touch, 0x04 tag) */
>  
>  	__le16 bb_pos_x;   /* upper left corner of bounding box */
>  	__le16 bb_pos_y;
> @@ -133,12 +133,19 @@ struct sur40_image_header {
>  
>  /* control commands */
>  #define SUR40_GET_VERSION 0xb0 /* 12 bytes string    */
> -#define SUR40_UNKNOWN1    0xb3 /*  5 bytes           */
> -#define SUR40_UNKNOWN2    0xc1 /* 24 bytes           */
> +#define SUR40_ACCEL_CAPS  0xb3 /*  5 bytes           */
> +#define SUR40_SENSOR_CAPS 0xc1 /* 24 bytes           */
> +
> +#define SUR40_POKE        0xc5 /* poke register byte */
> +#define SUR40_PEEK        0xc4 /* 48 bytes registers */
>  
>  #define SUR40_GET_STATE   0xc5 /*  4 bytes state (?) */
>  #define SUR40_GET_SENSORS 0xb1 /*  8 bytes sensors   */
>  
> +#define SUR40_BLOB   0x01
> +#define SUR40_TOUCH	0x02
> +#define SUR40_TAG    0x04
> +
>  static const struct v4l2_pix_format sur40_pix_format[] = {
>  	{
>  		.pixelformat = V4L2_TCH_FMT_TU08,
> @@ -238,11 +245,11 @@ static int sur40_init(struct sur40_state *dev)
>  	if (result < 0)
>  		goto error;
>  
> -	result = sur40_command(dev, SUR40_UNKNOWN2,    0x00, buffer, 24);
> +	result = sur40_command(dev, SUR40_SENSOR_CAPS, 0x00, buffer, 24);
>  	if (result < 0)
>  		goto error;
>  
> -	result = sur40_command(dev, SUR40_UNKNOWN1,    0x00, buffer,  5);
> +	result = sur40_command(dev, SUR40_ACCEL_CAPS, 0x00, buffer, 5);
>  	if (result < 0)
>  		goto error;
>  
> @@ -367,10 +374,13 @@ static void sur40_poll(struct input_polled_dev *polldev)
>  		/*
>  		 * Sanity check. when video data is also being retrieved, the
>  		 * packet ID will usually increase in the middle of a series
> -		 * instead of at the end.
> -		 */
> -		if (packet_id != le32_to_cpu(header->packet_id))
> +		 * instead of at the end. however, the data is still consistent,
> +		 * so the packet ID is probably just valid for the first packet
> +		 * in a series.
> +
> +		if (packet_id != header->packet_id)
>  			dev_dbg(sur40->dev, "packet ID mismatch\n");
> +		 */
>  
>  		packet_blobs = result / sizeof(struct sur40_blob);
>  		dev_dbg(sur40->dev, "received %d blobs\n", packet_blobs);

This chunk does not match the patch description. Please split out.

-- 
Dmitry

      parent reply	other threads:[~2017-07-09 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 18:54 [PATCH 1/2] add additional reverse-engineered information Florian Echtler
2017-07-09 18:54 ` [PATCH 2/2] skip all blobs that are not touches Florian Echtler
2017-07-09 21:41   ` Dmitry Torokhov
2017-07-10  7:11     ` Florian Echtler
2017-07-10 18:11       ` Dmitry Torokhov
2017-07-14  7:54         ` Florian Echtler
2017-07-14  8:24           ` Peter Hutterer
2017-07-14  9:28             ` Florian Echtler
2017-07-14 22:13               ` Peter Hutterer
2017-07-09 21:40 ` Dmitry Torokhov [this message]

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=20170709214006.GD21945@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=floe@butterbrot.org \
    --cc=linux-input@vger.kernel.org \
    --cc=modin@yuri.at \
    /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;
as well as URLs for NNTP newsgroup(s).