From patchwork Sat Apr 13 12:39:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Kuehne X-Patchwork-Id: 13628673 X-Patchwork-Delegate: jikos@jikos.cz Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3856F2C9D; Sat, 13 Apr 2024 11:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713008290; cv=none; b=JFVODSQtkyJXs2Emv2h3LEGqBDHUKsc8nE2ZigpUIBg7FEqsR5bCYzE5rVt2YbIL4BOxQiLYgsTcNL8eB9fTy4UUZ9+hiiyXMOHxeSbhSdEhY8u1sjWpCs3qdugqDcQ3x1RJWejUqJuOjCx3ZU1qH0iqpsLgqwrpUxBJMAmRD3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713008290; c=relaxed/simple; bh=eURnQW+uqGSQ/Y+YT+UOu7F4suXVR0cemcfQqJf1+gM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=QAitxl7aDA9JdsEedqbheXZgH8Y9d7lj5navj8LDccSp1/tVw6N0kC5vOGJGGxkWfQvJhjZv2KVa6A1zF5/PxhRZ7S+gRF8vIqW3uYlIMhFM5DEBuhY868D2Q6u5EcUdw1Jn9ttWPprGCJovb0kFA1D3MpK97FW/h6iSIk7XJhc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.li; spf=pass smtp.mailfrom=gmx.li; dkim=pass (2048-bit key) header.d=gmx.li header.i=thomas.kuehne@gmx.li header.b=mZ0IRgfG; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.li Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.li Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.li header.i=thomas.kuehne@gmx.li header.b="mZ0IRgfG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.li; s=s31663417; t=1713008281; x=1713613081; i=thomas.kuehne@gmx.li; bh=V6CMb3JGrJkWpqnpZmfMM2ApMJs9UEpEUKghePgL/0M=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=mZ0IRgfGQNzCQ2YUklN45m2/RfjtND5e8U8e9tZfCcnOVZDkr8zXxXPeWRsOJ/cq 6/ruHaBdeBNVaIU4pKOTVeNZXOjjsN4r//FXPdWjov6Xr2LuM0f9UfJxVu7wVSMWD 10wOf/LyDaBMeZSoP3Y+aoZ4indXIy5NGpfLaqrgdsNEMvJgGpme01zPg7EUVdZyG 3Uu4HsdTLi5A3L4TqP9RmOrd/HR7CXRPEhMC/C4OzKA48JwkmqIShAhkW0OeBNe/f iDSFHU7At1LNCpY56UXQneAJvUtNJxAQlSGC7zS7AG9WzFG9zcZHuLHOXFTvD6p2n hp9x1N2tUhQ5kArVkg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from black ([2.59.120.154]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdvmY-1sVU9n2tBG-00b5F0; Sat, 13 Apr 2024 13:38:01 +0200 Date: Sat, 13 Apr 2024 12:39:17 +0000 From: Thomas Kuehne To: jikos@kernel.org, bentiss@kernel.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: hid-debug: add EV_FF and FF_STATUS mappings Message-ID: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content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6K3DFB+JFk9ri+TxDYgjugdhydmo6cuMZQvgG6TXUj8QQEj6lSXABN 5hefdL1d9q8oqC275LTS64Qs+0zQ1oeq+WqnDzeZDg7u4= Currently hid-debug only output question marks for all force feedback related input mapping making debugging gamepads with force feedback a challenge. This adds the necessary mapping information to output EV_FF and FF_STATUS related information. Signed-off-by: Thomas Kuehne --- drivers/hid/hid-debug.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) base-commit: 9ed46da14b9b9b2ad4edb3b0c545b6dbe5c00d39 -- 2.40.1 diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index add353a17853..bd9bb235363f 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -3572,12 +3572,38 @@ static const char *software[SW_CNT] = { [SW_MACHINE_COVER] = "MachineCover", }; +static const char *force[FF_CNT] = { + [FF_RUMBLE] = "FF_RUMBLE", + [FF_PERIODIC] = "FF_PERIODIC", + [FF_CONSTANT] = "FF_CONSTANT", + [FF_SPRING] = "FF_SPRING", + [FF_FRICTION] = "FF_FRICTION", + [FF_DAMPER] = "FF_DAMPER", + [FF_INERTIA] = "FF_INERTIA", + [FF_RAMP] = "FF_RAMP", + [FF_SQUARE] = "FF_SQUARE", + [FF_TRIANGLE] = "FF_TRIANGLE", + [FF_SINE] = "FF_SINE", + [FF_SAW_UP] = "FF_SAW_UP", + [FF_SAW_DOWN] = "FF_SAW_DOWN", + [FF_CUSTOM] = "FF_CUSTOM", + [FF_GAIN] = "FF_GAIN", + [FF_AUTOCENTER] = "FF_AUTOCENTER", + [FF_MAX] = "FF_MAX", +}; + +static const char *force_status[FF_STATUS_MAX + 1] = { + [FF_STATUS_STOPPED] = "FF_STATUS_STOPPED", + [FF_STATUS_PLAYING] = "FF_STATUS_PLAYING", +}; + static const char **names[EV_MAX + 1] = { [EV_SYN] = syncs, [EV_KEY] = keys, [EV_REL] = relatives, [EV_ABS] = absolutes, [EV_MSC] = misc, [EV_LED] = leds, [EV_SND] = sounds, [EV_REP] = repeats, - [EV_SW] = software, + [EV_SW] = software, [EV_FF] = force, + [EV_FF_STATUS] = force_status, }; static void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f)