fix for multitouch and allow auto detection of touchscreen in udev
This commit is contained in:
parent
ef2304c06e
commit
b3c8ba44cc
|
@ -131,6 +131,7 @@ struct mt_device {
|
||||||
|
|
||||||
static void mt_post_parse_default_settings(struct mt_device *td);
|
static void mt_post_parse_default_settings(struct mt_device *td);
|
||||||
static void mt_post_parse(struct mt_device *td);
|
static void mt_post_parse(struct mt_device *td);
|
||||||
|
static int contact_count_seen;
|
||||||
|
|
||||||
/* classes of device behavior */
|
/* classes of device behavior */
|
||||||
#define MT_CLS_DEFAULT 0x0001
|
#define MT_CLS_DEFAULT 0x0001
|
||||||
|
@ -559,9 +560,10 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||||
usage->usage_index >= field->report_count)
|
usage->usage_index >= field->report_count)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (td->cc_index < 0) {
|
if (contact_count_seen != 1) {
|
||||||
td->cc_index = field->index;
|
td->cc_index = field->index;
|
||||||
td->cc_value_index = usage->usage_index;
|
td->cc_value_index = usage->usage_index;
|
||||||
|
contact_count_seen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1047,10 +1049,6 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
|
||||||
suffix = "Pen";
|
suffix = "Pen";
|
||||||
/* force BTN_STYLUS to allow tablet matching in udev */
|
/* force BTN_STYLUS to allow tablet matching in udev */
|
||||||
__set_bit(BTN_STYLUS, hi->input->keybit);
|
__set_bit(BTN_STYLUS, hi->input->keybit);
|
||||||
} else if (hi->report->field[0]->logical == HID_DG_TOUCHSCREEN) {
|
|
||||||
suffix = "SingleTouch";
|
|
||||||
/* force BTN_STYLUS to allow tablet matching in udev */
|
|
||||||
__set_bit(BTN_STYLUS, hi->input->keybit);
|
|
||||||
} else {
|
} else {
|
||||||
switch (field->application) {
|
switch (field->application) {
|
||||||
case HID_GD_KEYBOARD:
|
case HID_GD_KEYBOARD:
|
||||||
|
|
Loading…
Reference in a new issue