diff mbox

[4/5] HID: refactored special event handling in Roccat Kone

Message ID 1273679086.2927.7.camel@localhost (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Stefan Achatz May 12, 2010, 3:44 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/hid/hid-roccat-kone.c
b/drivers/hid/hid-roccat-kone.c
index 0b1db24..66e6940 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -912,6 +912,24 @@  static void kone_remove(struct hid_device *hdev)
 	hid_hw_stop(hdev);
 }
 
+/* handle special events and keep actual profile and dpi values up to
date */
+static void kone_keep_values_up_to_date(struct kone_device *kone,
+		struct kone_mouse_event const *event)
+{
+	switch (event->event) {
+	case kone_mouse_event_switch_profile:
+	case kone_mouse_event_osd_profile:
+		kone->actual_profile = event->value;
+		kone->actual_dpi = kone->profiles[kone->actual_profile - 1].
+				startup_dpi;
+		break;
+	case kone_mouse_event_switch_dpi:
+	case kone_mouse_event_osd_dpi:
+		kone->actual_dpi = event->value;
+		break;
+	}
+}
+
 /*
  * Is called for keyboard- and mousepart.