From patchwork Wed Jan 20 12:00:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 74043 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0KC1GkY030742 for ; Wed, 20 Jan 2010 12:01:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811Ab0ATMBG (ORCPT ); Wed, 20 Jan 2010 07:01:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753564Ab0ATMBF (ORCPT ); Wed, 20 Jan 2010 07:01:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558Ab0ATMBD (ORCPT ); Wed, 20 Jan 2010 07:01:03 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KC0u4O026753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Jan 2010 07:00:57 -0500 Received: from [10.36.8.59] (vpn2-8-59.ams2.redhat.com [10.36.8.59]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KC0sWO000409; Wed, 20 Jan 2010 07:00:55 -0500 Subject: [PATCH 2/2] [hid-wacom] Implement Wacom quirk in the kernel From: Bastien Nocera To: Dmitry Torokhov , linux-input , BlueZ development , Jiri Kosina Date: Wed, 20 Jan 2010 12:00:53 +0000 Message-ID: <1263988853.1735.2524.camel@localhost.localdomain> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 7475421..e55ed3f 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c @@ -155,7 +155,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) { @@ -165,6 +167,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"); @@ -177,6 +180,28 @@ 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); + } while (ret < 0 && limit-- > 0); + 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); + } while (ret < 0 && limit-- > 0); + 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;