linux/drivers/hid/hid-lg4ff.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Force feedback support for Logitech Gaming Wheels
 *
 *  Including G27, G25, DFP, DFGT, FFEX, Momo, Momo2 &
 *  Speed Force Wireless (WiiWheel)
 *
 *  Copyright (c) 2010 Simon Wood <[email protected]>
 */

/*
 */


#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[] =;

/* Multimode wheel identificators */
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 =;

/* Multimode wheel identification checklists */
static const struct lg4ff_wheel_ident_info *lg4ff_main_checklist[] =;

/* Compatibility mode switching commands */
/* EXT_CMD9 - Understood by G27 and DFGT */
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 =;

/* EXT_CMD1 - Understood by DFP, G25, G27 and DFGT */
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext01_dfp =;

/* EXT_CMD16 - Understood by G25 and G27 */
static const struct lg4ff_compat_mode_switch lg4ff_mode_switch_ext16_g25 =;

/* Recalculates X axis value accordingly to currently selected range */
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)
{}

/* Sends default autocentering command compatible with
 * all wheels except Formula Force EX */
static void lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitude)
{}

/* Sends autocentering command compatible with Formula Force EX */
static void lg4ff_set_autocenter_ffex(struct input_dev *dev, u16 magnitude)
{}

/* Sends command to set range compatible with G25/G27/Driving Force GT */
static void lg4ff_set_range_g25(struct hid_device *hid, u16 range)
{}

/* Sends commands to set range compatible with Driving Force Pro wheel */
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);

/* Export the currently set range of the wheel */
static ssize_t lg4ff_range_show(struct device *dev, struct device_attribute *attr,
				char *buf)
{}

/* Set range to user specified value, call appropriate function
 * according to the type of the wheel */
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)
{}