aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-10-27 00:46:20 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-10-27 00:46:20 -0400
commit6ad390a25a9d1d8606b9b826878f0a30639dc2b3 (patch)
tree05aff14f02776bc0d59a1f777cb92df6f4456ba9 /drivers/input/tablet/wacom_wac.c
parentd6069dae4700cf5290a75002c46b9be8ea7eef3c (diff)
parent3f48e7354358519e5b93f7f755ec270b3f8eafa0 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 9dea71849f4..da0d8761e77 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -874,7 +874,15 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
874 x = le16_to_cpup((__le16 *)&data[2]); 874 x = le16_to_cpup((__le16 *)&data[2]);
875 y = le16_to_cpup((__le16 *)&data[4]); 875 y = le16_to_cpup((__le16 *)&data[4]);
876 p = le16_to_cpup((__le16 *)&data[6]); 876 p = le16_to_cpup((__le16 *)&data[6]);
877 d = data[8]; 877 /*
878 * Convert distance from out prox to distance from tablet.
879 * distance will be greater than distance_max once
880 * touching and applying pressure; do not report negative
881 * distance.
882 */
883 if (data[8] <= wacom->features.distance_max)
884 d = wacom->features.distance_max - data[8];
885
878 pen = data[1] & 0x01; 886 pen = data[1] & 0x01;
879 btn1 = data[1] & 0x02; 887 btn1 = data[1] & 0x02;
880 btn2 = data[1] & 0x04; 888 btn2 = data[1] & 0x04;
@@ -1030,8 +1038,6 @@ void wacom_setup_device_quirks(struct wacom_features *features)
1030 features->y_max <<= 5; 1038 features->y_max <<= 5;
1031 features->x_fuzz <<= 5; 1039 features->x_fuzz <<= 5;
1032 features->y_fuzz <<= 5; 1040 features->y_fuzz <<= 5;
1033 features->pressure_max = 256;
1034 features->pressure_fuzz = 16;
1035 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; 1041 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
1036 } 1042 }
1037} 1043}
@@ -1241,14 +1247,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1241 input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 1247 input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
1242 0, features->y_max, 1248 0, features->y_max,
1243 features->y_fuzz, 0); 1249 features->y_fuzz, 0);
1244 input_set_abs_params(input_dev, ABS_MT_PRESSURE,
1245 0, features->pressure_max,
1246 features->pressure_fuzz, 0);
1247 } else if (features->device_type == BTN_TOOL_PEN) { 1250 } else if (features->device_type == BTN_TOOL_PEN) {
1248 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1251 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1249 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1252 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1250 __set_bit(BTN_STYLUS, input_dev->keybit); 1253 __set_bit(BTN_STYLUS, input_dev->keybit);
1251 __set_bit(BTN_STYLUS2, input_dev->keybit); 1254 __set_bit(BTN_STYLUS2, input_dev->keybit);
1255 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
1256 features->distance_max,
1257 0, 0);
1252 } 1258 }
1253 break; 1259 break;
1254 } 1260 }
@@ -1469,37 +1475,37 @@ static const struct wacom_features wacom_features_0x47 =
1469 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1475 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1470static const struct wacom_features wacom_features_0xD0 = 1476static const struct wacom_features wacom_features_0xD0 =
1471 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1477 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1472 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1478 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1473static const struct wacom_features wacom_features_0xD1 = 1479static const struct wacom_features wacom_features_0xD1 =
1474 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1480 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1475 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1481 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1476static const struct wacom_features wacom_features_0xD2 = 1482static const struct wacom_features wacom_features_0xD2 =
1477 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1483 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1478 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1484 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1479static const struct wacom_features wacom_features_0xD3 = 1485static const struct wacom_features wacom_features_0xD3 =
1480 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 1486 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1481 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1487 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1482static const struct wacom_features wacom_features_0xD4 = 1488static const struct wacom_features wacom_features_0xD4 =
1483 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1489 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1484 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1490 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1485static const struct wacom_features wacom_features_0xD5 = 1491static const struct wacom_features wacom_features_0xD5 =
1486 { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 1492 { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1487 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1493 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1488static const struct wacom_features wacom_features_0xD6 = 1494static const struct wacom_features wacom_features_0xD6 =
1489 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1495 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1490 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1496 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1491static const struct wacom_features wacom_features_0xD7 = 1497static const struct wacom_features wacom_features_0xD7 =
1492 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1498 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1493 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1499 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1494static const struct wacom_features wacom_features_0xD8 = 1500static const struct wacom_features wacom_features_0xD8 =
1495 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 1501 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1496 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1502 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1497static const struct wacom_features wacom_features_0xDA = 1503static const struct wacom_features wacom_features_0xDA =
1498 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1504 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1499 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1505 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1500static struct wacom_features wacom_features_0xDB = 1506static struct wacom_features wacom_features_0xDB =
1501 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 1507 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1502 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1508 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1503static const struct wacom_features wacom_features_0x6004 = 1509static const struct wacom_features wacom_features_0x6004 =
1504 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 1510 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
1505 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1511 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };