diff options
author | Ping Cheng <pinglinux@gmail.com> | 2014-11-18 16:29:16 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-11-20 11:28:43 -0500 |
commit | 30ebc1aea8ce02da5b3789eba775dd2d79837813 (patch) | |
tree | b325a178596ec590e89dcb3bc7745d49bbf928c3 | |
parent | 97edcad81324ede21e421b79eaeab26f0b1ad2fc (diff) |
HID: wacom - Bamboo pen-only tablet does not support PAD
Bamboo models do not support HID_DG_CONTACTMAX. Plus, Bamboo pen-only
has touch descriptor. This leads to some complications in the code.
This patch also fixes duplicated PAD interfeaces for Intuos Pen
models.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/wacom.h | 2 | ||||
-rw-r--r-- | drivers/hid/wacom_sys.c | 25 | ||||
-rw-r--r-- | drivers/hid/wacom_wac.c | 9 |
3 files changed, 23 insertions, 13 deletions
diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h index 0cc53440543a..7db432809e9e 100644 --- a/drivers/hid/wacom.h +++ b/drivers/hid/wacom.h | |||
@@ -140,7 +140,7 @@ extern const struct hid_device_id wacom_ids[]; | |||
140 | 140 | ||
141 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); | 141 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); |
142 | void wacom_setup_device_quirks(struct wacom_features *features); | 142 | void wacom_setup_device_quirks(struct wacom_features *features); |
143 | int wacom_setup_input_capabilities(struct input_dev *input_dev, | 143 | int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, |
144 | struct wacom_wac *wacom_wac); | 144 | struct wacom_wac *wacom_wac); |
145 | int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, | 145 | int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, |
146 | struct wacom_wac *wacom_wac); | 146 | struct wacom_wac *wacom_wac); |
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 8593047bb726..68b6cd66f9c3 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
@@ -192,9 +192,15 @@ static void wacom_usage_mapping(struct hid_device *hdev, | |||
192 | if (!pen && !finger) | 192 | if (!pen && !finger) |
193 | return; | 193 | return; |
194 | 194 | ||
195 | if (finger && !features->touch_max) | 195 | /* |
196 | /* touch device at least supports one touch point */ | 196 | * Bamboo models do not support HID_DG_CONTACTMAX. |
197 | features->touch_max = 1; | 197 | * And, Bamboo Pen only descriptor contains touch. |
198 | */ | ||
199 | if (features->type != BAMBOO_PT) { | ||
200 | /* ISDv4 touch devices at least supports one touch point */ | ||
201 | if (finger && !features->touch_max) | ||
202 | features->touch_max = 1; | ||
203 | } | ||
198 | 204 | ||
199 | switch (usage->hid) { | 205 | switch (usage->hid) { |
200 | case HID_GD_X: | 206 | case HID_GD_X: |
@@ -1151,13 +1157,12 @@ static int wacom_register_inputs(struct wacom *wacom) | |||
1151 | if (!input_dev || !pad_input_dev) | 1157 | if (!input_dev || !pad_input_dev) |
1152 | return -EINVAL; | 1158 | return -EINVAL; |
1153 | 1159 | ||
1154 | error = wacom_setup_input_capabilities(input_dev, wacom_wac); | 1160 | error = wacom_setup_pentouch_input_capabilities(input_dev, wacom_wac); |
1155 | if (error) | 1161 | if (!error) { |
1156 | return error; | 1162 | error = input_register_device(input_dev); |
1157 | 1163 | if (error) | |
1158 | error = input_register_device(input_dev); | 1164 | return error; |
1159 | if (error) | 1165 | } |
1160 | return error; | ||
1161 | 1166 | ||
1162 | error = wacom_setup_pad_input_capabilities(pad_input_dev, wacom_wac); | 1167 | error = wacom_setup_pad_input_capabilities(pad_input_dev, wacom_wac); |
1163 | if (error) { | 1168 | if (error) { |
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 51c7353e01a5..caf035f662b9 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
@@ -2032,7 +2032,7 @@ static void wacom_abs_set_axis(struct input_dev *input_dev, | |||
2032 | } | 2032 | } |
2033 | } | 2033 | } |
2034 | 2034 | ||
2035 | int wacom_setup_input_capabilities(struct input_dev *input_dev, | 2035 | int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, |
2036 | struct wacom_wac *wacom_wac) | 2036 | struct wacom_wac *wacom_wac) |
2037 | { | 2037 | { |
2038 | struct wacom_features *features = &wacom_wac->features; | 2038 | struct wacom_features *features = &wacom_wac->features; |
@@ -2246,6 +2246,9 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
2246 | __clear_bit(ABS_X, input_dev->absbit); | 2246 | __clear_bit(ABS_X, input_dev->absbit); |
2247 | __clear_bit(ABS_Y, input_dev->absbit); | 2247 | __clear_bit(ABS_Y, input_dev->absbit); |
2248 | __clear_bit(BTN_TOUCH, input_dev->keybit); | 2248 | __clear_bit(BTN_TOUCH, input_dev->keybit); |
2249 | |||
2250 | /* PAD is setup by wacom_setup_pad_input_capabilities later */ | ||
2251 | return 1; | ||
2249 | } | 2252 | } |
2250 | } else if (features->device_type == BTN_TOOL_PEN) { | 2253 | } else if (features->device_type == BTN_TOOL_PEN) { |
2251 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | 2254 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
@@ -2444,7 +2447,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, | |||
2444 | case INTUOSHT: | 2447 | case INTUOSHT: |
2445 | case BAMBOO_PT: | 2448 | case BAMBOO_PT: |
2446 | /* pad device is on the touch interface */ | 2449 | /* pad device is on the touch interface */ |
2447 | if (features->device_type != BTN_TOOL_FINGER) | 2450 | if ((features->device_type != BTN_TOOL_FINGER) || |
2451 | /* Bamboo Pen only tablet does not have pad */ | ||
2452 | ((features->type == BAMBOO_PT) && !features->touch_max)) | ||
2448 | return -ENODEV; | 2453 | return -ENODEV; |
2449 | 2454 | ||
2450 | __clear_bit(ABS_MISC, input_dev->absbit); | 2455 | __clear_bit(ABS_MISC, input_dev->absbit); |