On Fri, Jan 29, 2010 at 6:20 AM, Jiri Kosina <jkosina@suse.cz> wrote:
From: Bastien Nocera <hadess@hadess.net>

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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 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 12dcda5..d7897b5 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,
       struct hid_input *hidinput;
       struct input_dev *input;
       struct wacom_data *wdata;
+       char rep_data[2];
       int ret;
+       int limit;

       wdata = kzalloc(sizeof(*wdata), GFP_KERNEL);
       if (wdata == NULL) {
@@ -166,6 +168,7 @@ static int wacom_probe(struct hid_device *hdev,

       hid_set_drvdata(hdev, wdata);

+       /* Parse the HID report now */
       ret = hid_parse(hdev);
       if (ret) {
               dev_err(&hdev->dev, "parse failed\n");
@@ -178,6 +181,30 @@ static int wacom_probe(struct hid_device *hdev,
               goto err_free;
       }

+       /* Set Wacom mode2 */
+       rep_data[0] = 0x03; rep_data[1] = 0x00;
+       limit =3;
+       do {
+               ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
+                               HID_FEATURE_REPORT);
+       } while (ret < 0 && limit-- > 0);
 
hdev->hid_output_raw_report error is not a hard failure, i.e., the following four lines are unnecessay. We can continue with the rest of the code.
 
+       if (ret < 0) {
+               dev_err(&hdev->dev, "failed to poke device #1, %d\n", ret);
+               goto err_free;
+       }
+
+       /* 0x06 - high reporting speed, 0x05 - low speed */
+       rep_data[0] = 0x06; rep_data[1] = 0x00;
+       limit = 3;
+       do {
+               ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
+                               HID_FEATURE_REPORT);
+       } while (ret < 0 && limit-- > 0);
 
Same comments apply here. "/* Note that if query fails it is not a hard failure */" is the comments we use in the corresponding Wacom USB driver, wacom_sys.c
 
+       if (ret < 0) {
+               dev_err(&hdev->dev, "failed to poke device #2, %d\n", ret);
+               goto err_free;
+       }
+
       hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
       input = hidinput->input;
 
Everything else looks good to me.
 
Ping