diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-01-20 07:00:53 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-02-03 09:45:49 -0500 |
commit | 46a709b900bfcf43244cd19cf3245c77484ec733 (patch) | |
tree | 0d046897eabf34790181c7d302a5deca438e8eb6 /drivers/hid/hid-wacom.c | |
parent | d4bfa033ed84e0ae446eff445d107ffd5ee78df3 (diff) |
HID: Implement Wacom quirk in the kernel
The hid-wacom driver required user-space to poke at the tablet
to make it send data about the cursor location.
This patch makes it do the same thing but in the kernel.
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-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 | ||