diff options
| -rw-r--r-- | drivers/hid/hid-wacom.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 12dcda529201..b8778db720bc 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
| @@ -156,7 +156,9 @@ static int wacom_probe(struct hid_device *hdev, | |||
| 156 | struct hid_input *hidinput; | 156 | struct hid_input *hidinput; |
| 157 | struct input_dev *input; | 157 | struct input_dev *input; |
| 158 | struct wacom_data *wdata; | 158 | struct wacom_data *wdata; |
| 159 | char rep_data[2]; | ||
| 159 | int ret; | 160 | int ret; |
| 161 | int limit; | ||
| 160 | 162 | ||
| 161 | wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); | 163 | wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); |
| 162 | if (wdata == NULL) { | 164 | if (wdata == NULL) { |
| @@ -166,6 +168,7 @@ static int wacom_probe(struct hid_device *hdev, | |||
| 166 | 168 | ||
| 167 | hid_set_drvdata(hdev, wdata); | 169 | hid_set_drvdata(hdev, wdata); |
| 168 | 170 | ||
| 171 | /* Parse the HID report now */ | ||
| 169 | ret = hid_parse(hdev); | 172 | ret = hid_parse(hdev); |
| 170 | if (ret) { | 173 | if (ret) { |
| 171 | dev_err(&hdev->dev, "parse failed\n"); | 174 | dev_err(&hdev->dev, "parse failed\n"); |
| @@ -178,6 +181,30 @@ static int wacom_probe(struct hid_device *hdev, | |||
| 178 | goto err_free; | 181 | goto err_free; |
| 179 | } | 182 | } |
| 180 | 183 | ||
| 184 | /* Set Wacom mode2 */ | ||
| 185 | rep_data[0] = 0x03; rep_data[1] = 0x00; | ||
| 186 | limit = 3; | ||
| 187 | do { | ||
| 188 | ret = hdev->hid_output_raw_report(hdev, rep_data, 2, | ||
| 189 | HID_FEATURE_REPORT); | ||
| 190 | } while (ret < 0 && limit-- > 0); | ||
| 191 | if (ret < 0) { | ||
| 192 | dev_err(&hdev->dev, "failed to poke device #1, %d\n", ret); | ||
| 193 | goto err_free; | ||
| 194 | } | ||
| 195 | |||
| 196 | /* 0x06 - high reporting speed, 0x05 - low speed */ | ||
| 197 | rep_data[0] = 0x06; rep_data[1] = 0x00; | ||
| 198 | limit = 3; | ||
| 199 | do { | ||
| 200 | ret = hdev->hid_output_raw_report(hdev, rep_data, 2, | ||
| 201 | HID_FEATURE_REPORT); | ||
| 202 | } while (ret < 0 && limit-- > 0); | ||
| 203 | if (ret < 0) { | ||
| 204 | dev_err(&hdev->dev, "failed to poke device #2, %d\n", ret); | ||
| 205 | goto err_free; | ||
| 206 | } | ||
| 207 | |||
| 181 | hidinput = list_entry(hdev->inputs.next, struct hid_input, list); | 208 | hidinput = list_entry(hdev->inputs.next, struct hid_input, list); |
| 182 | input = hidinput->input; | 209 | input = hidinput->input; |
| 183 | 210 | ||
