linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrik Rydberg <rydberg@euromail.se>
To: Stephane Chatty <chatty@lii-enac.fr>
Cc: dmitry.torokhov@gmail.com, jkosina@suse.cz,
	linux-input@vger.kernel.org, chatty@enac.fr
Subject: Re: [PATCH 3/4] hid-multitouch: added support for Cypress TrueTouch panels
Date: Thu, 14 Oct 2010 14:06:25 +0200	[thread overview]
Message-ID: <4CB6F241.1040500@euromail.se> (raw)
In-Reply-To: <20101013223334.DFF199522F@smtp.lii-enac.fr>

On 10/14/2010 12:33 AM, Stephane Chatty wrote:

> Added support for Cypress TrueTouch panels, which detect up to 10 fingers
> 
> Signed-off-by: Stephane Chatty <chatty@enac.fr>
> 
> diff -rupN c/drivers/hid/hid-core.c d/drivers/hid/hid-core.c
> --- c/drivers/hid/hid-core.c	2010-10-14 01:29:28.009936912 +0200
> +++ d/drivers/hid/hid-core.c	2010-10-14 01:27:36.217937105 +0200
> @@ -1301,6 +1301,7 @@ static const struct hid_device_id hid_bl
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_TRUETOUCH) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
> diff -rupN c/drivers/hid/hid-ids.h d/drivers/hid/hid-ids.h
> --- c/drivers/hid/hid-ids.h	2010-10-14 01:29:37.273937194 +0200
> +++ d/drivers/hid/hid-ids.h	2010-10-14 01:27:06.485936905 +0200
> @@ -176,6 +176,7 @@
>  #define USB_DEVICE_ID_CYPRESS_BARCODE_1	0xde61
>  #define USB_DEVICE_ID_CYPRESS_BARCODE_2	0xde64
>  #define USB_DEVICE_ID_CYPRESS_BARCODE_3	0xbca1
> +#define USB_DEVICE_ID_CYPRESS_TRUETOUCH	0xc001
>  
>  #define USB_VENDOR_ID_DEALEXTREAME	0x10c5
>  #define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701	0x819a
> diff -rupN c/drivers/hid/hid-multitouch.c d/drivers/hid/hid-multitouch.c
> --- c/drivers/hid/hid-multitouch.c	2010-10-14 01:31:48.572936984 +0200
> +++ d/drivers/hid/hid-multitouch.c	2010-10-14 01:32:30.914936993 +0200
> @@ -57,6 +57,7 @@ struct mt_class {
>  /* classes of device behavior */
>  #define DUAL1 0
>  #define DUAL2 1
> +#define CYPRESS 2
>  
>  /* contact data that only some devices report */
>  #define PRESSURE 	(1 << 0)
> @@ -77,10 +78,19 @@ static int slot_from_contactnumber(struc
>  	return td->curcontact;
>  }
>  
> +static int cypress_compute_slot(struct mt_device *td)
> +{
> +	if (td->curcontactid != 0 || td->curcontact == 0)
> +		return td->curcontactid;
> +	else 
> +		return -1;
> +}


Returned slots should always be valid, since the intent is to actually report
data for the contact. If there is additional logic determining whether a touch
is valid, like here, it can simply be added to the validity computation.

> +
>  
>  struct mt_class mt_classes[] = {
>  	/* DUAL1 */		{ slot_from_contactid, 2, -1 },
>  	/* DUAL2 */		{ slot_from_contactnumber, 2, -1 },
> +	/* CYPRESS */		{ cypress_compute_slot, 10, 3 },
>  };
>  
>  
> @@ -379,6 +389,11 @@ static const struct hid_device_id mt_dev
>  		HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
>  			USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
>  
> +	/* Cypress panel */
> +	{ .driver_data = CYPRESS,
> +		HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS,
> +			USB_DEVICE_ID_CYPRESS_TRUETOUCH) },
> +
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(hid, mt_devices);


Cheers,
Henrik

  reply	other threads:[~2010-10-14 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 22:33 [PATCH 3/4] hid-multitouch: added support for Cypress TrueTouch panels Stephane Chatty
2010-10-14 12:06 ` Henrik Rydberg [this message]
2010-10-14 12:33   ` Stéphane Chatty
2010-10-14 12:54     ` Henrik Rydberg
2010-10-14 15:16       ` Stéphane Chatty

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=4CB6F241.1040500@euromail.se \
    --to=rydberg@euromail.se \
    --cc=chatty@enac.fr \
    --cc=chatty@lii-enac.fr \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@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;
as well as URLs for NNTP newsgroup(s).