From patchwork Thu Aug 28 13:27:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dualshock3Nerd X-Patchwork-Id: 383994 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 D2E9B140093; Fri, 29 Aug 2014 03:42:24 +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 1XN3iG-0001rF-5g; Thu, 28 Aug 2014 17:42:20 +0000 Received: from mail-wg0-f67.google.com ([74.125.82.67]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XMzl0-0000xl-42 for kernel-team@lists.ubuntu.com; Thu, 28 Aug 2014 13:28:54 +0000 Received: by mail-wg0-f67.google.com with SMTP id l18so478047wgh.2 for ; Thu, 28 Aug 2014 06:28:53 -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=Q2AFo9aQrQ+48AfItoxhcn6AC4rUynh059PPy6pXl5U9SsZH+z5zO91ArUR6hP+dop xiKMjiZ6z0jHJVeifzlrQ9sDr41sUGglH0Cp5otHfj7MkfFfi1Wu+/WpKWx4il/9QMwH AZlL+SXwpYbQwDne/S6t65ZxefarZNhXZr0JaDz5FLFdD16c/YkUeKcjvjxevGCXkyYV v7X2GSEVSe+tr8UptGfEltndT2SHWMnPlGAOSTNVGRg5iHHUHG7ytmnPFxuuVEn/pCUG S32+eeixIZu2IUW1pmoAa4UKY8czdJTnobYJs2M4ifv1EnGZwtMgs9LyF73RTYpkPunX h5AA== X-Received: by 10.194.119.193 with SMTP id kw1mr5363249wjb.82.1409232533505; Thu, 28 Aug 2014 06:28:53 -0700 (PDT) Received: from localhost.localdomain ([217.146.192.191]) by mx.google.com with ESMTPSA id pm6sm9949906wjb.36.2014.08.28.06.28.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 06:28:52 -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 15:27:52 +0200 Message-Id: <1409232472-3148-1-git-send-email-dualshock3nerd@gmail.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 28 Aug 2014 17:42:19 +0000 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 */