Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp906030rwb; Sat, 13 Aug 2022 11:21:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4oaLS4Wxz1+u3Mj7bO6z+Nc2mq97j7CGLT0Qm1q03Z1jcpkzysDDdcpjvZ76ybzdqHppnr X-Received: by 2002:a17:902:d890:b0:16c:abb4:94d0 with SMTP id b16-20020a170902d89000b0016cabb494d0mr9737073plz.50.1660414893673; Sat, 13 Aug 2022 11:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660414893; cv=none; d=google.com; s=arc-20160816; b=KHB4x1bO3qX6+RsJcmjNQXAi/JrkfuZV2A2zGCD/LggfqVtlXZhCtPGmKIN62Bi69z 1mJ97WainKWMmvaNpH1fFmRLw+wmZBV4tPvLQ4rKooxzefbNXPBSW6n4dkkl6zb5y4YP jsW4SoQt6OBmKT+7ogf8Zf1P0iZulIAKbAsQPz0WONg10TNbMoqA5ewaHS+QIZPei8ny QxQhwMB6F1j4seGR+DEEX/mIe9wN85nwX0naB52x9URY8iZkebKqHjCBJ19wu1Owwqx7 N7B3o+/kYY/ZZdsQg3SCfEKq9EADPueuKLqSfMnmOt6/UrQ0ttONna+5jY/IZ4aHEHA3 6umA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=7XLOg7bvUW6JPcCBSsbLMyM4207tH84mqtU1IP1whts=; b=FjLfEIjf6j7AZCukmIQ7sP1/ZxRpz/Kb+xNwjyeV28MTYugfSxFzXNRyiipwP1jpc3 kQSVAhVEpRb2ZhPDT0kU++dLxmd8NXZIDZayJZJIWbu2Z2wTVXGThgiRo+lxndNVE1vi xTXcxKRzsEOWODbtvbNl49wjHCjLgIOpbDswfA8B6LoIeggokr0A/sF4jif77zKfb25j U0cMXy5dV1GSYb+qezBxmgtLnfA1GNRx96veVbaRrzw1MmSXOp94wXJZJlGY3TSORA7t RkKM+kB1B/pmTYy9swzX+DN5TbvWj+3O6s+t8XigVkbaPGRMWAbRt+JBUTJZrSOonpEo b7uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yocom-org.20210112.gappssmtp.com header.s=20210112 header.b=kZ4wInc1; 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 z15-20020a17090acb0f00b001efec8a14ecsi5323722pjt.99.2022.08.13.11.21.10; Sat, 13 Aug 2022 11:21:33 -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=kZ4wInc1; 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 S240031AbiHMRJx (ORCPT + 99 others); Sat, 13 Aug 2022 13:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236482AbiHMRJw (ORCPT ); Sat, 13 Aug 2022 13:09:52 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532A4A180 for ; Sat, 13 Aug 2022 10:09:51 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id x23so3189568pll.7 for ; Sat, 13 Aug 2022 10:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yocom-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc; bh=7XLOg7bvUW6JPcCBSsbLMyM4207tH84mqtU1IP1whts=; b=kZ4wInc1V/RMdb+gVDm/QK2Kb3SFAB+pFbbjnLPevRr21TrNpbDWP4OCCPLPr5kVYM Kskpz8UZHS8+ZhEH3Dmg36m5LWBVtiaXJZ18Guk5rJsz6ZngcM9ge+zHQZIe1wHaIGo5 xHoASiIADKyNleB8CG7rg0OdyMBswUXFlWj2xqLMspwlXVPiZ7ElEBTPonFvBoKTo59F dBnM4/M3hr/LUceAY8MFsf8VrWerRAnR9d61dBDpzXUAMjXBCvobRDFeO5wOVxXSdrC7 k8LBjrzsRMoa5Qy+0klmUj8Pdrvn80du/AYRhL1s4GBTcJpngnd+UHSffCZIXoGNVgbv RTLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc; bh=7XLOg7bvUW6JPcCBSsbLMyM4207tH84mqtU1IP1whts=; b=W5/SEp0Y5NgociTq40UoEWJ4UDDx4Ka6GIg9nnzA8Lf+w9UlM+ggN5kjNG0Lu0uzDV YqjZydsgW7jIywZZZXP4usFbfc5uyashhaJVMYL6qtZgfG7vZ74L47yLilDsH+qo8Gf5 XsrSkYgfUwgLBjdzJtkPWU0M1bfk0LFU8MH4rEb9CkjYZMKnM0lDNL6UIW5A6KvEhW4a ctKDY8zWMY+2S6YuWrl25g/4Yb5n/+9FxaHtqstnXowY38HiVCOqun+c5xj/SOTCQ+ut e7RfM/3cIIoIZ1n3iDzlwBZ8Ar56KC4TsBzbUncQ31V/Wir3AAw9n1VLdGO+NvT3fsUD 8WMQ== X-Gm-Message-State: ACgBeo30eUgAjU5odd2getmpv5dR0YE9AlPBNIm54DCAuf5XjRO3/eov ymD5P3Xl42NAiWVJztaKs58XyV2uN93cmA== X-Received: by 2002:a17:90b:4b0c:b0:1f4:ffac:699a with SMTP id lx12-20020a17090b4b0c00b001f4ffac699amr19436548pjb.145.1660410590729; Sat, 13 Aug 2022 10:09:50 -0700 (PDT) Received: from ghaven-kernel ([2601:600:a07f:e6ac::1c]) by smtp.gmail.com with ESMTPSA id v13-20020a655c4d000000b0040ced958e8fsm3234918pgr.80.2022.08.13.10.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 10:09:50 -0700 (PDT) From: Nate Yocom X-Google-Original-From: Nate Yocom Date: Sat, 13 Aug 2022 10:09:48 -0700 To: Bastien Nocera Cc: Nate Yocom , dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Input: joystick: xpad: Add X-Box Adaptive Controller support Message-ID: References: <20220810141511.11827-1-nate@yocom.org> <32f116c30f1f071d57e8e2d15425178cbccf9b70.camel@hadess.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <32f116c30f1f071d57e8e2d15425178cbccf9b70.camel@hadess.net> 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 On Thu, Aug 11, 2022 at 03:19:50PM +0200, Bastien Nocera wrote: > Hey, > > On Wed, 2022-08-10 at 07:15 -0700, Nate Yocom wrote: > > +               /* > > +                * X-Box Adaptive controller sets 0x02 when x-box > > button is pressed, > > +                * we could probably condense into just data[4] != 0, > > but explicitly > > +                * checking here ensures no regression if other > > devices set other bits. > > +                */ > > +               if (le16_to_cpu(xpad->dev->id.vendor) == 0x045e && > > +                       le16_to_cpu(xpad->dev->id.product) == 0x0b0a) > > +                       input_report_key(dev, BTN_MODE, data[4] & > > 0x02); > > +               else > > +                       input_report_key(dev, BTN_MODE, data[4] & > > 0x01); > > > I won't be able to test the patch until next week, but I would actually > implement what you mention in the comment as a separate patch. This > would avoid having a special-case for a specific VID/PID without a > quirk like "MAP_LAYER_BUTTON" defined, and if it were to cause > problems, it would be straight forward to revert. Thanks for the feedback, should I make this a series of 3 successive patches then? 1) Add the device to xpad_device[] 2) Support the Layer button with MAP_LAYER_BUTTON 3) Support the X-Box button (as suggested in the comment instead of VID/PID checks)