From patchwork Tue May 31 22:19:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cameron Gutman X-Patchwork-Id: 9145737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC9C260761 for ; Tue, 31 May 2016 22:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D04F626569 for ; Tue, 31 May 2016 22:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C50D9265D7; Tue, 31 May 2016 22:19:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 691A326569 for ; Tue, 31 May 2016 22:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756496AbcEaWTy (ORCPT ); Tue, 31 May 2016 18:19:54 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34600 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756487AbcEaWTx (ORCPT ); Tue, 31 May 2016 18:19:53 -0400 Received: by mail-oi0-f67.google.com with SMTP id r64so251662oie.1 for ; Tue, 31 May 2016 15:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=dYewkU5X/kIwS76Cz/mljeJKmYKffQ+DM8AikaFO8/k=; b=WAQDVrb0JoN+BexSrCbjeIYKnR50CK456XdCGIF6QR2btiwNQKvN6pSEIh1ZH/yEN2 B4xc9SCiL/+y1QjDztCj2e2dafAP3dvQqAtn4yaq3GxVNZZZh+ZBnut1/KacKFTifcBM 6jKtfbmW5pC4Ydz/AtTV7A7beHEhvMzyB3znxW4ureqq8Dj7YNPzkmTb4ACrUkaioQWa XgxD24AZuT2PYm+aTGa5OjzIPUdroknsFg/h4YDCx9Xb2C0GQIY8GdTMUtlkjRkl+A6e 9VdfcOD6898NnHKbrA3X/Ls4PmbQ31ZI9O/98N3mOMFMIHrKbp3g/Ppchys4wmuyjF3k 4ZMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=dYewkU5X/kIwS76Cz/mljeJKmYKffQ+DM8AikaFO8/k=; b=WQdIezfmEDWJbkSl9zIRP1d1J5Io+YZsgDGD6BPXTqTn4i61WWLr1gLJ0gt/WC54hs I8GbX9UeQtzhMpn37+f4w1YYkxhdyRsJoJuIRHRWqNXYXOQ4nnGzeA9Tzv74J0puZaLr y4yBTy5cXegXwxExGLpg4AeD/Vn9bgRgYK242xJ9Um3X06DOABbXYDGY6+VXpt/fgilb lzbzi3LLv8VnUjXTiey7H08iC9+j5LhtdMoSMl/YUt0T2KbcLnfWxBgnFBW2tRKijR0i R8ADND7NfMqQlgECl/F4DMUwEvQw+9IsUKAc+FpXpBlQThDO96vKhjGVMYuUWpx/sSzv ZeZA== X-Gm-Message-State: ALyK8tIxFvj4ytcXgG+uLCOKg1IVDiWjBskMezumyxTFf0u3qO0FXxpWaj4xRaP85P/pMA== X-Received: by 10.202.229.1 with SMTP id c1mr19363012oih.180.1464733192847; Tue, 31 May 2016 15:19:52 -0700 (PDT) Received: from ?IPv6:2601:2c6:c000:f778:6c0a:c165:f76e:80a8? ([2601:2c6:c000:f778:6c0a:c165:f76e:80a8]) by smtp.gmail.com with ESMTPSA id s65sm19555595oia.22.2016.05.31.15.19.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2016 15:19:52 -0700 (PDT) To: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: rojtberg@gmail.com From: Cameron Gutman Subject: [PATCH] Input: xpad - fix rumble on Xbox One controllers with 2015 firmware Message-ID: <574E0E07.9090303@gmail.com> Date: Tue, 31 May 2016 17:19:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Xbox One controllers that shipped with or were upgraded to the 2015 firmware discard the current rumble packets we send. This patch changes the Xbox One rumble packet to a form that the newer firmware will accept. It is based on changes made to support newer Xbox One controllers in the SteamOS brewmaster-4.1 kernel branch. Signed-off-by: Cameron Gutman --- drivers/input/joystick/xpad.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 804dbcc..923c572 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1031,17 +1031,17 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect case XTYPE_XBOXONE: packet->data[0] = 0x09; /* activate rumble */ - packet->data[1] = 0x08; + packet->data[1] = 0x00; packet->data[2] = xpad->odata_serial++; - packet->data[3] = 0x08; /* continuous effect */ - packet->data[4] = 0x00; /* simple rumble mode */ - packet->data[5] = 0x03; /* L and R actuator only */ - packet->data[6] = 0x00; /* TODO: LT actuator */ - packet->data[7] = 0x00; /* TODO: RT actuator */ + packet->data[3] = 0x09; + packet->data[4] = 0x00; + packet->data[5] = 0x0F; + packet->data[6] = 0x00; + packet->data[7] = 0x00; packet->data[8] = strong / 512; /* left actuator */ packet->data[9] = weak / 512; /* right actuator */ - packet->data[10] = 0x80; /* length of pulse */ - packet->data[11] = 0x00; /* stop period of pulse */ + packet->data[10] = 0xFF; + packet->data[11] = 0x00; packet->data[12] = 0x00; packet->len = 13; packet->pending = true;