/*
* (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de>
* (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz>
* (c) 2007-2009 Jiri Kosina
*
* HID debugging support
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/poll.h>
#include <linux/hid.h>
#include <linux/hid-debug.h>
static struct dentry *hid_debug_root;
struct hid_usage_entry {
unsigned page;
unsigned usage;
const char *description;
};
static const struct hid_usage_entry hid_usage_table[] = {
{ 0, 0, "Undefined" },
{ 1, 0, "GenericDesktop" },
{0, 0x01, "Pointer"},
{0, 0x02, "Mouse"},
{0, 0x04, "Joystick"},
{0, 0x05, "GamePad"},
{0, 0x06, "Keyboard"},
{0, 0x07, "Keypad"},
{0, 0x08, "MultiAxis"},
{0, 0x30, "X"},
{0, 0x31, "Y"},
{0, 0x32, "Z"},
{0, 0x33, "Rx"},
{0, 0x34, "Ry"},
{0, 0x35, "Rz"},
{0, 0x36, "Slider"},
{0, 0x37, "Dial"},
{0, 0x38, "Wheel"},
{0, 0x39, "HatSwitch"},
{0, 0x3a, "CountedBuffer"},
{0, 0x3b, "ByteCount"},
{0, 0x3c, "MotionWakeup"},
{0, 0x3d, "Start"},
{0, 0x3e, "Select"},
{0, 0x40, "Vx"},
{0, 0x41, "Vy"},
{0, 0x42, "Vz"},
{0, 0x43, "Vbrx"},
{0, 0x44, "Vbry"},
{0, 0x45, "Vbrz"},
{0, 0x46, "Vno"},
{0, 0x80, "SystemControl"},
{0, 0x81, "SystemPowerDown"},
{0, 0x82, "SystemSleep"},
{0, 0x83, "SystemWakeUp"},
{0, 0x84, "SystemContextMenu"},
{0, 0x85, "SystemMainMenu"},
{0, 0x86, "SystemAppMenu"},
{0, 0x87, "SystemMenuHelp"},
{0, 0x88, "SystemMenuExit"},
{0, 0x89, "SystemMenuSelect"},
{0, 0x8a, "SystemMenuRight"},
{0, 0x8b, "SystemMenuLeft"},
{0, 0x8c, "SystemMenuUp"},
{0, 0x8d, "SystemMenuDown"},
{0, 0x90, "D-PadUp"},
{0, 0x91, "D-PadDown"},
{0, 0x92, "D-PadRight"},
{0, 0x93, "D-PadLeft"},
{ 2, 0, "Simulation" },
{0, 0xb0, "Aileron"},
{0, 0xb1, "AileronTrim"},
{0, 0xb2, "Anti-Torque"},
{0, 0xb3, "Autopilot"},
{0, 0xb4, "Chaff"},
{0, 0xb5, "Collective"},
{0, 0xb6, "DiveBrake"},
{0, 0xb7, "ElectronicCountermeasures"},
{0,