#include <linux/hid.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/leds.h>
#include "hid-ids.h"
#define CORSAIR_USE_K90_MACRO …
#define CORSAIR_USE_K90_BACKLIGHT …
struct k90_led { … };
struct k90_drvdata { … };
struct corsair_drvdata { … };
#define K90_GKEY_COUNT …
static int corsair_usage_to_gkey(unsigned int usage)
{ … }
static unsigned short corsair_gkey_map[K90_GKEY_COUNT] = …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
static unsigned short corsair_record_keycodes[2] = …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
static unsigned short corsair_profile_keycodes[3] = …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
#define CORSAIR_USAGE_SPECIAL_MIN …
#define CORSAIR_USAGE_SPECIAL_MAX …
#define CORSAIR_USAGE_MACRO_RECORD_START …
#define CORSAIR_USAGE_MACRO_RECORD_STOP …
#define CORSAIR_USAGE_PROFILE …
#define CORSAIR_USAGE_M1 …
#define CORSAIR_USAGE_M2 …
#define CORSAIR_USAGE_M3 …
#define CORSAIR_USAGE_PROFILE_MAX …
#define CORSAIR_USAGE_META_OFF …
#define CORSAIR_USAGE_META_ON …
#define CORSAIR_USAGE_LIGHT …
#define CORSAIR_USAGE_LIGHT_OFF …
#define CORSAIR_USAGE_LIGHT_DIM …
#define CORSAIR_USAGE_LIGHT_MEDIUM …
#define CORSAIR_USAGE_LIGHT_BRIGHT …
#define CORSAIR_USAGE_LIGHT_MAX …
#define K90_REQUEST_BRIGHTNESS …
#define K90_REQUEST_MACRO_MODE …
#define K90_REQUEST_STATUS …
#define K90_REQUEST_GET_MODE …
#define K90_REQUEST_PROFILE …
#define K90_MACRO_MODE_SW …
#define K90_MACRO_MODE_HW …
#define K90_MACRO_LED_ON …
#define K90_MACRO_LED_OFF …
#define K90_BACKLIGHT_LED_SUFFIX …
#define K90_RECORD_LED_SUFFIX …
static enum led_brightness k90_backlight_get(struct led_classdev *led_cdev)
{ … }
static enum led_brightness k90_record_led_get(struct led_classdev *led_cdev)
{ … }
static void k90_brightness_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static void k90_backlight_work(struct work_struct *work)
{ … }
static void k90_record_led_work(struct work_struct *work)
{ … }
static ssize_t k90_show_macro_mode(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t k90_store_macro_mode(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t k90_show_current_profile(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t k90_store_current_profile(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(macro_mode, 0644, k90_show_macro_mode, k90_store_macro_mode);
static DEVICE_ATTR(current_profile, 0644, k90_show_current_profile,
k90_store_current_profile);
static struct attribute *k90_attrs[] = …;
static const struct attribute_group k90_attr_group = …;
static int k90_init_backlight(struct hid_device *dev)
{ … }
static int k90_init_macro_functions(struct hid_device *dev)
{ … }
static void k90_cleanup_backlight(struct hid_device *dev)
{ … }
static void k90_cleanup_macro_functions(struct hid_device *dev)
{ … }
static int corsair_probe(struct hid_device *dev, const struct hid_device_id *id)
{ … }
static void corsair_remove(struct hid_device *dev)
{ … }
static int corsair_event(struct hid_device *dev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{ … }
static int corsair_input_mapping(struct hid_device *dev,
struct hid_input *input,
struct hid_field *field,
struct hid_usage *usage, unsigned long **bit,
int *max)
{ … }
static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{ … }
static const struct hid_device_id corsair_devices[] = …;
MODULE_DEVICE_TABLE(hid, corsair_devices);
static struct hid_driver corsair_driver = …;
module_hid_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;