From patchwork Thu Sep 8 17:39:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nate Yocom X-Patchwork-Id: 604091 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 8F597C38145 for ; Thu, 8 Sep 2022 17:41:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232316AbiIHRlZ (ORCPT ); Thu, 8 Sep 2022 13:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbiIHRlB (ORCPT ); Thu, 8 Sep 2022 13:41:01 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B97EBC for ; Thu, 8 Sep 2022 10:39:36 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id l65so18657209pfl.8 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=yp/OibGMd9cs5V3uwGRJPDhcEbgp68Gc+yLr2IKN1shsGiWFT49rqBGQHi1EbF88Np ty1CeqJh6uqV3ogQqpBHu2Sy6Eg2l0Wn/JdgBqo4kfD0uo/dpVv26YxkEqr6p8u3gEeW qPOUU7BNd82at2ldeou4EgQmRG0t9UJ/PFjiQ4U0PxJu7lVpG2ldbRdzByQOhbDZIirR TkNqrJ+BTLljZaOoPqpcPucirDZbrNg0G91HzGnPhUpCkqGJ/JrkOQsl6OcedNegS42G tmmPq/6dhcEPIWbaxBcrgvZuWAqSYlkuyZYu/VnWlLH0JsOsmlhIEyny4ZAdTAtekRWo 2Qbg== X-Gm-Message-State: ACgBeo3FiJdfYGWco1UFQ+1Cfuwp9vEbGcpHMEPe3niOUJhOjk/ReyFd oVY+LnvbphoRVEqXsWNYU3x4tA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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, XTYPE_XBOX360W }, + { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE }, { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 }, { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 }, From patchwork Thu Sep 8 17:39:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nate Yocom X-Patchwork-Id: 604092 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 ED10CC54EE9 for ; Thu, 8 Sep 2022 17:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232257AbiIHRlN (ORCPT ); Thu, 8 Sep 2022 13:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbiIHRku (ORCPT ); Thu, 8 Sep 2022 13:40:50 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E07982608 for ; Thu, 8 Sep 2022 10:39:37 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 78so17401171pgb.13 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=0Ep1vI1N+4UD9OHDE7rA1LRmcw00+kotOV9UXQEnOJJEXQ+dxd72qWjz0dZgBOd+ZC m2XnmyVr415sSL7fgRaDkw5qCZ0FF2JQ+wuALIAiPRITNqhDxqORiXvkdX4KkxJD/4BU HJef2IC+Ss2CBATh/Puidv+Dfc63Rt+0LHC07/CQfTkWvIfqu49ZhRNbebz900fIj763 6wKW1afPNmTqk9b9C4LN26lT/KqUJnNWtc6FM3bGmoJWTiMfuUD+9n+lcXeWCNotUXP5 Oa02u0o8/NOuXanxPSCRanYSDohK2wBL71SqcJ1vwfHCtnNnEQZWJ9Ti5JzGH4w+HPoz fpZQ== X-Gm-Message-State: ACgBeo350msMlHMjUxA5N/liGCn7neynXI6uZ5DVC/QpNZDfbiWwnbtf uhZfw5oi5kARErQlJIRZbWaimA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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-Patchwork-Id: 604435 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 BD764C38145 for ; Thu, 8 Sep 2022 17:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbiIHRlT (ORCPT ); Thu, 8 Sep 2022 13:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232070AbiIHRlA (ORCPT ); Thu, 8 Sep 2022 13:41:00 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A45A02A42E for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so3029076pjq.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=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=Lxrp6paN/qgw7ULmmytXE0EV4jXJXs5VulT30l/0hwaVqwWFQ1tauxJk1mtlo9xbJW 0pdDzbJ0cgDPIUbgryhyklH1aEw5ya0bVNDHkvi9FOEfFOatucZONvDfBcnmEZTKy2He OdBt8cqr+fGGxb+HJcC9+j5wioj8Ny0/S6OXXwzdWGyGbYrLW8AJmKS6CgVSm9Ui+d9n 4Pop7zcJMtgnpgQlEDp4yUmgD88QjqLejkxZKy0T6g4eBEe6iMOssxzUJNJMGPFh+uoS Ng7ddEJxhPi8CSHFBDoJSHeewjPzwIfx2o5Y37aT+h1YTRapMo/UitjILsrA084+j6hH xdQw== X-Gm-Message-State: ACgBeo1KDYH1Y3ZAr/hBOKxUg09qPg/qlVmuomUPyPqdV1QqBoVAiUsG pgYi8eH2YRLx3TatC3i5FiDM0w== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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] = { [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure", [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth", - [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", + [ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile", + [ABS_MISC] = "Misc", [ABS_MT_TOUCH_MAJOR] = "MTMajor", [ABS_MT_TOUCH_MINOR] = "MTMinor", [ABS_MT_WIDTH_MAJOR] = "MTMajorW", diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-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 #define ABS_VOLUME 0x20 +#define ABS_PROFILE 0x21 #define ABS_MISC 0x28 From patchwork Thu Sep 8 17:39:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nate Yocom X-Patchwork-Id: 604090 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 E87B7C54EE9 for ; Thu, 8 Sep 2022 17:41:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232358AbiIHRlj (ORCPT ); Thu, 8 Sep 2022 13:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbiIHRlH (ORCPT ); Thu, 8 Sep 2022 13:41:07 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46312A708 for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id q9so17426611pgq.6 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=OS5QKu1CphxtJP4NmQulKnMraSm3AvpSzboznySKOfQxifg1JQqSIeHX6qx+M5MiZN FScSnEuGz+DD3xISCYOu0JslmCV74UwbT/9r1ZMyZVOE+1AlnX1niHDxH2m4u+sOUQZs 6TYzBPsYM2HrfR4KKajxBvsN5bPqt7PRMNeECeP20bADr7PMPDwen2FHFWex73YTq14f rXiYUIN58aha/BSC0eq6mbhvZi0r4rzCVX1Xk37FArXC1ASWSEH1VibwMmWkXhlsMTFa wZuerqer0MMJTeOCRizTdB1JWZ+VDycisw8CEiAhm7QVjUrBPe+/KBikIY1wZnJD2ZMK BKRA== X-Gm-Message-State: ACgBeo0vFnZbEaqTIOBjTS8d/eYLfZCcKHTEK1Ox5mH0F4te9MNVZ0Q4 vKyiW+6M7xjf7fmIAJWlDfMNUw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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/event-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. +* 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_: - 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: 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. From patchwork Thu Sep 8 17:39:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nate Yocom X-Patchwork-Id: 604434 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 ABBB1C54EE9 for ; Thu, 8 Sep 2022 17:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbiIHRlb (ORCPT ); Thu, 8 Sep 2022 13:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbiIHRlD (ORCPT ); Thu, 8 Sep 2022 13:41:03 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B3F22DA80 for ; Thu, 8 Sep 2022 10:39:44 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id s14-20020a17090a6e4e00b0020057c70943so3056196pjm.1 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=kRNHixcxS7u/8Ti1YbQkwYj9bUKfNTjRZLriL2Sx/RVidCCewGMi6XR0umjh3EBlK2 8Q5SoqREwWj25CyyJ+tP9/qYPXJ9EVQXzA0VvlBc6otnBjYduWsJE5WIQWl8YdkX292U WUFY2mRvRXGbeduWM1KOAzi0YIKKwndGH7yd5sR2osxa0P6IiAqub5LymONhX4kBul5S FmufxWOFwrAiIUne6bpQ7inIezSophPj+5YKyV+d+Rf91aixAqRcm6FX3Lh2c7enF7yA WDhyRSwkE1Z6eZdXMugmNLZB5V6eJ1cSIbjaz1faxZgtqwxYld+i6m8Mzr7YLPE/KBpR FAQw== X-Gm-Message-State: ACgBeo3GcdsoeHlIl/Q9hat4s9oawTw9BXp4iajF9Fid9hqpfWon/BVF F6tNPxBthbrsnPv3xaXhQZoWjw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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) @@ -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, XTYPE_XBOX360W }, - { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", 0, XTYPE_XBOXONE }, + { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", MAP_PROFILE_BUTTON, XTYPE_XBOXONE }, { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, 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 *xpad, u16 cmd, unsigned char (__u16) le16_to_cpup((__le16 *)(data + 8))); } + /* 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); } @@ -1623,6 +1628,9 @@ static void xpad_set_up_abs(struct input_dev *input_dev, 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]); } + /* 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 = xpad_init_ff(xpad); if (error) goto err_free_input;