#include <linux/input.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include "usbhid/usbhid.h"
#include "hid-lg.h"
#include "hid-lg4ff.h"
#include "hid-ids.h"
#define LG4FF_MMODE_IS_MULTIMODE …
#define LG4FF_MMODE_SWITCHED …
#define LG4FF_MMODE_NOT_MULTIMODE …
#define LG4FF_MODE_NATIVE_IDX …
#define LG4FF_MODE_DFEX_IDX …
#define LG4FF_MODE_DFP_IDX …
#define LG4FF_MODE_G25_IDX …
#define LG4FF_MODE_DFGT_IDX …
#define LG4FF_MODE_G27_IDX …
#define LG4FF_MODE_G29_IDX …
#define LG4FF_MODE_MAX_IDX …
#define LG4FF_MODE_NATIVE …
#define LG4FF_MODE_DFEX …
#define LG4FF_MODE_DFP …
#define LG4FF_MODE_G25 …
#define LG4FF_MODE_DFGT …
#define LG4FF_MODE_G27 …
#define LG4FF_MODE_G29 …
#define LG4FF_DFEX_TAG …
#define LG4FF_DFEX_NAME …
#define LG4FF_DFP_TAG …
#define LG4FF_DFP_NAME …
#define LG4FF_G25_TAG …
#define LG4FF_G25_NAME …
#define LG4FF_G27_TAG …
#define LG4FF_G27_NAME …
#define LG4FF_G29_TAG …
#define LG4FF_G29_NAME …
#define LG4FF_DFGT_TAG …
#define LG4FF_DFGT_NAME …
#define LG4FF_FFEX_REV_MAJ …
#define LG4FF_FFEX_REV_MIN …
static void lg4ff_set_range_dfp(struct hid_device *hid, u16 range);
static void lg4ff_set_range_g25(struct hid_device *hid, u16 range);
struct lg4ff_wheel_data { … };
struct lg4ff_device_entry { … };
static const signed short lg4ff_wheel_effects[] = …;
static const signed short no_wheel_effects[] = …;
struct lg4ff_wheel { … };
struct lg4ff_compat_mode_switch { … };
struct lg4ff_wheel_ident_info { … };
struct lg4ff_multimode_wheel { … };
struct lg4ff_alternate_mode { … };
static const struct lg4ff_wheel lg4ff_devices[] = …;
static const struct lg4ff_multimode_wheel lg4ff_multimode_wheels[] = …;
static const struct lg4ff_alternate_mode lg4ff_alternate_modes[] = …;
static const struct lg4ff_wheel_ident_info lg4ff_dfp_ident_info = …;
static const struct lg4ff_wheel_ident_info lg4ff_g25_ident_info = …;
static const struct lg4ff_wheel_ident_info lg4ff_g27_ident_info = …;
static const struct lg4ff_wheel_ident_info lg4ff_dfgt_ident_info = …;
static const struct lg4ff_wheel_ident_info lg4ff_g29_ident_info = …;
static const struct lg4ff_wheel_ident_info lg4ff_g29_ident_info2 = …;
static const struct lg4ff_wheel_ident_info *lg4ff_main_checklist[] = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_dfex = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_dfp = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_g25 = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_dfgt = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_g27 = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext09_g29 = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext01_dfp = …;
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext16_g25 = …;
static s32 lg4ff_adjust_dfp_x_axis(s32 value, u16 range)
{ … }
int lg4ff_adjust_input_event(struct hid_device *hid, struct hid_field *field,
struct hid_usage *usage, s32 value, struct lg_drv_data *drv_data)
{ … }
int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *rd, int size, struct lg_drv_data *drv_data)
{ … }
static void lg4ff_init_wheel_data(struct lg4ff_wheel_data * const wdata, const struct lg4ff_wheel *wheel,
const struct lg4ff_multimode_wheel *mmode_wheel,
const u16 real_product_id)
{ … }
static int lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
{ … }
static void lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitude)
{ … }
static void lg4ff_set_autocenter_ffex(struct input_dev *dev, u16 magnitude)
{ … }
static void lg4ff_set_range_g25(struct hid_device *hid, u16 range)
{ … }
static void lg4ff_set_range_dfp(struct hid_device *hid, u16 range)
{ … }
static const struct lg4ff_compat_mode_switch *lg4ff_get_mode_switch_command(const u16 real_product_id, const u16 target_product_id)
{ … }
static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s)
{ … }
static ssize_t lg4ff_alternate_modes_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t lg4ff_alternate_modes_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(alternate_modes, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_alternate_modes_show, lg4ff_alternate_modes_store);
static ssize_t lg4ff_combine_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t lg4ff_combine_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(combine_pedals, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_combine_show, lg4ff_combine_store);
static ssize_t lg4ff_range_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(range, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_range_show, lg4ff_range_store);
static ssize_t lg4ff_real_id_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t lg4ff_real_id_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(real_id, S_IRUGO, lg4ff_real_id_show, lg4ff_real_id_store);
#ifdef CONFIG_LEDS_CLASS
static void lg4ff_set_leds(struct hid_device *hid, u8 leds)
{ … }
static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
{ … }
#endif
static u16 lg4ff_identify_multimode_wheel(struct hid_device *hid, const u16 reported_product_id, const u16 bcdDevice)
{ … }
static int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_product_id, const u16 bcdDevice)
{ … }
int lg4ff_init(struct hid_device *hid)
{ … }
int lg4ff_deinit(struct hid_device *hid)
{ … }