From patchwork Mon Feb 26 22:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Pereira X-Patchwork-Id: 776074 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04olkn2100.outbound.protection.outlook.com [40.92.75.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E44631E878 for ; Mon, 26 Feb 2024 22:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.75.100 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708987175; cv=fail; b=OECX+BDfjjFhXljGSlKd2+sOXlwt70KWb8Cy6GTDOduAT356DdaEXDMJ/2xsAiDze1vDjBY5ShpNS94s3GccPQvB3c8xJvjouh96ZtLT9caU5gNoqwJuJDad+LbzkqbM0N4MaO340E9XbsPqBiU82GKKkIAIwte9b4F45Xlx+9o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708987175; c=relaxed/simple; bh=HbXHPPvYh3agSVr/XidprSukZVRegCE584Ie1rFEPFA=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=HDpNxE9aWvnvY/n7rF7C1VemJV+j7MHPLLPfXiABUI+Vugt5m3z1nQZ5XxBpGtM5jeWndI6TsBb8y1KCrp0T9jCAzuNVigNTQtC+uCf7dhTEFZzVOfyCMhL28+YIPrpEQrwA+A8hR0D4JScyM8Jv+b8rM/lpATY2ZU9f9YsZ8h8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.pt; spf=pass smtp.mailfrom=outlook.pt; arc=fail smtp.client-ip=40.92.75.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.pt Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.pt ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fUM8tPnzYtSRrPj/jqsAqBe0ZBUQINFgaTLT2c89gWjQagZJ+/EBXutgU6f868q3SRWE6VlcRbs7RRsA5LFEF9btzNN8cb6Ed38jFAXx7YA5VqbnyRDcLl2VpqW6m5p2UI+N7FAKzGLsesSSFRMJVeTOj+oNFwuE06QEknQn68vAucg69uq4hEGcX5Mqs6NfU0RipOKmDWouGWs+9xwyOx7H3P0M4+vT1vjx1jRmUBMQ7cYkhjqifeEPc3gt3E7V0eZqkZbZ16t2IMd8itBubwXv+FwGWm7YxRoE14cg/cLjZ05mDTFXXTDhwBsKkWN8A08gSR/VbrBYQnZt5K4ngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3hZIkjOuagEPQ8GHurCS6oHBMERxErEMMGg+og83V5w=; b=dTC4ypCkOnCizyHRNUF6AqBJ9dksh82q6aWWG7xrZOiVaqxQehc0ptRR8RbaJtmk4eubd8RGDOzx63g4TociARgfXrCT+1z9+Kg7hGl6zEqj0isLnUjqAZ2t610H7aHugZagn8MmB+TxshXWIIKH7ccMR6KduIoQ/ae8I94WYrXe8QJ6M+z9n71bONEnXa2AAveFf7pmpLSqLjmL3tUWk6p0YLjTF1bS5YCTO+LF0On60b4d0MATz0g3Y5UBYq3b1BJM7zliC04DrikfUalaj3B/6Brc2K9/51nAnwtVzvY1Iz6FrdnYbxSo0Wic6miR46ODdpcjCssvL1luIqNMGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DU0P189MB2044.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3bc::10) by PR3P189MB1001.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:4a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Mon, 26 Feb 2024 22:39:31 +0000 Received: from DU0P189MB2044.EURP189.PROD.OUTLOOK.COM ([fe80::d8d4:7065:fa11:ba45]) by DU0P189MB2044.EURP189.PROD.OUTLOOK.COM ([fe80::d8d4:7065:fa11:ba45%4]) with mapi id 15.20.7316.034; Mon, 26 Feb 2024 22:39:31 +0000 From: Nuno Pereira To: "linux-input@vger.kernel.org" CC: Daniel Ogorchock , Ryan McClelland , "benjamin.tissoires@redhat.com" , "jikos@kernel.org" Subject: [PATCH] HID: nintendo: Fix N64 controller being identified as mouse Thread-Topic: [PATCH] HID: nintendo: Fix N64 controller being identified as mouse Thread-Index: AQHaaQOGaWUcQg00tEKCUeoMRSTM5g== Date: Mon, 26 Feb 2024 22:39:31 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [x6MSQ+cbIHMO6wS343kEaTrVDvHzfCg7] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0P189MB2044:EE_|PR3P189MB1001:EE_ x-ms-office365-filtering-correlation-id: a41733b2-8fe0-470d-98c4-08dc371bcc4e x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lKdojOg3NEU/xcyHiJoMIPtUcayL8dv7tXyr07PYHzyFwfotQk/5XnjO0u6sNBhW7k0v9+udZ+aW7ipkeDDIuYXhvauQtfeeWJ57tKgPH0fAy0Z/Ha6SWkBh+Ty8vnQb4LfDfVXZXtQY5/SjnD1uToi3tjG1kqecquCtFeakZq1h2Igm1buMxeeRkuSOwkHDkQtG/xHsTchYboFmJgvKorRe2RFpQNQL/wacnhuIq8o4/eloUhIRis+zgTsBDJw7wo5eCz7pgJ9xLtpXrRQCvt/kDfCMVtOIZjJA33QMMnT6bPh/mbWo7nWVmFHaN1PCQzn5NQ6mDtzQiKI+TFxq1StauTV5E6zwCpnFQ8TJEODZznfWDYLnoifh6yTMocTh6NZvZIxcbz+sXcqGul+VgrvrxGnfXdjXKjN8snFS83aPjYRWrMEIAEB43IoulYWvBT2vV5Zd/xYrJLWnmj9UVqkLTcMFjqJdtcXs2W+dspkJcXkQto24MGu6K9X2miQAO75Bm0Cv1XsdBDYTPpy+dkP2+vtxOkmbMpI9cYOiIPP48WKTHmqyOK60QiC+Zzyp x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?RzctQs9nAarJxJp6xNmBypk?= =?iso-8859-1?q?9JhCnx0k65DObXA/JZ48HXKZhbtAMiQIXZtWHNRCrUe7pkEOqe5WZzOoCpnG?= =?iso-8859-1?q?UptwF0Hf+uKx5EKCL9ycINLn42qReOwo7EgWqDVhu7MUI76mSU3wwIEEQbdX?= =?iso-8859-1?q?gxyETt06/v1fqylGX3saooMfO7d3DJqYn0jf/K/DFP0s7IYpal4LVLiqH0jD?= =?iso-8859-1?q?nBXiGMYnYW5QQxIKmSD9hMMok2mcEeLiQ2twsNIz6py+3VBJI+jKq2wHmd/Y?= =?iso-8859-1?q?OCcXXWv4rrgpJbsgmbdAdKB/gnH8TmHiJrd7GP01wPas31sw7bbRYEuxYxgd?= =?iso-8859-1?q?opPa5ABLZeejESDm9ywrKm2Ori4q+d41i3KGlu0AOFW3VAldF9Z2Nby+t5+l?= =?iso-8859-1?q?qZNDe8poj1sHvGlRpoBHXTscfEx2X5DkIZK7JiqLBLkTpYYplVHCxgqSbaTk?= =?iso-8859-1?q?hchnYI59IuTOCh1nhVE/fXRb+HUh2pZZbL/xigFVqRYHoQadSXZlzL2movny?= =?iso-8859-1?q?JYtwsotWMP8kZM3LjkVrIB3L54P4ArdlcmykVKtH962R0J+Mrs5fMpzVYhEF?= =?iso-8859-1?q?YwvHHRzjdItc0j5BUWqpAOVvuHyiCeVOo1DJEq1iQYDVvsFxvh0KCU37pMw1?= =?iso-8859-1?q?bzK+KfpvmBYu80jFb4x9Qo1XZpxPyIWnlVe5KHCtIvNPq1dytEEL/RVftE1k?= =?iso-8859-1?q?mW85Emy3NGVB7dn97Z8Qc/wkMpOukSnZS7TTkOC7URGauiHA7ZtudEMkvVdn?= =?iso-8859-1?q?ls3v2TrLLHpLLxnTwtc52RpFvtbyQV+qQKFwUWAU/Kg75TOr38DqutYVS3dW?= =?iso-8859-1?q?BxR9mvI4jYsqyvdv+pI/UvQ61c+1T9F3eZFQw0YC6K4w7HtWjy6OhzqGHADZ?= =?iso-8859-1?q?fEYDtBSSK3T07CEHXEx9LZh/EfL96G2oLHb2MysIOYeMiABSve1JqdrDJO/d?= =?iso-8859-1?q?8kZfGvKcvPFTrNAlAvaI00ELu45nKb6tgW8cEYvtHiBa0OEt0FmWbqZO0Eba?= =?iso-8859-1?q?484oT3YoPoaCTUM+bovrMVgX93eYrdT3jNKyqO2+sudZY/wZtjp3X+bOTn8A?= =?iso-8859-1?q?tj5NAYlgxFl/RHkKn10ICGUN+5n3x/Orq+ODhsD7OaJjmJ9HRIly8yGOKrp7?= =?iso-8859-1?q?aTwu0R+y+8EesrwT2yuD0p/s0TxwCRFu6nZZjVe5Hf998NUWBYYg1csU7f3l?= =?iso-8859-1?q?yOc3JWGtrtxy3LoDuvDT58IgFKd0vb5+gIwESCchAAzF4cEitCsa/c4wNzFz?= =?iso-8859-1?q?UYRsegZTFeIZAzQ=3D=3D?= Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4734-24-msonline-outlook-c54b5.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0P189MB2044.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a41733b2-8fe0-470d-98c4-08dc371bcc4e X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2024 22:39:31.0855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P189MB1001 This patch is regarding the recent addition of support for the NSO controllers to hid-nintendo. All controllers are working correctly with the exception of the N64 controller, which is being identified as a mouse by udev. This results in the joystick controlling the mouse cursor and the controller not being detected by games. The reason for this is because the N64's C buttons have been attributed to BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically attributed to mice. This patch changes those buttons to controller buttons, making the controller be correctly identified as such. Signed-off-by: Nuno Pereira --- drivers/hid/hid-nintendo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index ccc4032fb2b0..4b2c81b49b80 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -481,10 +481,10 @@ static const struct joycon_ctlr_button_mapping n64con_button_mappings[] = { { BTN_TR, JC_BTN_R, }, { BTN_TR2, JC_BTN_LSTICK, }, /* ZR */ { BTN_START, JC_BTN_PLUS, }, - { BTN_FORWARD, JC_BTN_Y, }, /* C UP */ - { BTN_BACK, JC_BTN_ZR, }, /* C DOWN */ - { BTN_LEFT, JC_BTN_X, }, /* C LEFT */ - { BTN_RIGHT, JC_BTN_MINUS, }, /* C RIGHT */ + { BTN_SELECT, JC_BTN_Y, }, /* C UP */ + { BTN_X, JC_BTN_ZR, }, /* C DOWN */ + { BTN_Y, JC_BTN_X, }, /* C LEFT */ + { BTN_C, JC_BTN_MINUS, }, /* C RIGHT */ { BTN_MODE, JC_BTN_HOME, }, { BTN_Z, JC_BTN_CAP, }, { /* sentinel */ },