From patchwork Wed Jan 10 18:46:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Moreau X-Patchwork-Id: 10155875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 806A7602D8 for ; Wed, 10 Jan 2018 18:46:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 747ED2223E for ; Wed, 10 Jan 2018 18:46:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68F0C285D4; Wed, 10 Jan 2018 18:46:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 066002223E for ; Wed, 10 Jan 2018 18:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872AbeAJSqm (ORCPT ); Wed, 10 Jan 2018 13:46:42 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:41084 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbeAJSql (ORCPT ); Wed, 10 Jan 2018 13:46:41 -0500 Received: by mail-io0-f193.google.com with SMTP id f6so492021ioh.8 for ; Wed, 10 Jan 2018 10:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EorfSIVzHdxf1yFNzAAAZPs59W+cMGkr/rn8jXXsthc=; b=RLtjJrTE84fy22XroKs7nFxlHPzdTgFx5D470GcbwuRhblPzqhggWtar6k7otXgsXG I53c5P/XkIrdKW6ZjYV0UuFaReu3G3JRCzQNSuJFDUUpSP1dSGtzIWGtmB0MlIEg/SuE yXhZ2/T820p8M1pBcSh65pemOXnCVW3Sg6dw4EP6+EkyCNC6dYoqle7CDQ3cWsLdZchV q+iaw5rDqgkJTrAAOcnL4aXIKTgIlc1IHwKsp6DVcLj/eMPtgZ9aCqkDA+f2GySg2+xQ Cr6Y2LOXeOQ0hoX2ZVDjUxh3BrC/Zwr3p2066FI3deF7T+RE+lpfNlY+GYJh/1GpI0mM NB5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EorfSIVzHdxf1yFNzAAAZPs59W+cMGkr/rn8jXXsthc=; b=X1aj3pL8zIf6pCnpREXy2WXG14gX5s3n1zltffqIWLAReMSgaBZsiAvg+DsQysGdeg D0LRcVTSjjbbgmmqoojvhR1FpLGudbRv/hQuXoER6N66SlU0dwsy5vu3Xqy7F2kOSblQ WQxWh6K1d4WbeHcp1Oj234URqw81krFAupZYgNKUqSD8VbyAriVlI4EHQHJXMnaNJydP ScHR0V21MuA+iyIa2hCfhvRcCP0sylzafeuAid/dHIQA78uNF+q+nFr3FbiUWT+U5D4R zgV56meVnF9AOE2Xa211z+cShJ4goBPrD5XvWYbeFSeq61Jdn7tdVAritr4kw4gF9Ss4 /Nmg== X-Gm-Message-State: AKGB3mIxefVYHr64RIcneo48LSunRJDurK57nuwdzSbrtJyJAboEHgJZ nMXayI+73ZSzRX3+P9TR2ZfaJA== X-Google-Smtp-Source: ACJfBotgaA/m5XvR96UTqZaa6GBuiJbb6pfe/qgG9sjNOQdiHg96WYKLFnyaCHj89yd0+Gdv9+FrJA== X-Received: by 10.107.101.19 with SMTP id z19mr18273412iob.162.1515610000580; Wed, 10 Jan 2018 10:46:40 -0800 (PST) Received: from localhost.localdomain (c-71-229-200-34.hsd1.co.comcast.net. [71.229.200.34]) by smtp.gmail.com with ESMTPSA id u1sm10295002iou.17.2018.01.10.10.46.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 10:46:39 -0800 (PST) From: Scott Moreau To: linux-input@vger.kernel.org Cc: Scott Moreau Subject: [PATCH v3] HID: sony: Fix up nyko core controller Date: Wed, 10 Jan 2018 11:46:13 -0700 Message-Id: <1515609973-21447-1-git-send-email-oreaus@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes missing d-pad axis broken since e19a267b99. The axis mapping for the nyko controller has the d-pad as axis 0x39 instead of d-pad as buttons. This is handled by the default hid mapping so we return 0 in sony_mapping. This controller also has no accelerometer so avoid initializing it with a condition in sony_input_configured() to setup these controllers. Signed-off-by: Scott Moreau --- Changed in v3: - Added signoff drivers/hid/hid-sony.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index b9dc3ac..1be0a35 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1225,6 +1225,9 @@ static int sony_mapping(struct hid_device *hdev, struct hid_input *hi, if (sc->quirks & NAVIGATION_CONTROLLER) return navigation_mapping(hdev, hi, field, usage, bit, max); + if (sc->quirks & SINO_LITE_CONTROLLER) + return 0; + if (sc->quirks & SIXAXIS_CONTROLLER) return sixaxis_mapping(hdev, hi, field, usage, bit, max); @@ -2566,6 +2569,10 @@ static int sony_input_configured(struct hid_device *hdev, } sony_init_output_report(sc, sixaxis_send_output_report); + } else if (sc->quirks & SINO_LITE_CONTROLLER) { + hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID; + + sony_init_output_report(sc, sixaxis_send_output_report); } else if (sc->quirks & SIXAXIS_CONTROLLER_USB) { /* * The Sony Sixaxis does not handle HID Output Reports on the