Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2572102imu; Thu, 29 Nov 2018 07:04:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/VoMRX2j17NQVb6wbK/rhgv3oMPiXfRAP7SFvyNLMpdxdmY8opq/oolH/qEuEWhxV/yE5te X-Received: by 2002:a62:5f07:: with SMTP id t7mr1720946pfb.108.1543503898568; Thu, 29 Nov 2018 07:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503898; cv=none; d=google.com; s=arc-20160816; b=0STwJD7E01g+24q0tdNn01gk50WGjuPVYGnTKi/M8KuAN/eacG6gPyFMcbcKL50ozM GHPw7uFyD1HUj8hyrqSy6PfafFU4JHxnPtS4IeL3gDe71mraK5A4UJ0ShFgE4hMau7fd odzRcB+/XXP7QP/AYilawsnoSR5NBwPbXGEKmJ5ibL8KP8xUqPrsr13y9tY/MVCuNH4k DTiKDM6pLRmRJ0YiM4jgMMRI8DaRLgD090qJLjflzGCXQXpSl8vtMzsyd4KwPq+/6FSj olYGtQvJEX5yk2B6ousIbwQU/YbPgcjyz9i6njPmmSb67F0kvnRUuG3osBjrMoDW08Iq 68Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zQLASNn6nOIhDK4l4Nmr3C+lfMuSpwUdZG9rcdQapQ8=; b=S1TRRRrwuvvcvEkoM6pi9+Y3oMI7rSAxHVRpy7i3BbncZLn2Of0y2Tu2n4W0PUP5Kb 5weGG0nGgQY+n5utuYoVrpStOXmgTVW+4kVGg1MgbQ4CEt/9LlLYESw9PZBMZmR9HezN j5k/Q42T/krVzFo9exA6NUSOpvTG8awkuxsqLJBH87faPViyFouanigODy6gGknAed4Z PyQQwfeL7Fh3/ZYlF9PC7CMpOvtnowWw20KCWDxc34k4UMrAq1jk+va34uHBpJsk/7uN eONSAI1/za5cuFGT9CMWCD8J3DXNoFWbso2gGWaPgLRSsAIqKpUY3YkSOb2CzLQNx8++ 0iaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xE4pIhK4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si2311335pgj.142.2018.11.29.07.04.42; Thu, 29 Nov 2018 07:04:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xE4pIhK4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730755AbeK3BX7 (ORCPT + 99 others); Thu, 29 Nov 2018 20:23:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:46432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729264AbeK3BX6 (ORCPT ); Thu, 29 Nov 2018 20:23:58 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1BD2205C9; Thu, 29 Nov 2018 14:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501107; bh=HryfOlS5AEHzQed8ci782kS8CL293NrGL5ErhHC6KYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xE4pIhK4uJKx49S/vWim1mZ//WD+01Lh2Hl8rw7h8xNvkfU7Q6/ItSadukWEwSEDn DQIwxcjazToHBDlJvmyp7+VdJoUk1nOrzue6/u8XTdtslxGugGAdDElnEoI2zroUC6 f31c6riwjg8Ovi/mR0cbkCN4n5YZ7Es/YSMmam0o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cameron Gutman , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.4 46/86] Input: xpad - fix Xbox One rumble stopping after 2.5 secs Date: Thu, 29 Nov 2018 15:12:11 +0100 Message-Id: <20181129140114.111315924@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140109.832117862@linuxfoundation.org> References: <20181129140109.832117862@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ae3b4469dbcd3b842a9fd20940946e4d092d8731 ] Unlike previous Xbox pads, the Xbox One pad doesn't have "sticky" rumble packets. The duration is encoded into the command and expiration is handled by the pad firmware. ff-memless needs pseudo-sticky behavior for rumble effects to behave properly for long duration effects. We already specify the maximum rumble on duration in the command packets, but it's still only good for about 2.5 seconds of rumble. This is easily reproducible running fftest's sine vibration test. It turns out there's a repeat count encoded in the rumble command. We can abuse that to get the pseudo-sticky behavior needed for rumble to behave as expected for effects with long duration. By my math, this change should allow a single ff_effect to rumble for 10 minutes straight, which should be more than enough for most needs. Signed-off-by: Cameron Gutman Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/joystick/xpad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 4dc8befc92e4..b9f48d4e155a 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1047,9 +1047,9 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect packet->data[7] = 0x00; packet->data[8] = strong / 512; /* left actuator */ packet->data[9] = weak / 512; /* right actuator */ - packet->data[10] = 0xFF; - packet->data[11] = 0x00; - packet->data[12] = 0x00; + packet->data[10] = 0xFF; /* on period */ + packet->data[11] = 0x00; /* off period */ + packet->data[12] = 0xFF; /* repeat count */ packet->len = 13; packet->pending = true; break; -- 2.17.1