diff options
Diffstat (limited to 'drivers/hid/hid-wacom.c')
| -rw-r--r-- | drivers/hid/hid-wacom.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 12dcda529201..8d3b46f5d149 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,31 @@ static int wacom_probe(struct hid_device *hdev, | |||
| 178 | goto err_free; | 181 | goto err_free; |
| 179 | } | 182 | } |
| 180 | 183 | ||
| 184 | /* | ||
| 185 | * Note that if the raw queries fail, it's not a hard failure and it | ||
| 186 | * is safe to continue | ||
| 187 | */ | ||
| 188 | |||
| 189 | /* Set Wacom mode2 */ | ||
| 190 | rep_data[0] = 0x03; rep_data[1] = 0x00; | ||
| 191 | limit = 3; | ||
| 192 | do { | ||
| 193 | ret = hdev->hid_output_raw_report(hdev, rep_data, 2, | ||
| 194 | HID_FEATURE_REPORT); | ||
| 195 | } while (ret < 0 && limit-- > 0); | ||
| 196 | if (ret < 0) | ||
| 197 | dev_warn(&hdev->dev, "failed to poke device #1, %d\n", ret); | ||
| 198 | |||
| 199 | /* 0x06 - high reporting speed, 0x05 - low speed */ | ||
| 200 | rep_data[0] = 0x06; rep_data[1] = 0x00; | ||
| 201 | limit = 3; | ||
| 202 | do { | ||
| 203 | ret = hdev->hid_output_raw_report(hdev, rep_data, 2, | ||
| 204 | HID_FEATURE_REPORT); | ||
| 205 | } while (ret < 0 && limit-- > 0); | ||
| 206 | if (ret < 0) | ||
| 207 | dev_warn(&hdev->dev, "failed to poke device #2, %d\n", ret); | ||
| 208 | |||
| 181 | hidinput = list_entry(hdev->inputs.next, struct hid_input, list); | 209 | hidinput = list_entry(hdev->inputs.next, struct hid_input, list); |
| 182 | input = hidinput->input; | 210 | input = hidinput->input; |
| 183 | 211 | ||
