Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2560547imu; Thu, 29 Nov 2018 06:55:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/XN9IDniflCZf+HXuhNSgDnkFeMNTDr/QyzQC/hwrWvQ21/wEWygikruN0htmTFjxfsaKhA X-Received: by 2002:a17:902:45:: with SMTP id 63mr1699032pla.272.1543503343247; Thu, 29 Nov 2018 06:55:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503343; cv=none; d=google.com; s=arc-20160816; b=sRqCAq0vZCYKLQARisdaKLG+dp2E1YDCZjDENG3QbukclujH7exmLX2CRt5K6hQbY7 XmcVlYBqWlOWKcCxYOmX1bjYpozxcMyp9ArRAUlKdtv408jTWk94dCso6y4OI6GRni2p KNtzyy44NZcBfM2NK/dnlQ8+VJfwtNfS892VEfUciR/apV5phSryweqiaBsRypRB1GnJ 6HB5UZ1oK2eEq5iPrictZ9YMML3woDRhKrKuYuDEH/0qCcjF9byBoMW9HnQOFPuJX5Hw ALrl1HUc7ftcEmKjPo7u4oSoI0jd1b2/IIZrMluimcjCRFfoQ73LNdYKdgn8E8S1+QSi tSLg== 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=un2lB2HvL1vLWTUVpNSo9ao0Zn0IY7ARQOxxy8zyrJo=; b=oMroo2MJrlQJn2j1vjWBrmHMBOcqNsILBadNojK6j7lq5+GAtLdwl4wFqWNko7KRka 1YvrVmcSUJdxzOv8fQIfRNP2f4c0cs/gQDtKcEqol9bkHOwDm/fQLa9ecMN4N8F1KfPe 4V+ve+4/WDc0qbyZ7KMJElJFAlOCCQ9k8Zm0ByZU5DrUR4SKvmk9+sGjiwb5dvIhYRab gT5n+82ldGE+DeXqUBgu/n6SV8ClVNrsQK4liHoNvpbNEXSXAyKBo3QQRNURTGw0QkhE dz59HHuFPLuZpTCeqzVoizlGrnxinZ8KJDKcTtUwnA1VhwCkfx1ayCKcE8o6NcaeIIRb 0Kvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C7+h7nae; 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 t1si2175465pgj.542.2018.11.29.06.55.28; Thu, 29 Nov 2018 06:55:43 -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=C7+h7nae; 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 S1731907AbeK3B1q (ORCPT + 99 others); Thu, 29 Nov 2018 20:27:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:52948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731263AbeK3B1o (ORCPT ); Thu, 29 Nov 2018 20:27:44 -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 C75A820868; Thu, 29 Nov 2018 14:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501333; bh=PwCDeyFKUN2P5joldKnl8LJwAL1c4hpFQgfbtoZK790=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C7+h7nae2t6uAoL+n+Hb4a+sRqbv9eVq6hawxP5pls7TP+0TNb0pJ8z07B2vvRo2a uXeQJUK2rNv2E/PtsdpG0adXJJfb2aA/4oPgbiAlMbQs+UEeaffijk4DXEPLCGwJco ru5YNHzDWYpr5GMNLEtYrgECo/5SvLZoW4si0e2g= 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.9 47/92] Input: xpad - fix Xbox One rumble stopping after 2.5 secs Date: Thu, 29 Nov 2018 15:12:16 +0100 Message-Id: <20181129140110.197000956@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140106.520639693@linuxfoundation.org> References: <20181129140106.520639693@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.9-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