All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gerecke <killertofu@gmail.com>
To: Ping Cheng <pinglinux@gmail.com>, jkosina@suse.cz
Cc: linux-input@vger.kernel.org, Ping Cheng <pingc@wacom.com>
Subject: Re: [PATCH 2/4] HID: wacom: move all quirks to wacom_setup_device_quirks
Date: Thu, 16 Apr 2015 16:52:56 -0700	[thread overview]
Message-ID: <55304B58.2030800@gmail.com> (raw)
In-Reply-To: <1429142034-16832-1-git-send-email-pingc@wacom.com>

On 4/15/2015 4:53 PM, Ping Cheng wrote:
> It makes probe routine easy to follow.
> 
> Signed-off-by: Ping Cheng <pingc@wacom.com>

For patches 2-4, Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....

> ---
>  drivers/hid/wacom.h     |  2 +-
>  drivers/hid/wacom_sys.c | 39 +--------------------------------------
>  drivers/hid/wacom_wac.c | 30 +++++++++++++++++++++++++++++-
>  3 files changed, 31 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h
> index ad7318d..0f189c2 100644
> --- a/drivers/hid/wacom.h
> +++ b/drivers/hid/wacom.h
> @@ -132,7 +132,7 @@ static inline void wacom_schedule_work(struct wacom_wac *wacom_wac)
>  extern const struct hid_device_id wacom_ids[];
>  
>  void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len);
> -void wacom_setup_device_quirks(struct wacom_features *features);
> +void wacom_setup_device_quirks(struct wacom *wacom);
>  int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
>  				   struct wacom_wac *wacom_wac);
>  int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index 4c5d924..ca30eab 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -1504,44 +1504,7 @@ static int wacom_probe(struct hid_device *hdev,
>  	/* Retrieve the physical and logical size for touch devices */
>  	wacom_retrieve_hid_descriptor(hdev, features);
>  
> -	/*
> -	 * Intuos5 has no useful data about its touch interface in its
> -	 * HID descriptor. If this is the touch interface (PacketSize
> -	 * of WACOM_PKGLEN_BBTOUCH3), override the table values.
> -	 */
> -	if (features->type >= INTUOS5S && features->type <= INTUOSHT) {
> -		if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
> -			features->device_type = BTN_TOOL_FINGER;
> -
> -			features->x_max = 4096;
> -			features->y_max = 4096;
> -		} else {
> -			features->device_type = BTN_TOOL_PEN;
> -		}
> -	}
> -
> -	/*
> -	 * Same thing for Bamboo 3rd gen.
> -	 */
> -	if ((features->type == BAMBOO_PT) &&
> -	    (features->pktlen == WACOM_PKGLEN_BBTOUCH3) &&
> -	    (features->device_type == BTN_TOOL_PEN)) {
> -		features->device_type = BTN_TOOL_FINGER;
> -
> -		features->x_max = 4096;
> -		features->y_max = 4096;
> -	}
> -
> -	/*
> -	 * Same thing for Bamboo PAD
> -	 */
> -	if (features->type == BAMBOO_PAD)
> -		features->device_type = BTN_TOOL_FINGER;
> -
> -	if (hdev->bus == BUS_BLUETOOTH)
> -		features->quirks |= WACOM_QUIRK_BATTERY;
> -
> -	wacom_setup_device_quirks(features);
> +	wacom_setup_device_quirks(wacom);
>  
>  	/* set unit to "100th of a mm" for devices not reported by HID */
>  	if (!features->unit) {
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 69c7df7..952ed4c 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -2164,8 +2164,9 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
>  	input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
>  }
>  
> -void wacom_setup_device_quirks(struct wacom_features *features)
> +void wacom_setup_device_quirks(struct wacom *wacom)
>  {
> +	struct wacom_features *features = &wacom->wacom_wac.features;
>  
>  	/* touch device found but size is not defined. use default */
>  	if (features->device_type == BTN_TOOL_FINGER && !features->x_max) {
> @@ -2173,6 +2174,33 @@ void wacom_setup_device_quirks(struct wacom_features *features)
>  		features->y_max = 1023;
>  	}
>  
> +	/*
> +	 * Intuos5/Pro and Bamboo 3rd gen have no useful data about its
> +	 * touch interface in its HID descriptor. If this is the touch
> +	 * interface (PacketSize of WACOM_PKGLEN_BBTOUCH3), override the
> +	 * tablet values.
> +	 */
> +	if ((features->type >= INTUOS5S && features->type <= INTUOSHT) ||
> +		(features->type == BAMBOO_PT)) {
> +		if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
> +			features->device_type = BTN_TOOL_FINGER;
> +
> +			features->x_max = 4096;
> +			features->y_max = 4096;
> +		} else {
> +			features->device_type = BTN_TOOL_PEN;
> +		}
> +	}
> +
> +	/*
> +	 * Same thing for Bamboo PAD
> +	 */
> +	if (features->type == BAMBOO_PAD)
> +		features->device_type = BTN_TOOL_FINGER;
> +
> +	if (wacom->hdev->bus == BUS_BLUETOOTH)
> +		features->quirks |= WACOM_QUIRK_BATTERY;
> +
>  	/* quirk for bamboo touch with 2 low res touches */
>  	if (features->type == BAMBOO_PT &&
>  	    features->pktlen == WACOM_PKGLEN_BBTOUCH) {
> 
--
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

  reply	other threads:[~2015-04-16 23:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 23:53 [PATCH 2/4] HID: wacom: move all quirks to wacom_setup_device_quirks Ping Cheng
2015-04-16 23:52 ` Jason Gerecke [this message]
2015-04-23  8:04   ` 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=55304B58.2030800@gmail.com \
    --to=killertofu@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=pingc@wacom.com \
    --cc=pinglinux@gmail.com \
    /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.