Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5236225ybl; Tue, 27 Aug 2019 01:18:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhGj1AiPLc3shxDRATOFevXdGxVEaQre2WrBhft8nERQ6aHvE47HzrfCML6Z4ST7s2VQ/d X-Received: by 2002:a17:90a:858a:: with SMTP id m10mr24234172pjn.129.1566893880981; Tue, 27 Aug 2019 01:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893880; cv=none; d=google.com; s=arc-20160816; b=V2S9MUCNt/gvX6MKxE2+xNQlu3UKKgekbuVtmL22lmY3gW9yDjEo6usAkJhO6W3JIh lK3XkEljI9gOAfjha8zh3e0rLEktkDDKHwDEYl6bdDqre6jwf7ymdj63EAaKPd1vWeZR HEYHRXFit4veYEH2cwirIWO0VzmEl59zMcVF3GGq55a8fafYL2TRQNcENxuz+zgruJk3 DpW1Va18VoDISzBy0CypxFuri8SQw3rdotfGJjemg9KudFeETgMSCtH7ZOIufUMYxflF irn70sM0ZD80rE0aPmZQrTxk0Jsym2J4wnv4eNOd+5fKp7dcQSruItvT2lda27QpFKC1 MNKQ== 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=az6a/lkZnhBoFYZdb1Bn3FdGN+FxjzmUeCFIP60BZjk=; b=UNpE+dlmGThL7wfg42FDHauI6hCiTxpvWESLHLtlgFGgIx4NTxYrARhAdy/2ji0Z+2 NhajBH6usyxj8//wimHAt2MFirqhJ4YABWee3qLTX3/JDb6uPBp3ue2fXDmUrsCzsLhA 5WrBztD78CZoGNuJWy0JPRic9rWNdDZgSCORKMQDi7cW5mJeoLZPV/mxk8Or7G1xZ/IL k7MxQW/iXKgxueG4filWZzdPs2H68eHPWu1FsmjfJHsbuAfvuzF3NnThx36EN/bcEkgw Pqw120ZVUzVe24+k9rz5I4PXlcRbLi+igN90xoUhVc3gxnnRBmASXa3Yw7C7d8M4NFP3 /qkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JuX1q6MY; 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 f23si748400plj.241.2019.08.27.01.17.46; Tue, 27 Aug 2019 01:18:00 -0700 (PDT) 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=JuX1q6MY; 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 S1729588AbfH0Hys (ORCPT + 99 others); Tue, 27 Aug 2019 03:54:48 -0400 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 S1730134AbfH0Hyo (ORCPT ); Tue, 27 Aug 2019 03:54:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 02C1B2173E; Tue, 27 Aug 2019 07:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892483; bh=fqxq6ETiBZdsvCAhwofkUWVdIzRN71nf0SFBLf8xv38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JuX1q6MY9GEfjbkc3g4qO2KMAWjue9VutdlBZDdTwGpOiSYpQYjTTz0baM5qDH9/L 2tE5/aQmpEE1F4Nk8uqFsbv9ucFowVNN/SDn5kPhkaYknN0NiaNtDflozoKg0XJ6z8 HMvSueGrnQufn4rBgHwPk2lOuq0tiN7JIgMAFa90= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Trukhanov , Jiri Kosina , Sasha Levin Subject: [PATCH 4.19 01/98] HID: Add 044f:b320 ThrustMaster, Inc. 2 in 1 DT Date: Tue, 27 Aug 2019 09:49:40 +0200 Message-Id: <20190827072718.192470316@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072718.142728620@linuxfoundation.org> References: <20190827072718.142728620@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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 [ Upstream commit 65f11c72780fa9d598df88def045ccb6a885cf80 ] Enable force feedback for the Thrustmaster Dual Trigger 2 in 1 Rumble Force gamepad. Compared to other Thrustmaster devices, left and right rumble motors here are swapped. Signed-off-by: Ilya Trukhanov Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-tmff.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index bea8def64f437..30b8c3256c991 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c @@ -34,6 +34,8 @@ #include "hid-ids.h" +#define THRUSTMASTER_DEVICE_ID_2_IN_1_DT 0xb320 + static const signed short ff_rumble[] = { FF_RUMBLE, -1 @@ -88,6 +90,7 @@ static int tmff_play(struct input_dev *dev, void *data, struct hid_field *ff_field = tmff->ff_field; int x, y; int left, right; /* Rumbling */ + int motor_swap; switch (effect->type) { case FF_CONSTANT: @@ -112,6 +115,13 @@ static int tmff_play(struct input_dev *dev, void *data, ff_field->logical_minimum, ff_field->logical_maximum); + /* 2-in-1 strong motor is left */ + if (hid->product == THRUSTMASTER_DEVICE_ID_2_IN_1_DT) { + motor_swap = left; + left = right; + right = motor_swap; + } + dbg_hid("(left,right)=(%08x, %08x)\n", left, right); ff_field->value[0] = left; ff_field->value[1] = right; @@ -238,6 +248,8 @@ static const struct hid_device_id tm_devices[] = { .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304), /* FireStorm Dual Power 2 (and 3) */ .driver_data = (unsigned long)ff_rumble }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, THRUSTMASTER_DEVICE_ID_2_IN_1_DT), /* Dual Trigger 2-in-1 */ + .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */ .driver_data = (unsigned long)ff_rumble }, { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */ -- 2.20.1