From nobody Mon Apr 6 08:13:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79253C38145 for ; Thu, 8 Sep 2022 17:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231975AbiIHRlV (ORCPT ); Thu, 8 Sep 2022 13:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232251AbiIHRkj (ORCPT ); Thu, 8 Sep 2022 13:40:39 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A0DE27 for ; Thu, 8 Sep 2022 10:39:36 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id c24so17408881pgg.11 for ; Thu, 08 Sep 2022 10:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=vTaJzQMO9aQaSOztqsBCXeGz2f0zGMSY5MlxCdWwSg8=; b=gM1cOCVOyZsazktciwe2XNqwD+uixc4yUsTQG3i3iDnLna/bfq7pPsNHpfIYwKKjLm 2Yl/txOCUwQELNiVtzqWmdK4kppkfWXmgHkgE13VfJpVO0naIESplhWl2C1eukWHLe93 GvpNUfViKrFuNe/sMnVrworaKn2c14FQnjfhotFb1tOpoP6sawKR5rjJUrGhWpJzrl8E ENKcqBP4xBadxP3muXdquQ6ZfcERDVFIevaHmxj3VPuWA/FSJfZjZTAEell6d9C31ouu wV6BGzcVPlOpLMhOAqlRttLZ87WUUYYQG4g4t2cQc0yL7A3WyggwgGRg2lt7Oz+KeCV7 7Z0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=vTaJzQMO9aQaSOztqsBCXeGz2f0zGMSY5MlxCdWwSg8=; b=UEY3Ug9Dl/Mct3o510Zi2BDETZ1Nkfhz+34Wr43Icw6SEFX7otihjQ91dVrdAKfbIN 964zGiv6TL1xmr0i13iW3ctXQy+CnHJ945iQPnqsDXc2Bc+Ael8QKhwJZwiNh4eh+pFy CluzUEzbwE7zNuB69FXnRxjm0nEv0Jao0MJN5WJOjbHd7tvAj5Ne9vnQExbKlrm0uB9U RqqX0Qq/dcZ73ANudVE1nGwdHyENKDXRGI9xHEabOQSygUmnplHmDkKgB4apT7yWrddA cW2i+qAkYkMcgUtNHLKAMVmO1gXgxprJXgJJClqMBS8+4tVXCcMazY8hZC8YrsmMRqjs nJ9w== X-Gm-Message-State: ACgBeo2rIlEpX4MaQBdLUd5JBI+lWyvh4/7Chiq1g8MvYqDRSqbHLxEI T9zM3nFcJwF/cv5NN6cUKkR8oQ== X-Google-Smtp-Source: AA6agR6MrtDO7uvKfnogPTIOMXEJLmmWRDSvCOSO4jhbNzkHSPoRWpisn8/zZaxyoR/AL3wwDvlMsA== X-Received: by 2002:a63:ec55:0:b0:434:a8e6:7d0 with SMTP id r21-20020a63ec55000000b00434a8e607d0mr8845720pgj.390.1662658774794; Thu, 08 Sep 2022 10:39:34 -0700 (PDT) Received: from ghaven-kernel.yocom.org.beta.tailscale.net ([2601:600:8f80:973::5f]) by smtp.gmail.com with ESMTPSA id x76-20020a62864f000000b0052d4b0d0c74sm15166767pfd.70.2022.09.08.10.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 10:39:34 -0700 (PDT) From: Nate Yocom To: dmitry.torokhov@gmail.com Cc: nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com Subject: [PATCH v6 1/5] Input: joystick: xpad: Add X-Box Adaptive support Date: Thu, 8 Sep 2022 10:39:26 -0700 Message-Id: <20220908173930.28940-2-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908173930.28940-1-nate@yocom.org> References: <20220908173930.28940-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Adds correct VID/PID for this XTYPE_XBOXONE compatible controller to xpad_device[] table. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera Reviewed-by: Mattijs Korpershoek --- drivers/input/joystick/xpad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 18190b529bca..c8b38bb73d34 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -131,6 +131,7 @@ static const struct xpad_device { { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, XTYPE_XBOXONE }, { 0x045e, 0x02ea, "Microsoft X-Box One S pad", 0, XTYPE_XBOXONE }, { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYP= E_XBOX360W }, + { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE= }, { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTT= ON, XTYPE_XBOXONE }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 }, { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 }, --=20 2.30.2 From nobody Mon Apr 6 08:13:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 763AEC54EE9 for ; Thu, 8 Sep 2022 17:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbiIHRlP (ORCPT ); Thu, 8 Sep 2022 13:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbiIHRkV (ORCPT ); Thu, 8 Sep 2022 13:40:21 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88956FD16 for ; Thu, 8 Sep 2022 10:39:37 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id t65so6494680pgt.2 for ; Thu, 08 Sep 2022 10:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=FKRPxQ5naxQK7DTBiolb96pHzElhA3kQapK3dHX4GyI=; b=64adH5I4fYXThrhknLfUKFk2qgQ5orBkYnjbBIu2+9qcbBrDhIaUz6/0TXhBROM+V9 GoBFfWtdjPZOiJmAkeXNxxCIMJj/7yjBQ0R+yg/mApkAvFX0t0SxPJk2HDooKO7x3mTH 5oUNuLNT7Knvvrjp43o3qwkuymNNarTCQfAHFvjOFmjsgxHVzXi6GkJkk9enmQ8T/03G +Ve3n4fCzm8nN1JhFDnTG6lSvf6W9bZec3Ly2dwSTsPIyu5N4WueDjuRcpZo/P9mxQGW giefMHoNzjhVQTIS2tBcE9Fp4r0k8ZroYpRr/dE2C1u8DVcoUiHo+1f3DB0Ga8MbBAM4 iHeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=FKRPxQ5naxQK7DTBiolb96pHzElhA3kQapK3dHX4GyI=; b=jKl7Nmjsi0RPvLouTj39l5E6nJAxiQfCIZA0RNWiZdtum99kWUZ8uasAD70GnchlMe YR6aQ63LvGdaY57mOsCP5NeermMTLv6RFFzQIGDrZi0tMOyHoOT82CJhbmiKFutG5sW5 UWTXix28/TJrYZPIn3yT32UPmLixKhUINungEgJdju6OefTYGqygzcLLS1ZNOswD0jOL +oFMV5nxm2G25WM5fWM5zc9/lAH5XqvAVe4u11IOorXFZPYtCCxhmWloqkaFC7aTg8C3 iyQgTxmy6uzO3I3O83u1FidklI83qeHp5Kg7pPUIUKf279IJBdwpwrB5b6C46/q5acNA sHZQ== X-Gm-Message-State: ACgBeo3A4I613zlOFYoQjDvMOnvv6fMGWN80+Zrj8RHqXpCwUbuh0Jjk jZae2Za2nWNF60jEF8BMQLCGWg== X-Google-Smtp-Source: AA6agR5mOhvkHP0/rVnWqdL6DhOZwPuxfZnHYmEAP/YWN/jX6dy4BAUGE//gzBGs2IBk7BF1T2OhDg== X-Received: by 2002:a63:1d58:0:b0:434:93f1:2e9f with SMTP id d24-20020a631d58000000b0043493f12e9fmr8904266pgm.157.1662658776105; Thu, 08 Sep 2022 10:39:36 -0700 (PDT) Received: from ghaven-kernel.yocom.org.beta.tailscale.net ([2601:600:8f80:973::5f]) by smtp.gmail.com with ESMTPSA id x76-20020a62864f000000b0052d4b0d0c74sm15166767pfd.70.2022.09.08.10.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 10:39:35 -0700 (PDT) From: Nate Yocom To: dmitry.torokhov@gmail.com Cc: nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com Subject: [PATCH v6 2/5] Input: joystick: xpad: Add X-Box Adaptive XBox button Date: Thu, 8 Sep 2022 10:39:27 -0700 Message-Id: <20220908173930.28940-3-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908173930.28940-1-nate@yocom.org> References: <20220908173930.28940-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Adaptive controller sets 0x02 bit for this button, all others set 0x01 so presence of either is used for BTN_MODE. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera Reviewed-by: Mattijs Korpershoek X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81C46C6FA86 for ; Thu, 8 Sep 2022 17:41:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231531AbiIHRlZ (ORCPT ); Thu, 8 Sep 2022 13:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiIHRku (ORCPT ); Thu, 8 Sep 2022 13:40:50 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33042D1D5 for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id s14so9021312plr.4 for ; Thu, 08 Sep 2022 10:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=O5FoYocoznvhyRvqw8gv5IRTDjEDa6vZWW0iZZav3Ss=; b=ogejVbJ8uFcXB4k/W3Y8ZIi4R2OfDpBMqaqC19oqU1lGFKdJz6WgI4g6Me68KPFHnD sIT7WjUC4h9fnc2tIyNUA2u6g09FdIS5uQyNYiczZIf9b8woXxCh44lRnj4H4ci/u+ij 0N/X7+wAL+Fyl1NTeXVziVFPYlWPI5w7KWwPRFqkCviQEXshYDdNkcX63Pip50hOxRL6 UZOVklnRth/MpIboxuqe/61Qdq0O9jTqBSSnyEJFRdYbkonudb+IDiwcJ7Ihl0KXxJ4g HHj0Zw/3DbOk9rCgw35QakOOBgX7xINABOKSPVWyfjD//Rxp/ph0WtcPG21Ju9nTL2kx HL6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=O5FoYocoznvhyRvqw8gv5IRTDjEDa6vZWW0iZZav3Ss=; b=sUhQlARrBjSY4zWKSEwX8I2UIMuLzPps66bWrSjcrxrD7/WsGaeFnAeDLwR8ozOmAj yjneTj88nOuk6FhECXvUJMcHTKrG7h37clm+4zXDG7yvfK2O/RsqF7yEwlijPM5y71t5 3sXV7WxV/DRv8I25WSMWWGSZFZQXc+SSY+pxYnOKIXHsCMkmCVDrBYHDhqNbPeunl4pF 3RfvCnkXVTabSSGStxbIwDol1kPK+4FaKXN38t9sEA0HXfB/qJ2U/RbvnORCCWZF1XF/ 3l+h8m3/zaHlJ2i7sjixI4B5sfOUi3/AV1CQ/d0DgIIoiPi/V/aBjJt+eSrAJvCXw+bI 6jcw== X-Gm-Message-State: ACgBeo30JRMeH0aqpOufnjs5Z05mp8VSfjNhO3ugO/DFeh1fr0ZVz4et ykZ1E9tUm61/Ivyn980G6dqQC9m4S6TQXkES X-Google-Smtp-Source: AA6agR5CdBHGZtnsfi2EQgd+cDex6+eBrX2IMIPIvngcLYBS62ZD6/G3M1CZFZWgrkdOsI0S6MQXFg== X-Received: by 2002:a17:903:248:b0:172:7520:db04 with SMTP id j8-20020a170903024800b001727520db04mr10038835plh.99.1662658777993; Thu, 08 Sep 2022 10:39:37 -0700 (PDT) Received: from ghaven-kernel.yocom.org.beta.tailscale.net ([2601:600:8f80:973::5f]) by smtp.gmail.com with ESMTPSA id x76-20020a62864f000000b0052d4b0d0c74sm15166767pfd.70.2022.09.08.10.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 10:39:36 -0700 (PDT) From: Nate Yocom To: dmitry.torokhov@gmail.com Cc: nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com Subject: [PATCH v6 3/5] Input: joystick: xpad: Add ABS_PROFILE to uapi Date: Thu, 8 Sep 2022 10:39:28 -0700 Message-Id: <20220908173930.28940-4-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908173930.28940-1-nate@yocom.org> References: <20220908173930.28940-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add an ABS_PROFILE axis for input devices which need it, e.g. X-Box Adaptive Controller and X-Box Elite 2. Signed-off-by: Nate Yocom --- drivers/hid/hid-debug.c | 3 ++- include/uapi/linux/input-event-codes.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 81e7e404a5fc..2ca6ab600bc9 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -1014,7 +1014,8 @@ static const char *absolutes[ABS_CNT] =3D { [ABS_HAT3Y] =3D "Hat 3Y", [ABS_PRESSURE] =3D "Pressure", [ABS_DISTANCE] =3D "Distance", [ABS_TILT_X] =3D "XTilt", [ABS_TILT_Y] =3D "YTilt", [ABS_TOOL_WIDTH] =3D "ToolWidth", - [ABS_VOLUME] =3D "Volume", [ABS_MISC] =3D "Misc", + [ABS_VOLUME] =3D "Volume", [ABS_PROFILE] =3D "Profile", + [ABS_MISC] =3D "Misc", [ABS_MT_TOUCH_MAJOR] =3D "MTMajor", [ABS_MT_TOUCH_MINOR] =3D "MTMinor", [ABS_MT_WIDTH_MAJOR] =3D "MTMajorW", diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/in= put-event-codes.h index dff8e7f17074..7ad931a32970 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -862,6 +862,7 @@ #define ABS_TOOL_WIDTH 0x1c =20 #define ABS_VOLUME 0x20 +#define ABS_PROFILE 0x21 =20 #define ABS_MISC 0x28 =20 --=20 2.30.2 From nobody Mon Apr 6 08:13:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11EA8C54EE9 for ; Thu, 8 Sep 2022 17:41:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbiIHRle (ORCPT ); Thu, 8 Sep 2022 13:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232114AbiIHRlC (ORCPT ); Thu, 8 Sep 2022 13:41:02 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47282A96B for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id c24so17409036pgg.11 for ; Thu, 08 Sep 2022 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=GeBUNt6iKyKVMJSNccGv5u8JOw8oNIwF9ROYFrWs1lE=; b=lWs9gg2J19N5dbtQLQWBSb3sLJ3t1w4TFIYRGfoDqPXPEVoivSpbx5UQ9qgmujKzgu NnWTpLY80/UFs8SAUEBLLxMIiVczzQ+iU6QRk1ksLMsb99zF+ifqBbY+qryKRzXlnENO VAfmYtFIRRQDTW8Yrs6UENPQ6w9fQWlQ6dAOx2zgIxhLANluskFsVs67k3cP+3+BTvBA LgeAU1eZ3Q+ocKS62yYFpAhCLA70LyEZdRAZQx6nuvpPWPJpRxbgAjRJDqyiGtUylOPm ZCru2H9eydaN38FdeH0wBkFAFLvxXxxMQxKWsCorDdDhc6VBaCqNrjUB7k+u4e1sacM1 LrqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=GeBUNt6iKyKVMJSNccGv5u8JOw8oNIwF9ROYFrWs1lE=; b=U+9kgQ9eIzs/z2BZmar8OSfetzG7dKdfh/ztogv1qSJR/WSTKYZOLywv2Md/fn3our zOSxleqxMZc4zcmvqdOpvTYmR2gbao5IeOv8t7ckKEcEj3ORzxGJgHLAGr435K04daMH d72wFGukvD/Wn2C98kM8t/58Ult2vpP6GttgTd9B2U8VSyoinc3LoONGXSEE2ar68iQW 4WaZwVBOA8XKLx5d585LqVKytTd2qDBO7h+X7exG2RYarwoxOu37CcoZvDJZOuhl9Gtc f5wvPKJC6BIFhco4ymkwq0vN9AoannYYsTuJmxEfESopHmQkaxQqfs3hGCjXkIZPs4t8 Q1tQ== X-Gm-Message-State: ACgBeo1CDCaoku/csgenZkGvkKJaqfFjFin46IaSizMFCuVm9U8HoHAm ZWYcHD5eIii2ls/gb/MECzlES/jKBCcdQ+/+ X-Google-Smtp-Source: AA6agR6tiJC1rmPcCLUUwaBgsmPk3YCf2zQZ9QkGf5dpF1S5Zn7EcATRPlxTiKvKKhQoxj55DgpmYQ== X-Received: by 2002:a63:f74c:0:b0:42b:77c2:ce7c with SMTP id f12-20020a63f74c000000b0042b77c2ce7cmr8962778pgk.473.1662658779211; Thu, 08 Sep 2022 10:39:39 -0700 (PDT) Received: from ghaven-kernel.yocom.org.beta.tailscale.net ([2601:600:8f80:973::5f]) by smtp.gmail.com with ESMTPSA id x76-20020a62864f000000b0052d4b0d0c74sm15166767pfd.70.2022.09.08.10.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 10:39:38 -0700 (PDT) From: Nate Yocom To: dmitry.torokhov@gmail.com Cc: nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com Subject: [PATCH v6 4/5] Input: joystick: xpad: Add ABS_PROFILE to Docs Date: Thu, 8 Sep 2022 10:39:29 -0700 Message-Id: <20220908173930.28940-5-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908173930.28940-1-nate@yocom.org> References: <20220908173930.28940-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add ABS_PROFILE description to Documentation/input/ Signed-off-by: Nate Yocom --- Documentation/input/event-codes.rst | 6 ++++++ Documentation/input/gamepad.rst | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/input/event-codes.rst b/Documentation/input/even= t-codes.rst index 8741d390b184..b4557462edd7 100644 --- a/Documentation/input/event-codes.rst +++ b/Documentation/input/event-codes.rst @@ -235,6 +235,12 @@ A few EV_ABS codes have special meanings: BTN_TOOL_ signals the type of tool that is currently detected by= the hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH. =20 +* ABS_PROFILE: + + - Used to describe the state of a multi-value profile switch. An event = is + emitted only when the selected profile changes, indicating the newly + selected profile value. + * ABS_MT_: =20 - Used to describe multitouch input events. Please see diff --git a/Documentation/input/gamepad.rst b/Documentation/input/gamepad.= rst index 4d5e7fb80a84..71019de46036 100644 --- a/Documentation/input/gamepad.rst +++ b/Documentation/input/gamepad.rst @@ -189,3 +189,9 @@ Gamepads report the following events: - Rumble: =20 Rumble is advertised as FF_RUMBLE. + +- Profile: + + Some pads provide a multi-value profile selection switch. An example is= the + XBox Adaptive and the XBox Elite 2 controllers. When the active profile= is + switched, its newly selected value is emitted as an ABS_PROFILE event. --=20 2.30.2 From nobody Mon Apr 6 08:13:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE1A0C54EE9 for ; Thu, 8 Sep 2022 17:41:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232238AbiIHRll (ORCPT ); Thu, 8 Sep 2022 13:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232137AbiIHRlD (ORCPT ); Thu, 8 Sep 2022 13:41:03 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AF6B2D1F9 for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so3211000pjh.3 for ; Thu, 08 Sep 2022 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=LPhRLaWef+Hz3zJYtHqHes7JAiIwNYbeVpUYbArIE2g=; b=Ucysblj0jQtpYnQ3v4BxSFf8awFsQO6SNWAv27Ne5Oaf1DVywieh6hyvVkdIn1GaIt J99PU5di1sfx7L1oA3hG5OBNxGXRU44BmfT/0uV3FKolG3WIiTpCJ2985G+uu0BPUTjq 99CTwtQXPny/QtEkocGOjR/kUH5HDV9fhp8tOQgH8EP1WEXlDVkLYFWeqdF8xLmuIXGA nOXSAVNfey+oqypYxI1/yb9ACm4Z8qhI0JmAfqWt0embyRDuI+mdVac83oO6gJ1FtODG F9yurCeAAOV23J/Oa4RxRZhSLamYvPoEMdunO3z3JnhdAnrW22M3E/CYhgTVNpWuHeo7 YYZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=LPhRLaWef+Hz3zJYtHqHes7JAiIwNYbeVpUYbArIE2g=; b=rslAGuE/fQzpGFfe+QNeWeJKDu4eBR5T9UGNRDzE66ypx2jOZEh9AUeowmfZZfAcwJ UmoE3Qz86OPMGYpSR60dIOLqQzJQWjdBAoDSELHyXnlpzfUzKIDrkaE02YlXwTu7j7S3 KSYDskT/7ipmapklDNyjphmUj6M6cRS1zyy4B+HmWueSeosCHA8BMoaudrhCifB/Og8l bYyvKFOMvCnQiCcuDzq/N3USrVXFfAbYl8OX1zketuQdyzs4nZZYknH+fMSQQ/Was/eh fjE+8oAyMW/Lb+COvLgNx5BVmMPGAJggxU0ldwYHw0GUccyM52MgQ9Munq7IDZm0Ktwl CNKA== X-Gm-Message-State: ACgBeo3ufpC6LobrrdxExX2kDBe+hg6MgRmCHw6Zx8LgTLV/mWdjuYXu c8624iST09yqhMph6B0Cn0+3ew== X-Google-Smtp-Source: AA6agR5zSanZ9Zsj5sMjjDtbnqCwGnovjeUHi7EGp81MgWKH1PNLzfe7cG5tBpWWgfLi0ZKTnMEKsQ== X-Received: by 2002:a17:902:c951:b0:176:d421:7502 with SMTP id i17-20020a170902c95100b00176d4217502mr10059051pla.72.1662658781195; Thu, 08 Sep 2022 10:39:41 -0700 (PDT) Received: from ghaven-kernel.yocom.org.beta.tailscale.net ([2601:600:8f80:973::5f]) by smtp.gmail.com with ESMTPSA id x76-20020a62864f000000b0052d4b0d0c74sm15166767pfd.70.2022.09.08.10.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 10:39:40 -0700 (PDT) From: Nate Yocom To: dmitry.torokhov@gmail.com Cc: nate@yocom.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com Subject: [PATCH v6 5/5] Input: joystick: xpad: Add X-Box Adaptive Profile button Date: Thu, 8 Sep 2022 10:39:30 -0700 Message-Id: <20220908173930.28940-6-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908173930.28940-1-nate@yocom.org> References: <20220908173930.28940-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Adds a new quirk for controllers that have a Profile button which has 4 states, reflected as an ABS_PROFILE axis with 4 values. Signed-off-by: Nate Yocom Tested-by: Bastien Nocera --- drivers/input/joystick/xpad.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index dff0d099d416..ece38f00dfff 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -80,6 +80,7 @@ #define MAP_TRIGGERS_TO_BUTTONS (1 << 1) #define MAP_STICKS_TO_NULL (1 << 2) #define MAP_SELECT_BUTTON (1 << 3) +#define MAP_PROFILE_BUTTON (1 << 4) #define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \ MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL) =20 @@ -131,7 +132,7 @@ static const struct xpad_device { { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, XTYPE_XBOXONE }, { 0x045e, 0x02ea, "Microsoft X-Box One S pad", 0, XTYPE_XBOXONE }, { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYP= E_XBOX360W }, - { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE= }, + { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", MAP_PROFILE_BUTT= ON, XTYPE_XBOXONE }, { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTT= ON, XTYPE_XBOXONE }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 }, { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 }, @@ -927,6 +928,10 @@ static void xpadone_process_packet(struct usb_xpad *xp= ad, u16 cmd, unsigned char (__u16) le16_to_cpup((__le16 *)(data + 8))); } =20 + /* Profile button has a value of 0-3, so it is reported as an axis */ + if (xpad->mapping & MAP_PROFILE_BUTTON) + input_report_abs(dev, ABS_PROFILE, data[34]); + input_sync(dev); } =20 @@ -1623,6 +1628,9 @@ static void xpad_set_up_abs(struct input_dev *input_d= ev, signed short abs) case ABS_HAT0Y: /* the d-pad (only if dpad is mapped to axes */ input_set_abs_params(input_dev, abs, -1, 1, 0, 0); break; + case ABS_PROFILE: /* 4 value profile button (such as on XAC) */ + input_set_abs_params(input_dev, abs, 0, 4, 0, 0); + break; default: input_set_abs_params(input_dev, abs, 0, 0, 0, 0); break; @@ -1715,6 +1723,10 @@ static int xpad_init_input(struct usb_xpad *xpad) xpad_set_up_abs(input_dev, xpad_abs_triggers[i]); } =20 + /* setup profile button as an axis with 4 possible values */ + if (xpad->mapping & MAP_PROFILE_BUTTON) + xpad_set_up_abs(input_dev, ABS_PROFILE); + error =3D xpad_init_ff(xpad); if (error) goto err_free_input; --=20 2.30.2