Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^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 KonePure 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) 2012 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 KonePure is a smaller version of KoneXTD with less buttons and lights.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/types.h>
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	KONEPURE_MOUSE_REPORT_NUMBER_BUTTON = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) struct konepure_mouse_report_button {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	uint8_t report_number; /* always KONEPURE_MOUSE_REPORT_NUMBER_BUTTON */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	uint8_t zero;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	uint8_t type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	uint8_t data1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	uint8_t data2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	uint8_t zero2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	uint8_t unknown[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static struct class *konepure_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) ROCCAT_COMMON2_BIN_ATTRIBUTE_W(control, 0x04, 0x03);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(actual_profile, 0x05, 0x03);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile_settings, 0x06, 0x1f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile_buttons, 0x07, 0x3b);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) ROCCAT_COMMON2_BIN_ATTRIBUTE_W(macro, 0x08, 0x0822);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(info, 0x09, 0x06);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(tcu, 0x0c, 0x04);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) ROCCAT_COMMON2_BIN_ATTRIBUTE_R(tcu_image, 0x0c, 0x0404);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(sensor, 0x0f, 0x06);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) ROCCAT_COMMON2_BIN_ATTRIBUTE_W(talk, 0x10, 0x10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) static struct bin_attribute *konepure_bin_attrs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	&bin_attr_actual_profile,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	&bin_attr_control,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	&bin_attr_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	&bin_attr_talk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	&bin_attr_macro,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	&bin_attr_sensor,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	&bin_attr_tcu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	&bin_attr_tcu_image,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	&bin_attr_profile_settings,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	&bin_attr_profile_buttons,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) static const struct attribute_group konepure_group = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	.bin_attrs = konepure_bin_attrs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) static const struct attribute_group *konepure_groups[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	&konepure_group,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static int konepure_init_specials(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	struct usb_device *usb_dev = interface_to_usbdev(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	struct roccat_common2_device *konepure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	if (intf->cur_altsetting->desc.bInterfaceProtocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			!= USB_INTERFACE_PROTOCOL_MOUSE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		hid_set_drvdata(hdev, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	konepure = kzalloc(sizeof(*konepure), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	if (!konepure) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		hid_err(hdev, "can't alloc device descriptor\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	hid_set_drvdata(hdev, konepure);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	retval = roccat_common2_device_init_struct(usb_dev, konepure);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		hid_err(hdev, "couldn't init KonePure device\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		goto exit_free;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	retval = roccat_connect(konepure_class, hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 			sizeof(struct konepure_mouse_report_button));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if (retval < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		hid_err(hdev, "couldn't init char dev\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		konepure->chrdev_minor = retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		konepure->roccat_claimed = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) exit_free:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	kfree(konepure);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) static void konepure_remove_specials(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	struct roccat_common2_device *konepure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	if (intf->cur_altsetting->desc.bInterfaceProtocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			!= USB_INTERFACE_PROTOCOL_MOUSE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	konepure = hid_get_drvdata(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	if (konepure->roccat_claimed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		roccat_disconnect(konepure->chrdev_minor);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	kfree(konepure);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) static int konepure_probe(struct hid_device *hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		const struct hid_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	if (!hid_is_usb(hdev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	retval = hid_parse(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		hid_err(hdev, "parse failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		goto exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		hid_err(hdev, "hw start failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		goto exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	retval = konepure_init_specials(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	if (retval) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		hid_err(hdev, "couldn't install mouse\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		goto exit_stop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) exit_stop:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	hid_hw_stop(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) exit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) static void konepure_remove(struct hid_device *hdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	konepure_remove_specials(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	hid_hw_stop(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) static int konepure_raw_event(struct hid_device *hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		struct hid_report *report, u8 *data, int size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	struct roccat_common2_device *konepure = hid_get_drvdata(hdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	if (intf->cur_altsetting->desc.bInterfaceProtocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 			!= USB_INTERFACE_PROTOCOL_MOUSE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	if (data[0] != KONEPURE_MOUSE_REPORT_NUMBER_BUTTON)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	if (konepure != NULL && konepure->roccat_claimed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		roccat_report_event(konepure->chrdev_minor, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) static const struct hid_device_id konepure_devices[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) MODULE_DEVICE_TABLE(hid, konepure_devices);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) static struct hid_driver konepure_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		.name = "konepure",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		.id_table = konepure_devices,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		.probe = konepure_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		.remove = konepure_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		.raw_event = konepure_raw_event
^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 int __init konepure_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	int retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	konepure_class = class_create(THIS_MODULE, "konepure");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	if (IS_ERR(konepure_class))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		return PTR_ERR(konepure_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	konepure_class->dev_groups = konepure_groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	retval = hid_register_driver(&konepure_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	if (retval)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		class_destroy(konepure_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static void __exit konepure_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	hid_unregister_driver(&konepure_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	class_destroy(konepure_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) module_init(konepure_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) module_exit(konepure_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) MODULE_AUTHOR("Stefan Achatz");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) MODULE_DESCRIPTION("USB Roccat KonePure/Optical driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) MODULE_LICENSE("GPL v2");