Skip to contentSkip to conversation

input: wacom - Pass touch resolution to clients through input_absinfo

PATCH Superseded Ping Cheng 2 participants 3 messages Jan 24, 2011 – Jan 25, 2011

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH v2 1/1 input: wacom - Pass touch resolution to clients through input_absinfo

Fixed the workaround used for kernels older than 2.6.35.

---
 drivers/input/tablet/wacom_wac.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/input/tablet/wacom_wac.c +10 -2
index f44c822..12d5ccf 100644
@@ -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);
Signature · 1 line
1.7.3.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Ping Cheng

Fixed the workaround used for kernels older than 2.6.35.

---
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,

Thanks,
Henrik

Quoted 31 lines
drivers/input/tablet/wacom_wac.c +10 -2
index f44c822..12d5ccf 100644
@@ -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);
author
#2 lore raw
Quoted 11 lines · Henrik Rydberg
Quoted 7 lines · Ping Cheng

Fixed the workaround used for kernels older than 2.6.35.

---
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.

Quoted 1 line

Thank you.

Ping

Quoted 23 lines

Thanks,
Henrik

Quoted 19 lines
drivers/input/tablet/wacom_wac.c +0 -0
index f44c822..12d5ccf 100644
@@ -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);
              }

Quoted 13 lines

drivers/input/tablet/wacom_wac.c void wacom_setup_input_capabilities(struct input_dev *input_dev, · line 1285

Quoted 12 lines
drivers/input/tablet/wacom_wac.c +5 -0
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html