From patchwork Thu Aug 28 17:28:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dualshock3Nerd X-Patchwork-Id: 383992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id A8CE614012D; Fri, 29 Aug 2014 03:29:22 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XN3Vb-0000fK-PV; Thu, 28 Aug 2014 17:29:15 +0000 Received: from mail-wi0-f194.google.com ([209.85.212.194]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XN3VW-0000eq-HM for kernel-team@lists.ubuntu.com; Thu, 28 Aug 2014 17:29:10 +0000 Received: by mail-wi0-f194.google.com with SMTP id d1so815616wiv.1 for ; Thu, 28 Aug 2014 10:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=UZNS5sqoeD/9dGUZ6agzzNMwYo0uHIsQf4e2jRFKKdQ=; b=U8qvpRUp6sigKvHWSWbZHjGLYN4XWg6RR2PpXvKlYxX2U7pGdTMt7k0Gbck7BzlNqD d0ls5mzGwSczU5pLMoKvpu9r7tXilKR84M/Qb2F+h9vrVrIU2xfwkdZH1gzp+aChvs/b hONp6HhgWWjI8bx9VE2/WRVWxk35RVjbRdCpYCTrDgY00JxyQLV+VpLi9Fu2R2z+RVhP Z9f8jQDRrQWWVQrse0rqDy7k/qwPzStgidY3e7QonpJLY1W1j8NJepPoxv70JdHkYQR4 tuaxeRyqlb9GvbSdce4bFYI44pqZ0B3HXF3eDGQpc5T8kURgox1XT5Yjev5nFHIJ4dUR gmVw== X-Received: by 10.180.19.97 with SMTP id d1mr7911440wie.19.1409246948365; Thu, 28 Aug 2014 10:29:08 -0700 (PDT) Received: from localhost.localdomain ([217.146.192.191]) by mx.google.com with ESMTPSA id js2sm11602238wjc.9.2014.08.28.10.29.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 10:29:07 -0700 (PDT) From: Dualshock3Nerd To: kernel-team@lists.ubuntu.com Subject: [PATCH] UBUNTU: SAUCE: Restore hid_get_raw_report in struct hid_device Date: Thu, 28 Aug 2014 19:28:34 +0200 Message-Id: <1409246914-5743-1-git-send-email-dualshock3nerd@gmail.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: https://bugs.launchpad.net/bugs/1326725 Module hid-sony failed to set usb operational mode for dualshock3/sixaxis controller using hid_hw_raw_request. Up to Linux 3.13 this driver requires hid_get_raw_report because it needs special quirks to set it's operational mode. Signed-off-by: Dualshock3Nerd --- drivers/hid/hid-sony.c | 3 +-- drivers/hid/i2c-hid/i2c-hid.c | 1 + drivers/hid/uhid.c | 1 + drivers/hid/usbhid/hid-core.c | 1 + include/linux/hid.h | 3 +++ net/bluetooth/hidp/core.c | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 5b86b77..098af2f8 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -432,8 +432,7 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) if (!buf) return -ENOMEM; - ret = hid_hw_raw_request(hdev, 0xf2, buf, 17, HID_FEATURE_REPORT, - HID_REQ_GET_REPORT); + ret = hdev->hid_get_raw_report(hdev, 0xf2, buf, 17, HID_FEATURE_REPORT); if (ret < 0) hid_err(hdev, "can't set operational mode\n"); diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index bc7a77e..f977af0 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -1056,6 +1056,7 @@ static int i2c_hid_probe(struct i2c_client *client, hid->driver_data = client; hid->ll_driver = &i2c_hid_ll_driver; + hid->hid_get_raw_report = i2c_hid_get_raw_report; hid->hid_output_raw_report = __i2c_hid_output_raw_report; hid->dev.parent = &client->dev; ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev)); diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index b2b83be..cedc6da 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -377,6 +377,7 @@ static int uhid_dev_create(struct uhid_device *uhid, hid->uniq[63] = 0; hid->ll_driver = &uhid_hid_driver; + hid->hid_get_raw_report = uhid_hid_get_raw; hid->hid_output_raw_report = uhid_hid_output_raw; hid->bus = ev->u.create.bus; hid->vendor = ev->u.create.vendor; diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 8860329..44df131 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1253,6 +1253,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * usb_set_intfdata(intf, hid); hid->ll_driver = &usb_hid_driver; + hid->hid_get_raw_report = usbhid_get_raw_report; hid->hid_output_raw_report = usbhid_output_raw_report; hid->ff_init = hid_pidff_init; #ifdef CONFIG_USB_HIDDEV diff --git a/include/linux/hid.h b/include/linux/hid.h index 1653084..4373304 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -516,6 +516,9 @@ struct hid_device { /* device report descriptor */ struct hid_usage *, __s32); void (*hiddev_report_event) (struct hid_device *, struct hid_report *); + /* handler for raw input (Get_Report) data, used by hidraw */ + int (*hid_get_raw_report) (struct hid_device *, unsigned char, __u8 *, size_t, unsigned char); + /* handler for raw output data, used by hidraw */ int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index f41f637..d9fb934 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -787,6 +787,7 @@ static int hidp_setup_hid(struct hidp_session *session, hid->dev.parent = &session->conn->hcon->dev; hid->ll_driver = &hidp_hid_driver; + hid->hid_get_raw_report = hidp_get_raw_report; hid->hid_output_raw_report = hidp_output_raw_report; /* True if device is blacklisted in drivers/hid/hid-core.c */