#define pr_fmt(fmt) …
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include "usbhid.h"
#define PID_EFFECTS_MAX …
#define PID_SET_EFFECT …
#define PID_EFFECT_OPERATION …
#define PID_DEVICE_GAIN …
#define PID_POOL …
#define PID_BLOCK_LOAD …
#define PID_BLOCK_FREE …
#define PID_DEVICE_CONTROL …
#define PID_CREATE_NEW_EFFECT …
#define PID_REQUIRED_REPORTS …
#define PID_SET_ENVELOPE …
#define PID_SET_CONDITION …
#define PID_SET_PERIODIC …
#define PID_SET_CONSTANT …
#define PID_SET_RAMP …
static const u8 pidff_reports[] = …;
#define PID_EFFECT_BLOCK_INDEX …
#define PID_DURATION …
#define PID_GAIN …
#define PID_TRIGGER_BUTTON …
#define PID_TRIGGER_REPEAT_INT …
#define PID_DIRECTION_ENABLE …
#define PID_START_DELAY …
static const u8 pidff_set_effect[] = …;
#define PID_ATTACK_LEVEL …
#define PID_ATTACK_TIME …
#define PID_FADE_LEVEL …
#define PID_FADE_TIME …
static const u8 pidff_set_envelope[] = …;
#define PID_PARAM_BLOCK_OFFSET …
#define PID_CP_OFFSET …
#define PID_POS_COEFFICIENT …
#define PID_NEG_COEFFICIENT …
#define PID_POS_SATURATION …
#define PID_NEG_SATURATION …
#define PID_DEAD_BAND …
static const u8 pidff_set_condition[] = …;
#define PID_MAGNITUDE …
#define PID_OFFSET …
#define PID_PHASE …
#define PID_PERIOD …
static const u8 pidff_set_periodic[] = …;
static const u8 pidff_set_constant[] = …;
#define PID_RAMP_START …
#define PID_RAMP_END …
static const u8 pidff_set_ramp[] = …;
#define PID_RAM_POOL_AVAILABLE …
static const u8 pidff_block_load[] = …;
#define PID_LOOP_COUNT …
static const u8 pidff_effect_operation[] = …;
static const u8 pidff_block_free[] = …;
#define PID_DEVICE_GAIN_FIELD …
static const u8 pidff_device_gain[] = …;
#define PID_RAM_POOL_SIZE …
#define PID_SIMULTANEOUS_MAX …
#define PID_DEVICE_MANAGED_POOL …
static const u8 pidff_pool[] = …;
#define PID_ENABLE_ACTUATORS …
#define PID_RESET …
static const u8 pidff_device_control[] = …;
#define PID_CONSTANT …
#define PID_RAMP …
#define PID_SQUARE …
#define PID_SINE …
#define PID_TRIANGLE …
#define PID_SAW_UP …
#define PID_SAW_DOWN …
#define PID_SPRING …
#define PID_DAMPER …
#define PID_INERTIA …
#define PID_FRICTION …
static const u8 pidff_effect_types[] = …;
#define PID_BLOCK_LOAD_SUCCESS …
#define PID_BLOCK_LOAD_FULL …
static const u8 pidff_block_load_status[] = …;
#define PID_EFFECT_START …
#define PID_EFFECT_STOP …
static const u8 pidff_effect_operation_status[] = …;
struct pidff_usage { … };
struct pidff_device { … };
static int pidff_rescale(int i, int max, struct hid_field *field)
{ … }
static int pidff_rescale_signed(int i, struct hid_field *field)
{ … }
static void pidff_set(struct pidff_usage *usage, u16 value)
{ … }
static void pidff_set_signed(struct pidff_usage *usage, s16 value)
{ … }
static void pidff_set_envelope_report(struct pidff_device *pidff,
struct ff_envelope *envelope)
{ … }
static int pidff_needs_set_envelope(struct ff_envelope *envelope,
struct ff_envelope *old)
{ … }
static void pidff_set_constant_force_report(struct pidff_device *pidff,
struct ff_effect *effect)
{ … }
static int pidff_needs_set_constant(struct ff_effect *effect,
struct ff_effect *old)
{ … }
static void pidff_set_effect_report(struct pidff_device *pidff,
struct ff_effect *effect)
{ … }
static int pidff_needs_set_effect(struct ff_effect *effect,
struct ff_effect *old)
{ … }
static void pidff_set_periodic_report(struct pidff_device *pidff,
struct ff_effect *effect)
{ … }
static int pidff_needs_set_periodic(struct ff_effect *effect,
struct ff_effect *old)
{ … }
static void pidff_set_condition_report(struct pidff_device *pidff,
struct ff_effect *effect)
{ … }
static int pidff_needs_set_condition(struct ff_effect *effect,
struct ff_effect *old)
{ … }
static void pidff_set_ramp_force_report(struct pidff_device *pidff,
struct ff_effect *effect)
{ … }
static int pidff_needs_set_ramp(struct ff_effect *effect, struct ff_effect *old)
{ … }
static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum)
{ … }
static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n)
{ … }
static int pidff_playback(struct input_dev *dev, int effect_id, int value)
{ … }
static void pidff_erase_pid(struct pidff_device *pidff, int pid_id)
{ … }
static int pidff_erase_effect(struct input_dev *dev, int effect_id)
{ … }
static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,
struct ff_effect *old)
{ … }
static void pidff_set_gain(struct input_dev *dev, u16 gain)
{ … }
static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude)
{ … }
static void pidff_set_autocenter(struct input_dev *dev, u16 magnitude)
{ … }
static int pidff_find_fields(struct pidff_usage *usage, const u8 *table,
struct hid_report *report, int count, int strict)
{ … }
static int pidff_check_usage(int usage)
{ … }
static void pidff_find_reports(struct hid_device *hid, int report_type,
struct pidff_device *pidff)
{ … }
static int pidff_reports_ok(struct pidff_device *pidff)
{ … }
static struct hid_field *pidff_find_special_field(struct hid_report *report,
int usage, int enforce_min)
{ … }
static int pidff_find_special_keys(int *keys, struct hid_field *fld,
const u8 *usagetable, int count)
{ … }
#define PIDFF_FIND_SPECIAL_KEYS(keys, field, name) …
static int pidff_find_special_fields(struct pidff_device *pidff)
{ … }
static int pidff_find_effects(struct pidff_device *pidff,
struct input_dev *dev)
{ … }
#define PIDFF_FIND_FIELDS(name, report, strict) …
static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev)
{ … }
static void pidff_reset(struct pidff_device *pidff)
{ … }
static int pidff_check_autocenter(struct pidff_device *pidff,
struct input_dev *dev)
{ … }
int hid_pidff_init(struct hid_device *hid)
{ … }