#include <linux/module.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/hid.h>
#include <linux/hid-debug.h>
#include "hid-ids.h"
#define unk …
static const unsigned char hid_keyboard[256] = …;
static const struct { … } hid_hat_to_axis[] = …;
struct usage_priority { … };
static const struct usage_priority hidinput_usages_priorities[] = …;
#define map_abs(c) …
#define map_rel(c) …
#define map_key(c) …
#define map_led(c) …
#define map_msc(c) …
#define map_abs_clear(c) …
#define map_key_clear(c) …
static bool match_scancode(struct hid_usage *usage,
unsigned int cur_idx, unsigned int scancode)
{ … }
static bool match_keycode(struct hid_usage *usage,
unsigned int cur_idx, unsigned int keycode)
{ … }
static bool match_index(struct hid_usage *usage,
unsigned int cur_idx, unsigned int idx)
{ … }
hid_usage_cmp_t;
static struct hid_usage *hidinput_find_key(struct hid_device *hid,
hid_usage_cmp_t match,
unsigned int value,
unsigned int *usage_idx)
{ … }
static struct hid_usage *hidinput_locate_usage(struct hid_device *hid,
const struct input_keymap_entry *ke,
unsigned int *index)
{ … }
static int hidinput_getkeycode(struct input_dev *dev,
struct input_keymap_entry *ke)
{ … }
static int hidinput_setkeycode(struct input_dev *dev,
const struct input_keymap_entry *ke,
unsigned int *old_keycode)
{ … }
__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_HID_BATTERY_STRENGTH
static enum power_supply_property hidinput_battery_props[] = …;
#define HID_BATTERY_QUIRK_PERCENT …
#define HID_BATTERY_QUIRK_FEATURE …
#define HID_BATTERY_QUIRK_IGNORE …
#define HID_BATTERY_QUIRK_AVOID_QUERY …
static const struct hid_device_id hid_battery_quirks[] = …;
static unsigned find_battery_quirk(struct hid_device *hdev)
{ … }
static int hidinput_scale_battery_capacity(struct hid_device *dev,
int value)
{ … }
static int hidinput_query_battery_capacity(struct hid_device *dev)
{ … }
static int hidinput_get_battery_property(struct power_supply *psy,
enum power_supply_property prop,
union power_supply_propval *val)
{ … }
static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type,
struct hid_field *field, bool is_percentage)
{ … }
static void hidinput_cleanup_battery(struct hid_device *dev)
{ … }
static void hidinput_update_battery(struct hid_device *dev, int value)
{ … }
static bool hidinput_set_battery_charge_status(struct hid_device *dev,
unsigned int usage, int value)
{ … }
#else
static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type,
struct hid_field *field, bool is_percentage)
{
return 0;
}
static void hidinput_cleanup_battery(struct hid_device *dev)
{
}
static void hidinput_update_battery(struct hid_device *dev, int value)
{
}
static bool hidinput_set_battery_charge_status(struct hid_device *dev,
unsigned int usage, int value)
{
return false;
}
#endif
static bool hidinput_field_in_collection(struct hid_device *device, struct hid_field *field,
unsigned int type, unsigned int usage)
{ … }
static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage, unsigned int usage_index)
{ … }
static void hidinput_handle_scroll(struct hid_usage *usage,
struct input_dev *input,
__s32 value)
{ … }
static void hid_report_release_tool(struct hid_report *report, struct input_dev *input,
unsigned int tool)
{ … }
static void hid_report_set_tool(struct hid_report *report, struct input_dev *input,
unsigned int new_tool)
{ … }
void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
{ … }
void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
{ … }
EXPORT_SYMBOL_GPL(…);
static int hidinput_find_field(struct hid_device *hid, unsigned int type,
unsigned int code, struct hid_field **field)
{ … }
struct hid_field *hidinput_get_led_field(struct hid_device *hid)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int hidinput_count_leds(struct hid_device *hid)
{ … }
EXPORT_SYMBOL_GPL(…);
static void hidinput_led_worker(struct work_struct *work)
{ … }
static int hidinput_input_event(struct input_dev *dev, unsigned int type,
unsigned int code, int value)
{ … }
static int hidinput_open(struct input_dev *dev)
{ … }
static void hidinput_close(struct input_dev *dev)
{ … }
static bool __hidinput_change_resolution_multipliers(struct hid_device *hid,
struct hid_report *report, bool use_logical_max)
{ … }
static void hidinput_change_resolution_multipliers(struct hid_device *hid)
{ … }
static void report_features(struct hid_device *hid)
{ … }
static struct hid_input *hidinput_allocate(struct hid_device *hid,
unsigned int application)
{ … }
static bool hidinput_has_been_populated(struct hid_input *hidinput)
{ … }
static void hidinput_cleanup_hidinput(struct hid_device *hid,
struct hid_input *hidinput)
{ … }
static struct hid_input *hidinput_match(struct hid_report *report)
{ … }
static struct hid_input *hidinput_match_application(struct hid_report *report)
{ … }
static inline void hidinput_configure_usages(struct hid_input *hidinput,
struct hid_report *report)
{ … }
int hidinput_connect(struct hid_device *hid, unsigned int force)
{ … }
EXPORT_SYMBOL_GPL(…);
void hidinput_disconnect(struct hid_device *hid)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_HID_KUNIT_TEST
#include "hid-input-test.c"
#endif