Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp946803rwb; Sat, 13 Aug 2022 12:23:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+v1wIGN6771uYmGEofoH/3m/fivDIJJCsw7h4MQ22sP6ue7guXA6zESE5/ZBn3F0G3wYM X-Received: by 2002:a17:907:8a09:b0:731:610:ff8d with SMTP id sc9-20020a1709078a0900b007310610ff8dmr6143509ejc.399.1660418624052; Sat, 13 Aug 2022 12:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660418624; cv=none; d=google.com; s=arc-20160816; b=AoU40a4dphZvrhSnYjACJYpm0yXU8KYGlK0OfUGCru1CqajIDKS1gLpNud530EcP7n rUx6PSiWyeNQF52NyTOYBBjYxNT9ZNbLBJyEgLztDpxaX6SnVGYi5tRQWl5EILkpRkMR vpT6NZNnjFaaVLhJbgBToZIaw0S0KSb+5apgUrfDgSy76jJe5I8lf2TbYJ1Je1VGSvzW oJIZ8vV7hVXgjWCORfqQwrJcNnw3Nu+zMg+X0ELiug+TV9tlPnI1LSR6vQnsaGlVXLZe PSyFcr5KX5LOtL4em98owwvY32SjZIbffj9NOTPSbX8wIeiiod6MXZXtVwK16uRiUn2r PryA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mvPdMDyNKTfqz6k1c2rtPVKLvaBKcrbPWc8BVxjdedY=; b=R4E5LpXkLlDWVupr7lB0tb+4q4yapBLZPG2ZC1ZCcxAolwV4S7aQF5VHh2U9mkVKlN NKCZ4liDLO/QGWXQEJR/yQ6Yz7N6cUB3lVltWP99gBffpWeQ8zVXbrrF1Mk5B9QA+567 vuqCWvHGiOcHtaPOVyg3d2RijbwdHj9t8Mqem3t59jirZM2pKcjxrUYWHxd6vZ4l+Fyb R3E7SSAeTLw37TErZtoz/hUfqMJxcUl+K3P4iZhSpAjS4vxzc1Xp+tiXmg6cmvP2GXdH aCx2tMAw8teo5CmFnmsZkNSisshJdSOhgiH2ZwNIW97SEnSq7QNxYhx9Mr97nTA21Oz9 ZXwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yocom-org.20210112.gappssmtp.com header.s=20210112 header.b=4gkEsyZN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz11-20020a1709077d8b00b00731609f6e03si4826294ejc.276.2022.08.13.12.23.19; Sat, 13 Aug 2022 12:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yocom-org.20210112.gappssmtp.com header.s=20210112 header.b=4gkEsyZN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240086AbiHMSyG (ORCPT + 99 others); Sat, 13 Aug 2022 14:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239651AbiHMSx6 (ORCPT ); Sat, 13 Aug 2022 14:53:58 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A321113F0A for ; Sat, 13 Aug 2022 11:53:57 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id k14so3643088pfh.0 for ; Sat, 13 Aug 2022 11:53:57 -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; bh=mvPdMDyNKTfqz6k1c2rtPVKLvaBKcrbPWc8BVxjdedY=; b=4gkEsyZN39qjg2vrgm0H2K6qZ5jK623yHCU69SSOXOhHjIRl+xvIhLQVZSOoFNNSRx EopSx1pg28MtkHxwb0VAcDXN7kVBwsUdOgtrYuUhZoTy9Y4E6s5SeNrADtF/S7XOri/X Brn0zk+x4+1XbSEMX5cAj1U+/cpJHc+YR3FGB9N4rdOgD2ai6UnB3PgCq6RFNIP0nf+M lm1RiCTJTz+9D3xtg2lesy3yXMyZg8s7P4Fg1+oWGm5D9fQPjBuiEFKxpECJJhDIHlP3 nU+uZ9Uk8yp/vUDdIWgfwDnFw3PEaxrTprN3B1gTSxd5Ua66SkC9RAgQOsmYHPNrbo7e LDXA== 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; bh=mvPdMDyNKTfqz6k1c2rtPVKLvaBKcrbPWc8BVxjdedY=; b=tFMS8CPzADJPKcAgQd1/6rEtRg7c12ftK5RfSojZzVDtML1Pak0va6YCzrKurW4LHj jcg+snvXADQ4/7qDYT7TLF3XEX3pzdBs4wEvn7ysXtfeuS8rb34coyVJU+PnYRsg0SSM 9RnbrkvXVABIJ8JRvQ/V5E8BC2L1yqCg2oXkq2Ee8PvQyjbYBhSaNHzpfOyZuXApIr8v aN6CBgn9VU7Xxga6z+102zjLa13IUri9qz1tizQeDY3a3lfyPOmB1MyYpxAdEQ9Hy30r eS1MOnH77h3N4Go7S2n5YIAaPGk6c34jxQrQ9TKdDQw0iVK6ZjWWR756vBIddNT2npUP Hgsw== X-Gm-Message-State: ACgBeo02YuEp4q7IYdMv+FkF4KuZqnC9fUj2KFaf3ta+a2TM7ZRPvYH7 kjI/Ox779wwDXle9+BKDxH9keMqLsBwzKg== X-Received: by 2002:a05:6a00:2352:b0:52e:f0bd:981e with SMTP id j18-20020a056a00235200b0052ef0bd981emr8937778pfj.28.1660416837082; Sat, 13 Aug 2022 11:53:57 -0700 (PDT) Received: from localhost.localdomain ([2601:600:a07f:e6ac::1c]) by smtp.gmail.com with ESMTPSA id fs1-20020a17090af28100b001f246f2a423sm1972183pjb.17.2022.08.13.11.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 11:53:56 -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 Subject: [PATCH v3 3/3] Input: joystick: xpad: Add X-Box Adaptive Controller XBox button Date: Sat, 13 Aug 2022 11:53:43 -0700 Message-Id: <20220813185343.2306-4-nate@yocom.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220813185343.2306-1-nate@yocom.org> References: <20220813185343.2306-1-nate@yocom.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/input/joystick/xpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 83a4f4d07af5..bea71721b6cd 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -859,7 +859,7 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char if (data[1] == 0x30) xpadone_ack_mode_report(xpad, data[2]); - input_report_key(dev, BTN_MODE, data[4] & 0x01); + input_report_key(dev, BTN_MODE, data[4] & 0x03); input_sync(dev); return; } -- 2.30.2