From patchwork Fri Nov 9 02:25:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Moreau X-Patchwork-Id: 10675239 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E22341751 for ; Fri, 9 Nov 2018 02:25:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D41472EC81 for ; Fri, 9 Nov 2018 02:25:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8CF12EC94; Fri, 9 Nov 2018 02:25:24 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 4CECD2EC8A for ; Fri, 9 Nov 2018 02:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbeKIMDd (ORCPT ); Fri, 9 Nov 2018 07:03:33 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:39848 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbeKIMDd (ORCPT ); Fri, 9 Nov 2018 07:03:33 -0500 Received: by mail-it1-f196.google.com with SMTP id m15so1161670itl.4 for ; Thu, 08 Nov 2018 18:25:05 -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=+B0HIxpJmSSIqLxMjM/fWalXnqx9k6sie5Xh1k+TCl8=; b=eigvjuUTTo9hFCLVyiYOiwRrtsFqnorE8fNJ1c0RFFpDGB6A0ZhALBCfdDMjdtY7ta sdFQnmgvhsfJOCJhNzRUegweX6YZQ9rFlUQ04euJ+rTxrKPqwPICKj73ga5xPI+LBZ+M Bo7v6XiAJwscQfeXf0KYpsqyHxXMrR5ZCA6nvbPdNj6Y+FKNb/6qUTWtkDBo7EWcigah 2PfakZo15ALeb2CyjYawA6n2a6C4t/9cLv3DXpZUhbYFEec5UjFhr3hqA1N85YRTA37Y W3dISvejBG/vmdCvgci+eswEt8rbiBGfDI8rhhBzD4erZwzw91AOr8FfkRmetUhVYVud 2aXA== 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=+B0HIxpJmSSIqLxMjM/fWalXnqx9k6sie5Xh1k+TCl8=; b=jdPpaGfIm4m0EtG17QcTYYfpiRYOFmtBJ7eRa6uRxlvMf/CaVLfZL9AC1NWDMLJb+s 1cgH/4OK6zLjgtmhaSnTSs1FJ1CGvkJawC1EGGry06WbmjKELW6oA2mTK/Z6XuOpvsRi zHtQsszlPSz5O7zVZpVYWF7ltNmI6lf6zoUMEZQXhzRc7OieE7BzLfj3KXPRO6ivno02 Of1Jf20vW23P6NU9ZiyoWY4Taft7Ywxs0NivfkVcxECA/Li4GbNUWgfJHs3Q0J4gFdFW +fMh5Cu02/QKw4suw6GeL/LDW4T+gGpp9XGBR19CvFr1PAJYj9KxQXfGE3Uva+ZEJR3v w36g== X-Gm-Message-State: AGRZ1gKe8pmGlf4k2L5R7m3HuFOZ44mZ8jg7UZu3zWGQHr3AuUijfBd+ 0nK/G9so+ByM+Q56Wzfn2lshV/FP X-Google-Smtp-Source: AJdET5cEOgASdZ0hRA7tevwre6EqsdPWxoGQatRx2YjKGugG0nN57+VrqBkKpH0o/2rA0QIiygxKFw== X-Received: by 2002:a24:b204:: with SMTP id u4-v6mr723451ite.33.1541730305478; Thu, 08 Nov 2018 18:25:05 -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 v129-v6sm82622ita.38.2018.11.08.18.25.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 18:25:05 -0800 (PST) From: Scott Moreau To: linux-input@vger.kernel.org Cc: Scott Moreau Subject: [PATCH] HID: sony: Fix up nyko core controller Date: Thu, 8 Nov 2018 19:25:02 -0700 Message-Id: <20181109022502.19633-1-oreaus@gmail.com> X-Mailer: git-send-email 2.17.1 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 --- 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 9671a4bad643..ff51c79a740a 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1335,6 +1335,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); @@ -2624,6 +2627,10 @@ static int sony_input_configured(struct hid_device *hdev, goto err_stop; } + 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) { /*