linux/drivers/hid/hid-lg.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  HID driver for some logitech "special" devices
 *
 *  Copyright (c) 1999 Andreas Gal
 *  Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
 *  Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
 *  Copyright (c) 2006-2007 Jiri Kosina
 *  Copyright (c) 2008 Jiri Slaby
 *  Copyright (c) 2010 Hendrik Iben
 */

/*
 */

#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/usb.h>
#include <linux/wait.h>

#include "usbhid/usbhid.h"
#include "hid-ids.h"
#include "hid-lg.h"
#include "hid-lg4ff.h"

#define LG_RDESC
#define LG_BAD_RELATIVE_KEYS
#define LG_DUPLICATE_USAGES
#define LG_EXPANDED_KEYMAP
#define LG_IGNORE_DOUBLED_WHEEL
#define LG_WIRELESS
#define LG_INVERT_HWHEEL
#define LG_NOGET
#define LG_FF
#define LG_FF2
#define LG_RDESC_REL_ABS
#define LG_FF3
#define LG_FF4

/* Size of the original descriptors of the Driving Force (and Pro) wheels */
#define DF_RDESC_ORIG_SIZE
#define DFP_RDESC_ORIG_SIZE
#define FV_RDESC_ORIG_SIZE
#define MOMO_RDESC_ORIG_SIZE
#define MOMO2_RDESC_ORIG_SIZE
#define FFG_RDESC_ORIG_SIZE
#define FG_RDESC_ORIG_SIZE

/* Fixed report descriptors for Logitech Driving Force (and Pro)
 * wheel controllers
 *
 * The original descriptors hide the separate throttle and brake axes in
 * a custom vendor usage page, providing only a combined value as
 * GenericDesktop.Y.
 * These descriptors remove the combined Y axis and instead report
 * separate throttle (Y) and brake (RZ).
 */
static __u8 df_rdesc_fixed[] =;

static __u8 dfp_rdesc_fixed[] =;

static __u8 fv_rdesc_fixed[] =;

static __u8 momo_rdesc_fixed[] =;

static __u8 momo2_rdesc_fixed[] =;

static __u8 ffg_rdesc_fixed[] =;

static __u8 fg_rdesc_fixed[] =;

/*
 * Certain Logitech keyboards send in report #3 keys which are far
 * above the logical maximum described in descriptor. This extends
 * the original value of 0x28c of logical maximum to 0x104d
 */
static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{}

#define lg_map_key_clear(c)

static int lg_ultrax_remote_mapping(struct hid_input *hi,
		struct hid_usage *usage, unsigned long **bit, int *max)
{}

static int lg_wireless_mapping(struct hid_input *hi, struct hid_usage *usage,
		unsigned long **bit, int *max)
{}

static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi,
		struct hid_field *field, struct hid_usage *usage,
		unsigned long **bit, int *max)
{}

static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi,
		struct hid_field *field, struct hid_usage *usage,
		unsigned long **bit, int *max)
{}

static int lg_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{}

static int lg_raw_event(struct hid_device *hdev, struct hid_report *report,
		u8 *rd, int size)
{}

static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
{}

static void lg_remove(struct hid_device *hdev)
{}

static const struct hid_device_id lg_devices[] =;

MODULE_DEVICE_TABLE(hid, lg_devices);

static struct hid_driver lg_driver =;
module_hid_driver();

#ifdef CONFIG_LOGIWHEELS_FF
int lg4ff_no_autoswitch =;
module_param_named(lg4ff_no_autoswitch, lg4ff_no_autoswitch, int, S_IRUGO);
MODULE_PARM_DESC();
#endif

MODULE_DESCRIPTION();
MODULE_LICENSE();