All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] input: wacom - Pass touch resolution to clients through input_absinfo
@ 2011-01-24 23:06 Ping Cheng
  2011-01-25 10:02 ` [v2] " Henrik Rydberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ping Cheng @ 2011-01-24 23:06 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, Ping Cheng, Ping Cheng

Fixed the workaround used for kernels older than 2.6.35.

Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_wac.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index f44c822..12d5ccf 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1228,8 +1228,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 	case TABLETPC:
 		if (features->device_type == BTN_TOOL_DOUBLETAP ||
 		    features->device_type == BTN_TOOL_TRIPLETAP) {
-			input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
-			input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
+			/* set touch resolution in points/mm */
+			input_abs_set_res(input_dev, ABS_X,
+				100 * features->x_max / features->x_phy);
+			input_abs_set_res(input_dev, ABS_Y,
+				100 * features->y_max / features->y_phy);
 			__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
 		}
 
@@ -1272,6 +1275,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 			input_set_abs_params(input_dev, ABS_MT_PRESSURE,
 					     0, features->pressure_max,
 					     features->pressure_fuzz, 0);
+			/* set touch resolution in points/mm */
+			input_abs_set_res(input_dev, ABS_X,
+				100 * features->x_max / features->x_phy);
+			input_abs_set_res(input_dev, ABS_Y,
+				100 * features->y_max / features->y_phy);
 		} else if (features->device_type == BTN_TOOL_PEN) {
 			__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
 			__set_bit(BTN_TOOL_PEN, input_dev->keybit);
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v2] input: wacom - Pass touch resolution to clients through input_absinfo
  2011-01-24 23:06 [PATCH v2] input: wacom - Pass touch resolution to clients through input_absinfo Ping Cheng
@ 2011-01-25 10:02 ` Henrik Rydberg
  2011-01-25 17:59   ` Ping Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Henrik Rydberg @ 2011-01-25 10:02 UTC (permalink / raw)
  To: Ping Cheng; +Cc: linux-input, dmitry.torokhov, Ping Cheng

On Mon, Jan 24, 2011 at 11:06:13PM -0000, Ping Cheng wrote:
> Fixed the workaround used for kernels older than 2.6.35.
> 
> Signed-off-by: Ping Cheng <pingc@wacom.com>
> 
> ---
> drivers/input/tablet/wacom_wac.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)

A define or a function would have been nicer than "100", but since
this wasn't obvious from the comments,

Reviewed-by: Henrik Rydberg <rydberg@euromail.se>

Thanks,
Henrik

> 
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index f44c822..12d5ccf 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -1228,8 +1228,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>  	case TABLETPC:
>  		if (features->device_type == BTN_TOOL_DOUBLETAP ||
>  		    features->device_type == BTN_TOOL_TRIPLETAP) {
> -			input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
> -			input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
> +			/* set touch resolution in points/mm */
> +			input_abs_set_res(input_dev, ABS_X,
> +				100 * features->x_max / features->x_phy);
> +			input_abs_set_res(input_dev, ABS_Y,
> +				100 * features->y_max / features->y_phy);
>  			__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
>  		}
>  
> @@ -1272,6 +1275,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>  			input_set_abs_params(input_dev, ABS_MT_PRESSURE,
>  					     0, features->pressure_max,
>  					     features->pressure_fuzz, 0);
> +			/* set touch resolution in points/mm */
> +			input_abs_set_res(input_dev, ABS_X,
> +				100 * features->x_max / features->x_phy);
> +			input_abs_set_res(input_dev, ABS_Y,
> +				100 * features->y_max / features->y_phy);
>  		} else if (features->device_type == BTN_TOOL_PEN) {
>  			__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
>  			__set_bit(BTN_TOOL_PEN, input_dev->keybit);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v2] input: wacom - Pass touch resolution to clients through input_absinfo
  2011-01-25 10:02 ` [v2] " Henrik Rydberg
@ 2011-01-25 17:59   ` Ping Cheng
  0 siblings, 0 replies; 3+ messages in thread
From: Ping Cheng @ 2011-01-25 17:59 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: linux-input, dmitry.torokhov

On Tue, Jan 25, 2011 at 2:02 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> On Mon, Jan 24, 2011 at 11:06:13PM -0000, Ping Cheng wrote:
>> Fixed the workaround used for kernels older than 2.6.35.
>>
>> Signed-off-by: Ping Cheng <pingc@wacom.com>
>>
>> ---
>> drivers/input/tablet/wacom_wac.c |   12 ++++++++++--
>>  1 files changed, 10 insertions(+), 2 deletions(-)
>
> A define or a function would have been nicer than "100", but since
> this wasn't obvious from the comments,

I'll make a version 3 to add a function with comments since I need to
remove RX/RY from this patch anyway.

> Reviewed-by: Henrik Rydberg <rydberg@euromail.se>

Thank you.

Ping
>
> Thanks,
> Henrik
>
>>
>> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
>> index f44c822..12d5ccf 100644
>> --- a/drivers/input/tablet/wacom_wac.c
>> +++ b/drivers/input/tablet/wacom_wac.c
>> @@ -1228,8 +1228,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>>       case TABLETPC:
>>               if (features->device_type == BTN_TOOL_DOUBLETAP ||
>>                   features->device_type == BTN_TOOL_TRIPLETAP) {
>> -                     input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
>> -                     input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
>> +                     /* set touch resolution in points/mm */
>> +                     input_abs_set_res(input_dev, ABS_X,
>> +                             100 * features->x_max / features->x_phy);
>> +                     input_abs_set_res(input_dev, ABS_Y,
>> +                             100 * features->y_max / features->y_phy);
>>                       __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
>>               }
>>
>> @@ -1272,6 +1275,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
>>                       input_set_abs_params(input_dev, ABS_MT_PRESSURE,
>>                                            0, features->pressure_max,
>>                                            features->pressure_fuzz, 0);
>> +                     /* set touch resolution in points/mm */
>> +                     input_abs_set_res(input_dev, ABS_X,
>> +                             100 * features->x_max / features->x_phy);
>> +                     input_abs_set_res(input_dev, ABS_Y,
>> +                             100 * features->y_max / features->y_phy);
>>               } else if (features->device_type == BTN_TOOL_PEN) {
>>                       __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
>>                       __set_bit(BTN_TOOL_PEN, input_dev->keybit);
>
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-25 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 23:06 [PATCH v2] input: wacom - Pass touch resolution to clients through input_absinfo Ping Cheng
2011-01-25 10:02 ` [v2] " Henrik Rydberg
2011-01-25 17:59   ` Ping Cheng

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.