in wacom_wac.c [3457:3608]
void wacom_setup_device_quirks(struct wacom *wacom)
{
struct wacom_wac *wacom_wac = &wacom->wacom_wac;
struct wacom_features *features = &wacom->wacom_wac.features;
/* The pen and pad share the same interface on most devices */
if (features->type == GRAPHIRE_BT || features->type == WACOM_G4 ||
features->type == DTUS ||
(features->type >= INTUOS3S && features->type <= WACOM_MO)) {
if (features->device_type & WACOM_DEVICETYPE_PEN)
features->device_type |= WACOM_DEVICETYPE_PAD;
}
/* touch device found but size is not defined. use default */
if (features->device_type & WACOM_DEVICETYPE_TOUCH && !features->x_max) {
features->x_max = 1023;
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 <= INTUOSPL) ||
(features->type >= INTUOSHT && features->type <= BAMBOO_PT)) {
if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
if (features->touch_max)
features->device_type |= WACOM_DEVICETYPE_TOUCH;
if (features->type >= INTUOSHT && features->type <= BAMBOO_PT)
features->device_type |= WACOM_DEVICETYPE_PAD;
if (features->type == INTUOSHT2) {
features->x_max = features->x_max / 10;
features->y_max = features->y_max / 10;
}
else {
features->x_max = 4096;
features->y_max = 4096;
}
}
else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
features->device_type |= WACOM_DEVICETYPE_PAD;
}
}
/*
* Hack for the Bamboo One:
* the device presents a PAD/Touch interface as most Bamboos and even
* sends ghosts PAD data on it. However, later, we must disable this
* ghost interface, and we can not detect it unless we set it here
* to WACOM_DEVICETYPE_PAD or WACOM_DEVICETYPE_TOUCH.
*/
if (features->type == BAMBOO_PEN &&
features->pktlen == WACOM_PKGLEN_BBTOUCH3)
features->device_type |= WACOM_DEVICETYPE_PAD;
/*
* Raw Wacom-mode pen and touch events both come from interface
* 0, whose HID descriptor has an application usage of 0xFF0D
* (i.e., WACOM_HID_WD_DIGITIZER). We route pen packets back
* out through the HID_GENERIC device created for interface 1,
* so rewrite this one to be of type WACOM_DEVICETYPE_TOUCH.
*/
if (features->type == BAMBOO_PAD)
features->device_type = WACOM_DEVICETYPE_TOUCH;
if (features->type == REMOTE)
features->device_type = WACOM_DEVICETYPE_PAD;
if (features->type == INTUOSP2_BT ||
features->type == INTUOSP2S_BT) {
features->device_type |= WACOM_DEVICETYPE_PEN |
WACOM_DEVICETYPE_PAD |
WACOM_DEVICETYPE_TOUCH;
features->quirks |= WACOM_QUIRK_BATTERY;
}
if (features->type == INTUOSHT3_BT) {
features->device_type |= WACOM_DEVICETYPE_PEN |
WACOM_DEVICETYPE_PAD;
features->quirks |= WACOM_QUIRK_BATTERY;
}
switch (features->type) {
case PL:
case DTU:
case DTUS:
case DTUSX:
case WACOM_21UX2:
case WACOM_22HD:
case DTK:
case WACOM_24HD:
case WACOM_27QHD:
case CINTIQ_HYBRID:
case CINTIQ_COMPANION_2:
case CINTIQ:
case WACOM_BEE:
case WACOM_13HD:
case WACOM_24HDT:
case WACOM_27QHDT:
case TABLETPC:
case TABLETPCE:
case TABLETPC2FG:
case MTSCREEN:
case MTTPC:
case MTTPC_B:
features->device_type |= WACOM_DEVICETYPE_DIRECT;
break;
}
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->type == BAMBOO_TOUCH) &&
features->pktlen == WACOM_PKGLEN_BBTOUCH) {
features->x_max <<= 5;
features->y_max <<= 5;
features->x_fuzz <<= 5;
features->y_fuzz <<= 5;
features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
}
if (features->type == WIRELESS) {
if (features->device_type == WACOM_DEVICETYPE_WL_MONITOR) {
features->quirks |= WACOM_QUIRK_BATTERY;
}
}
if (features->type == REMOTE)
features->device_type |= WACOM_DEVICETYPE_WL_MONITOR;
/* HID descriptor for DTK-2451 / DTH-2452 claims to report lots
* of things it shouldn't. Lets fix up the damage...
*/
if (wacom->hdev->product == 0x382 || wacom->hdev->product == 0x37d) {
features->quirks &= ~WACOM_QUIRK_TOOLSERIAL;
__clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit);
__clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit);
__clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit);
__clear_bit(ABS_Z, wacom_wac->pen_input->absbit);
__clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit);
__clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit);
__clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit);
__clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit);
__clear_bit(ABS_MISC, wacom_wac->pen_input->absbit);
__clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
__clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
}
}