^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Roccat Arvo driver for Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2011 Stefan Achatz <erazor_de@users.sourceforge.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Roccat Arvo is a gamer keyboard with 5 macro keys that can be configured in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * 5 profiles.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/hid.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/hid-roccat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include "hid-ids.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include "hid-roccat-common.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "hid-roccat-arvo.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static struct class *arvo_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) static ssize_t arvo_sysfs_show_mode_key(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct device_attribute *attr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct usb_device *usb_dev =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) interface_to_usbdev(to_usb_interface(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct arvo_mode_key temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_MODE_KEY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) &temp_buf, sizeof(struct arvo_mode_key));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct device_attribute *attr, char const *buf, size_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct usb_device *usb_dev =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) interface_to_usbdev(to_usb_interface(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct arvo_mode_key temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) unsigned long state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) retval = kstrtoul(buf, 10, &state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) temp_buf.command = ARVO_COMMAND_MODE_KEY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) temp_buf.state = state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) retval = roccat_common2_send(usb_dev, ARVO_COMMAND_MODE_KEY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) &temp_buf, sizeof(struct arvo_mode_key));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) return size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) static DEVICE_ATTR(mode_key, 0660,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) static ssize_t arvo_sysfs_show_key_mask(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) struct device_attribute *attr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) struct usb_device *usb_dev =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) interface_to_usbdev(to_usb_interface(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) struct arvo_key_mask temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_KEY_MASK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) &temp_buf, sizeof(struct arvo_key_mask));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) struct device_attribute *attr, char const *buf, size_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct usb_device *usb_dev =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) interface_to_usbdev(to_usb_interface(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct arvo_key_mask temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) unsigned long key_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) retval = kstrtoul(buf, 10, &key_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) temp_buf.command = ARVO_COMMAND_KEY_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) temp_buf.key_mask = key_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) retval = roccat_common2_send(usb_dev, ARVO_COMMAND_KEY_MASK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) &temp_buf, sizeof(struct arvo_key_mask));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) return size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) static DEVICE_ATTR(key_mask, 0660,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) /* retval is 1-5 on success, < 0 on error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) static int arvo_get_actual_profile(struct usb_device *usb_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) struct arvo_actual_profile temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) &temp_buf, sizeof(struct arvo_actual_profile));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) return temp_buf.actual_profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static ssize_t arvo_sysfs_show_actual_profile(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) struct device_attribute *attr, char *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct device_attribute *attr, char const *buf, size_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) struct arvo_device *arvo =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) struct usb_device *usb_dev =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) interface_to_usbdev(to_usb_interface(dev->parent->parent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) struct arvo_actual_profile temp_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) unsigned long profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) retval = kstrtoul(buf, 10, &profile);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) if (profile < 1 || profile > 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) temp_buf.command = ARVO_COMMAND_ACTUAL_PROFILE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) temp_buf.actual_profile = profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) retval = roccat_common2_send(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) &temp_buf, sizeof(struct arvo_actual_profile));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) if (!retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) arvo->actual_profile = profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) retval = size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) static DEVICE_ATTR(actual_profile, 0660,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) arvo_sysfs_show_actual_profile,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) arvo_sysfs_set_actual_profile);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static ssize_t arvo_sysfs_write(struct file *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) struct kobject *kobj, void const *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) loff_t off, size_t count, size_t real_size, uint command)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) struct device *dev = kobj_to_dev(kobj)->parent->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) if (off != 0 || count != real_size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) retval = roccat_common2_send(usb_dev, command, buf, real_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) return (retval ? retval : real_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) static ssize_t arvo_sysfs_read(struct file *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) struct kobject *kobj, void *buf, loff_t off,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) size_t count, size_t real_size, uint command)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) struct device *dev = kobj_to_dev(kobj)->parent->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) if (off >= real_size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) if (off != 0 || count != real_size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) mutex_lock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) retval = roccat_common2_receive(usb_dev, command, buf, real_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) mutex_unlock(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) return (retval ? retval : real_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) static ssize_t arvo_sysfs_write_button(struct file *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) struct kobject *kobj, struct bin_attribute *attr, char *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) loff_t off, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) return arvo_sysfs_write(fp, kobj, buf, off, count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) sizeof(struct arvo_button), ARVO_COMMAND_BUTTON);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) static BIN_ATTR(button, 0220, NULL, arvo_sysfs_write_button,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) sizeof(struct arvo_button));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) static ssize_t arvo_sysfs_read_info(struct file *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) struct kobject *kobj, struct bin_attribute *attr, char *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) loff_t off, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) return arvo_sysfs_read(fp, kobj, buf, off, count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) sizeof(struct arvo_info), ARVO_COMMAND_INFO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) static BIN_ATTR(info, 0440, arvo_sysfs_read_info, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) sizeof(struct arvo_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) static struct attribute *arvo_attrs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) &dev_attr_mode_key.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) &dev_attr_key_mask.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) &dev_attr_actual_profile.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) static struct bin_attribute *arvo_bin_attributes[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) &bin_attr_button,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) &bin_attr_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) static const struct attribute_group arvo_group = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) .attrs = arvo_attrs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) .bin_attrs = arvo_bin_attributes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) static const struct attribute_group *arvo_groups[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) &arvo_group,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) static int arvo_init_arvo_device_struct(struct usb_device *usb_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) struct arvo_device *arvo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) mutex_init(&arvo->arvo_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) retval = arvo_get_actual_profile(usb_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) if (retval < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) arvo->actual_profile = retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) static int arvo_init_specials(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) struct usb_device *usb_dev = interface_to_usbdev(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) struct arvo_device *arvo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) if (intf->cur_altsetting->desc.bInterfaceProtocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) == USB_INTERFACE_PROTOCOL_KEYBOARD) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) hid_set_drvdata(hdev, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) arvo = kzalloc(sizeof(*arvo), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) if (!arvo) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) hid_err(hdev, "can't alloc device descriptor\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) hid_set_drvdata(hdev, arvo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) retval = arvo_init_arvo_device_struct(usb_dev, arvo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) hid_err(hdev, "couldn't init struct arvo_device\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) goto exit_free;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) retval = roccat_connect(arvo_class, hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) sizeof(struct arvo_roccat_report));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) if (retval < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) hid_err(hdev, "couldn't init char dev\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) arvo->chrdev_minor = retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) arvo->roccat_claimed = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) exit_free:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) kfree(arvo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) static void arvo_remove_specials(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) struct arvo_device *arvo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) if (intf->cur_altsetting->desc.bInterfaceProtocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) == USB_INTERFACE_PROTOCOL_KEYBOARD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) arvo = hid_get_drvdata(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) if (arvo->roccat_claimed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) roccat_disconnect(arvo->chrdev_minor);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) kfree(arvo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) static int arvo_probe(struct hid_device *hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) const struct hid_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) if (!hid_is_usb(hdev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) retval = hid_parse(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) hid_err(hdev, "parse failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) goto exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) hid_err(hdev, "hw start failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) goto exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) retval = arvo_init_specials(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) hid_err(hdev, "couldn't install keyboard\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) goto exit_stop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) exit_stop:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) hid_hw_stop(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) exit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) static void arvo_remove(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) arvo_remove_specials(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) hid_hw_stop(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) static void arvo_report_to_chrdev(struct arvo_device const *arvo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) u8 const *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) struct arvo_special_report const *special_report;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) struct arvo_roccat_report roccat_report;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) special_report = (struct arvo_special_report const *)data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) roccat_report.profile = arvo->actual_profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) roccat_report.button = special_report->event &
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) if ((special_report->event & ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION) ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) roccat_report.action = ARVO_ROCCAT_REPORT_ACTION_PRESS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) roccat_report.action = ARVO_ROCCAT_REPORT_ACTION_RELEASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) roccat_report_event(arvo->chrdev_minor,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) (uint8_t const *)&roccat_report);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) static int arvo_raw_event(struct hid_device *hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) struct hid_report *report, u8 *data, int size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) struct arvo_device *arvo = hid_get_drvdata(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) if (size != 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) if (arvo && arvo->roccat_claimed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) arvo_report_to_chrdev(arvo, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) static const struct hid_device_id arvo_devices[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) { }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) MODULE_DEVICE_TABLE(hid, arvo_devices);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) static struct hid_driver arvo_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) .name = "arvo",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) .id_table = arvo_devices,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) .probe = arvo_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) .remove = arvo_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) .raw_event = arvo_raw_event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) static int __init arvo_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) arvo_class = class_create(THIS_MODULE, "arvo");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) if (IS_ERR(arvo_class))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) return PTR_ERR(arvo_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) arvo_class->dev_groups = arvo_groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) retval = hid_register_driver(&arvo_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) class_destroy(arvo_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) static void __exit arvo_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) hid_unregister_driver(&arvo_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) class_destroy(arvo_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) module_init(arvo_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) module_exit(arvo_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) MODULE_AUTHOR("Stefan Achatz");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) MODULE_DESCRIPTION("USB Roccat Arvo driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) MODULE_LICENSE("GPL v2");