Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8211e460 authored by Stefan Achatz's avatar Stefan Achatz Committed by Jiri Kosina
Browse files

HID: roccat: Add ioctl command to retreive report size from chardev



Roccat chardev was reworked to support only a defined report size per
device and this can be retreived by an ioctl now to enable future changes
in report definitions.
Header was moved/renamed from drivers/hid to include/linux for accessibility.

Signed-off-by: default avatarStefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 432762e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ Code Seq#(hex) Include File Comments
'H'	C0-DF	net/bluetooth/hidp/hidp.h	conflict!
'H'	C0-DF	net/bluetooth/cmtp/cmtp.h	conflict!
'H'	C0-DF	net/bluetooth/bnep/bnep.h	conflict!
'H'	F1	linux/roccat.h		<mailto:erazor_de@users.sourceforge.net>
'I'	all	linux/isdn.h		conflict!
'I'	00-0F	drivers/isdn/divert/isdn_divert.h	conflict!
'I'	40-4F	linux/mISDNif.h		conflict!
+5 −4
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/roccat.h>
#include "hid-ids.h"
#include "hid-roccat.h"
#include "hid-roccat-common.h"
#include "hid-roccat-arvo.h"

@@ -303,7 +303,8 @@ static int arvo_init_specials(struct hid_device *hdev)
		goto exit_free;
	}

	retval = roccat_connect(arvo_class, hdev);
	retval = roccat_connect(arvo_class, hdev,
			sizeof(struct arvo_roccat_report));
	if (retval < 0) {
		hid_err(hdev, "couldn't init char dev\n");
	} else {
@@ -386,8 +387,8 @@ static void arvo_report_to_chrdev(struct arvo_device const *arvo,
	else
		roccat_report.action = ARVO_ROCCAT_REPORT_ACTION_RELEASE;

	roccat_report_event(arvo->chrdev_minor, (uint8_t const *)&roccat_report,
			sizeof(struct arvo_roccat_report));
	roccat_report_event(arvo->chrdev_minor,
			(uint8_t const *)&roccat_report);
}

static int arvo_raw_event(struct hid_device *hdev,
+5 −6
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/roccat.h>
#include "hid-ids.h"
#include "hid-roccat.h"
#include "hid-roccat-common.h"
#include "hid-roccat-kone.h"

@@ -660,7 +660,8 @@ static int kone_init_specials(struct hid_device *hdev)
			goto exit_free;
		}

		retval = roccat_connect(kone_class, hdev);
		retval = roccat_connect(kone_class, hdev,
				sizeof(struct kone_roccat_report));
		if (retval < 0) {
			hid_err(hdev, "couldn't init char dev\n");
			/* be tolerant about not getting chrdev */
@@ -760,8 +761,7 @@ static void kone_report_to_chrdev(struct kone_device const *kone,
		roccat_report.value = event->value;
		roccat_report.key = 0;
		roccat_report_event(kone->chrdev_minor,
				(uint8_t *)&roccat_report,
				sizeof(struct kone_roccat_report));
				(uint8_t *)&roccat_report);
		break;
	case kone_mouse_event_call_overlong_macro:
		if (event->value == kone_keystroke_action_press) {
@@ -769,8 +769,7 @@ static void kone_report_to_chrdev(struct kone_device const *kone,
			roccat_report.value = kone->actual_profile;
			roccat_report.key = event->macro_key;
			roccat_report_event(kone->chrdev_minor,
					(uint8_t *)&roccat_report,
					sizeof(struct kone_roccat_report));
					(uint8_t *)&roccat_report);
		}
		break;
	}
+4 −4
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/roccat.h>
#include "hid-ids.h"
#include "hid-roccat.h"
#include "hid-roccat-common.h"
#include "hid-roccat-koneplus.h"

@@ -612,7 +612,8 @@ static int koneplus_init_specials(struct hid_device *hdev)
			goto exit_free;
		}

		retval = roccat_connect(koneplus_class, hdev);
		retval = roccat_connect(koneplus_class, hdev,
				sizeof(struct koneplus_roccat_report));
		if (retval < 0) {
			hid_err(hdev, "couldn't init char dev\n");
		} else {
@@ -718,8 +719,7 @@ static void koneplus_report_to_chrdev(struct koneplus_device const *koneplus,
	roccat_report.data2 = button_report->data2;
	roccat_report.profile = koneplus->actual_profile + 1;
	roccat_report_event(koneplus->chrdev_minor,
			(uint8_t const *)&roccat_report,
			sizeof(struct koneplus_roccat_report));
			(uint8_t const *)&roccat_report);
}

static int koneplus_raw_event(struct hid_device *hdev,
+4 −4
Original line number Diff line number Diff line
@@ -20,8 +20,8 @@
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/roccat.h>
#include "hid-ids.h"
#include "hid-roccat.h"
#include "hid-roccat-common.h"
#include "hid-roccat-kovaplus.h"

@@ -524,7 +524,8 @@ static int kovaplus_init_specials(struct hid_device *hdev)
			goto exit_free;
		}

		retval = roccat_connect(kovaplus_class, hdev);
		retval = roccat_connect(kovaplus_class, hdev,
				sizeof(struct kovaplus_roccat_report));
		if (retval < 0) {
			hid_err(hdev, "couldn't init char dev\n");
		} else {
@@ -648,8 +649,7 @@ static void kovaplus_report_to_chrdev(struct kovaplus_device const *kovaplus,
	roccat_report.data2 = button_report->data2;

	roccat_report_event(kovaplus->chrdev_minor,
			(uint8_t const *)&roccat_report,
			sizeof(struct kovaplus_roccat_report));
			(uint8_t const *)&roccat_report);
}

static int kovaplus_raw_event(struct hid_device *hdev,
Loading