From patchwork Tue Mar 19 22:23:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Kuehne X-Patchwork-Id: 781234 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 2E10C51C5B; Tue, 19 Mar 2024 22:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710886987; cv=none; b=Kn5jQGrRDWOsqUohDJpGa/wyjtCFMs3mh0YbWgc/sEbeBXXu+ycfqfROTWROVQKHQVNOSA0n4DZbeuKRzOb8oO2rNaZcwq88Hv2nzrBCsYySofqawCmkyRDA0jWBaeUaQve6RX/M9Y2coKAolcKGwF96x4bfDM/5FyPVL2CMESo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710886987; c=relaxed/simple; bh=Fmol6iXLZOVChPokUhuktqes1qyFzQxgTiZHmF7oYJc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=gtzJ9EEfSNA3M7Fr/SgqhCf+J2hLb6Ahp1JsrC3k/v30IA4VsE/noyge644v2zGmESy0m/Oq1BDTgIOVsuxnFcWKae9zWGRcikqN2PcNvs7CRZk7/ivt9/tg+FWz0mBTHBNnNbcVW8y0VXrc5JN7DFDzSK+00oK6XZPFLdWYDeU= 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=tVnB1lC9; arc=none smtp.client-ip=212.227.17.20 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="tVnB1lC9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.li; s=s31663417; t=1710886983; x=1711491783; i=thomas.kuehne@gmx.li; bh=i48cImo9t+BdT//pMNbETc/yaDKl4mj4URnyodDYANk=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=tVnB1lC9KBOl8bSrs8pF6NE2nWNJ0gM3L6tUo6iWxWbWtUnQinPl2WHzXnmxTIJi N6tK7Bz8AmyAg0hDHiO6F8TSS6WheICawoPgIOtp4yOjwB9Cdn0CPgRVzS3fND9kQ A2TE0MfWx6mgwYE2SgXNhrfzFnGthvlLIGWYgMvHEzlNBCKBwRqo2wldoSnLSrH5T K9T0kreapooq1Omdwt9LBAi+qLVxJspNdMyf5J0tRytvZ2AFWWs6w5ksemMi6tgic jPTYJjixq7pfAywUJiMkC+6mZ3CkcRgJuGv+OM+bdvTHGtdkU4Ha+h33arkwmGkaE slnIyTrYGm+RL2i6HQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from black ([2.59.122.5]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6KUT-1qh1GI0ooL-016iFW; Tue, 19 Mar 2024 23:23:03 +0100 Date: Tue, 19 Mar 2024 22:23:54 +0000 From: Thomas Kuehne To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] HID: hid-debug: add missing evdev and usage codes Message-ID: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:InAFh9DOFtvezkgwLcfMhJ7uYzH0KSiu4QqOEb+YF0kEscdzKAu p1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9qjwnM= Hid-debug's rdesc output for a game controller contained a few question marks and numeric IDs instead of the expected descriptive names. This happens because hid-debug's mapping data is missing a few HID usages supported by hid-input. Add missing codes for LEDs, simulator axis and gamepad buttons. Signed-off-by: Thomas Kuehne --- drivers/hid/hid-debug.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) -- 2.40.1 diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 7dd83ec74f8..67216a52fd2 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -103,6 +103,9 @@ static const struct hid_usage_entry hid_usage_table[] = { {0, 0xbd, "FlareRelease"}, {0, 0xbe, "LandingGear"}, {0, 0xbf, "ToeBrake"}, + {0, 0xc4, "Accelerator"}, + {0, 0xc5, "Brake"}, + {0, 0xc8, "Steering"}, { 6, 0, "GenericDeviceControls" }, {0, 0x20, "BatteryStrength" }, {0, 0x21, "WirelessChannel" }, @@ -118,7 +121,12 @@ static const struct hid_usage_entry hid_usage_table[] = { {0, 0x03, "ScrollLock"}, {0, 0x04, "Compose"}, {0, 0x05, "Kana"}, + {0, 0x09, "Mute"}, + {0, 0x19, "MessageWaiting"}, + {0, 0x27, "StandBy"}, {0, 0x4b, "GenericIndicator"}, + {0, 0x4c, "SystemSuspend"}, + {0, 0x4d, "ExternalPowerConnected"}, { 9, 0, "Button" }, { 10, 0, "Ordinal" }, { 12, 0, "Consumer" }, @@ -995,6 +1003,26 @@ static const char *keys[KEY_MAX + 1] = { [KEY_MACRO22] = "Macro22", [KEY_MACRO23] = "Macro23", [KEY_MACRO24] = "Macro24", [KEY_MACRO25] = "Macro25", [KEY_MACRO26] = "Macro26", [KEY_MACRO27] = "Macro27", [KEY_MACRO28] = "Macro28", [KEY_MACRO29] = "Macro29", [KEY_MACRO30] = "Macro30", + [BTN_TRIGGER_HAPPY1] = "TriggerHappy1", [BTN_TRIGGER_HAPPY2] = "TriggerHappy2", + [BTN_TRIGGER_HAPPY3] = "TriggerHappy3", [BTN_TRIGGER_HAPPY4] = "TriggerHappy4", + [BTN_TRIGGER_HAPPY5] = "TriggerHappy5", [BTN_TRIGGER_HAPPY6] = "TriggerHappy6", + [BTN_TRIGGER_HAPPY7] = "TriggerHappy7", [BTN_TRIGGER_HAPPY8] = "TriggerHappy8", + [BTN_TRIGGER_HAPPY9] = "TriggerHappy9", [BTN_TRIGGER_HAPPY10] = "TriggerHappy10", + [BTN_TRIGGER_HAPPY11] = "TriggerHappy11", [BTN_TRIGGER_HAPPY12] = "TriggerHappy12", + [BTN_TRIGGER_HAPPY13] = "TriggerHappy13", [BTN_TRIGGER_HAPPY14] = "TriggerHappy14", + [BTN_TRIGGER_HAPPY15] = "TriggerHappy15", [BTN_TRIGGER_HAPPY16] = "TriggerHappy16", + [BTN_TRIGGER_HAPPY17] = "TriggerHappy17", [BTN_TRIGGER_HAPPY18] = "TriggerHappy18", + [BTN_TRIGGER_HAPPY19] = "TriggerHappy19", [BTN_TRIGGER_HAPPY20] = "TriggerHappy20", + [BTN_TRIGGER_HAPPY21] = "TriggerHappy21", [BTN_TRIGGER_HAPPY22] = "TriggerHappy22", + [BTN_TRIGGER_HAPPY23] = "TriggerHappy23", [BTN_TRIGGER_HAPPY24] = "TriggerHappy24", + [BTN_TRIGGER_HAPPY25] = "TriggerHappy25", [BTN_TRIGGER_HAPPY26] = "TriggerHappy26", + [BTN_TRIGGER_HAPPY27] = "TriggerHappy27", [BTN_TRIGGER_HAPPY28] = "TriggerHappy28", + [BTN_TRIGGER_HAPPY29] = "TriggerHappy29", [BTN_TRIGGER_HAPPY30] = "TriggerHappy30", + [BTN_TRIGGER_HAPPY31] = "TriggerHappy31", [BTN_TRIGGER_HAPPY32] = "TriggerHappy32", + [BTN_TRIGGER_HAPPY33] = "TriggerHappy33", [BTN_TRIGGER_HAPPY34] = "TriggerHappy34", + [BTN_TRIGGER_HAPPY35] = "TriggerHappy35", [BTN_TRIGGER_HAPPY36] = "TriggerHappy36", + [BTN_TRIGGER_HAPPY37] = "TriggerHappy37", [BTN_TRIGGER_HAPPY38] = "TriggerHappy38", + [BTN_TRIGGER_HAPPY39] = "TriggerHappy39", [BTN_TRIGGER_HAPPY40] = "TriggerHappy40", }; static const char *relatives[REL_MAX + 1] = { @@ -1041,7 +1069,8 @@ static const char *leds[LED_MAX + 1] = { [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute", - [LED_MISC] = "Misc", + [LED_MISC] = "Misc", [LED_MAIL] = "Mail", + [LED_CHARGING] = "Charging", }; static const char *repeats[REP_MAX + 1] = {