From patchwork Wed Jan 13 14:40:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Moreau X-Patchwork-Id: 8026101 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A351BEEE5 for ; Wed, 13 Jan 2016 14:40:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5162F20499 for ; Wed, 13 Jan 2016 14:40:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39C932045A for ; Wed, 13 Jan 2016 14:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184AbcAMOks (ORCPT ); Wed, 13 Jan 2016 09:40:48 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35736 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755410AbcAMOkr (ORCPT ); Wed, 13 Jan 2016 09:40:47 -0500 Received: by mail-oi0-f66.google.com with SMTP id e195so19896311oig.2 for ; Wed, 13 Jan 2016 06:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=o6MH52f7qiotygNnD7QQz+jG/3hWCVkkVVjxvwrx9EQ=; b=Ik2kKbOHsGHCZP6Xxn2uxhYIzNciCVMqwBIP2CFeBna36KrkDB1Lua9dvSVg392sbL 2ljlY12uFyavnG5KbGrk+wH5kQnlx2PsGNbnUd89cr9QAVDUw1OeoGlcFbn1bN52Ygft RT50ZtN3VeeUmG1+1zjQCSEL3hQqHTaOTzbu5Yg5SQkD+uiSnLPa4K5ox6gSepiaYyDQ E7GeDggcOClxk4zB3lgG53Q3j8/Rh3wsSkEJGeh6hze+rf6pDmaQ5Z+jKf/s3b4q9eR8 8oIKAtYuplrEAfziAuZGrhAx28MlS/8UNcTO/jPyByATQgdNS0KBy0SIYb3hQMlVRAeZ uk/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o6MH52f7qiotygNnD7QQz+jG/3hWCVkkVVjxvwrx9EQ=; b=UGg3ubOZUAvYLWbMNy7UUh1r6EgsZzYgCyiLbPuMvK2KC89U6kcgsSdmVr30RASf2C gZBNm4qh0Qvjxlhvxv02BhYTP2HrDspyopMKuMmZFVEYGGfn8ijOhYNDG7l+iQDvoPDw QwKBjWX0x9G8yHvhZvUIbMjrRDQs4O6OxQltig/tbe7xRPYhhQtF5Jyej5zvH56XyaIv g0udKByBDdjVTJLimRy9/hUeXCN540ERBOU6g9IRq9qPM5eVXFhvcBpe0ZTbUjsw+c1R VHk5EBKfXprRzkfP8jJ6totoVxEvElKPjQId2Gnqt61oaREnXUj055ocaRCx84FCh12w Tn5A== X-Gm-Message-State: ALoCoQnbINmjw4JkWP5zgSYP/pQbvazdnR4BxFHhQ4j1GMo+ifNELm5f2JL+nn6NMuJYAPIpO0j0YPE/CmQfm8CDdIgnj9x5Pg== X-Received: by 10.202.180.66 with SMTP id d63mr14516392oif.137.1452696046641; Wed, 13 Jan 2016 06:40:46 -0800 (PST) Received: from desktop.localdomain (c-76-120-6-42.hsd1.co.comcast.net. [76.120.6.42]) by smtp.gmail.com with ESMTPSA id u8sm664185obf.5.2016.01.13.06.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 06:40:46 -0800 (PST) From: Scott Moreau To: linux-input@vger.kernel.org Cc: ao2@ao2.it, jkosina@suse.cz, frank.praznik@oh.rr.com, Scott Moreau Subject: [PATCH 1/2] HID: sony: Add nyko core controller support Date: Wed, 13 Jan 2016 07:40:42 -0700 Message-Id: <1452696043-18362-1-git-send-email-oreaus@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds rumble and LED support for nyko core controllers using the sino lite chip vendor:1345 product:3008, for PS3. Setting operational mode and output reports are the same as sixaxis but the input report has a different format since the PS3 accepts HID usb devices. For it to work, an exception is needed to skip overriding the report descriptor and use the original one. Signed-off-by: Scott Moreau --- For proper functionality, this patch depends on http://article.gmane.org/gmane.linux.kernel.input/47590 drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-sony.c | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index c6f7a69..bcaf96e 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2008,6 +2008,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) }, { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 8b78a7f..a6b2dee 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -869,6 +869,9 @@ #define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002 #define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000 +#define USB_VENDOR_ID_SINO_LITE 0x1345 +#define USB_DEVICE_ID_SINO_LITE_CONTROLLER 0x3008 + #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2 #define USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST 0x0034 #define USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST 0x0046 diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 774cd22..ea13de0 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -50,6 +50,7 @@ #define MOTION_CONTROLLER_BT BIT(8) #define NAVIGATION_CONTROLLER_USB BIT(9) #define NAVIGATION_CONTROLLER_BT BIT(10) +#define SINO_LITE_CONTROLLER BIT(11) #define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT) #define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT) @@ -1116,6 +1117,9 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, { struct sony_sc *sc = hid_get_drvdata(hdev); + if (sc->quirks & SINO_LITE_CONTROLLER) + return rdesc; + /* * Some Sony RF receivers wrongly declare the mouse pointer as a * a constant non-data variable. @@ -2458,6 +2462,9 @@ static const struct hid_device_id sony_devices[] = { .driver_data = DUALSHOCK4_CONTROLLER_USB }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), .driver_data = DUALSHOCK4_CONTROLLER_BT }, + /* Nyko Core Controller for PS3 */ + { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER), + .driver_data = SIXAXIS_CONTROLLER_USB | SINO_LITE_CONTROLLER }, { } }; MODULE_DEVICE_TABLE(hid, sony_devices);