Lines Matching refs:kone

33 #include "hid-roccat-kone.h"
37 static void kone_profile_activated(struct kone_device *kone, uint new_profile)
39 kone->actual_profile = new_profile;
40 kone->actual_dpi = kone->profiles[new_profile - 1].startup_dpi;
43 static void kone_profile_report(struct kone_device *kone, uint new_profile)
50 roccat_report_event(kone->chrdev_minor, (uint8_t *)&roccat_report);
267 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
275 mutex_lock(&kone->kone_lock);
276 memcpy(buf, ((char const *)&kone->settings) + off, count);
277 mutex_unlock(&kone->kone_lock);
291 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
300 mutex_lock(&kone->kone_lock);
301 difference = memcmp(settings, &kone->settings,
314 old_profile = kone->settings.startup_profile;
315 memcpy(&kone->settings, settings, sizeof(struct kone_settings));
317 kone_profile_activated(kone, kone->settings.startup_profile);
319 if (kone->settings.startup_profile != old_profile)
320 kone_profile_report(kone, kone->settings.startup_profile);
323 mutex_unlock(&kone->kone_lock);
337 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
345 mutex_lock(&kone->kone_lock);
346 memcpy(buf, ((char const *)&kone->profiles[*(uint *)(attr->private)]) + off, count);
347 mutex_unlock(&kone->kone_lock);
357 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
366 profile = &kone->profiles[*(uint *)(attr->private)];
368 mutex_lock(&kone->kone_lock);
377 mutex_unlock(&kone->kone_lock);
401 struct kone_device *kone =
403 return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
410 struct kone_device *kone =
412 return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
420 struct kone_device *kone;
426 kone = hid_get_drvdata(dev_get_drvdata(dev));
429 mutex_lock(&kone->kone_lock);
431 mutex_unlock(&kone->kone_lock);
442 struct kone_device *kone =
444 return snprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
452 struct kone_device *kone =
454 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
472 struct kone_device *kone;
478 kone = hid_get_drvdata(dev_get_drvdata(dev));
488 mutex_lock(&kone->kone_lock);
517 retval = kone_get_settings(usb_dev, &kone->settings);
522 if (kone->settings.tcu != state) {
523 kone->settings.tcu = state;
524 kone_set_settings_checksum(&kone->settings);
526 retval = kone_set_settings(usb_dev, &kone->settings);
533 retval = kone_get_settings(usb_dev, &kone->settings);
539 kone_profile_activated(kone, kone->settings.startup_profile);
546 mutex_unlock(&kone->kone_lock);
554 struct kone_device *kone =
556 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
562 struct kone_device *kone;
568 kone = hid_get_drvdata(dev_get_drvdata(dev));
578 mutex_lock(&kone->kone_lock);
580 kone->settings.startup_profile = new_startup_profile;
581 kone_set_settings_checksum(&kone->settings);
583 retval = kone_set_settings(usb_dev, &kone->settings);
585 mutex_unlock(&kone->kone_lock);
590 kone_profile_activated(kone, new_startup_profile);
591 kone_profile_report(kone, new_startup_profile);
593 mutex_unlock(&kone->kone_lock);
659 .name = "kone",
664 struct kone_device *kone)
669 mutex_init(&kone->kone_lock);
672 retval = kone_get_profile(usb_dev, &kone->profiles[i], i + 1);
677 retval = kone_get_settings(usb_dev, &kone->settings);
681 retval = kone_get_firmware_version(usb_dev, &kone->firmware_version);
685 kone_profile_activated(kone, kone->settings.startup_profile);
692 * mousepart if usb_hid is compiled into the kernel and kone is compiled as
701 struct kone_device *kone;
707 kone = kzalloc(sizeof(*kone), GFP_KERNEL);
708 if (!kone)
710 hid_set_drvdata(hdev, kone);
712 retval = kone_init_kone_device_struct(usb_dev, kone);
724 kone->roccat_claimed = 1;
725 kone->chrdev_minor = retval;
733 kfree(kone);
740 struct kone_device *kone;
744 kone = hid_get_drvdata(hdev);
745 if (kone->roccat_claimed)
746 roccat_disconnect(kone->chrdev_minor);
791 static void kone_keep_values_up_to_date(struct kone_device *kone,
796 kone->actual_dpi = kone->profiles[event->value - 1].
800 kone->actual_profile = event->value;
804 kone->actual_dpi = event->value;
809 static void kone_report_to_chrdev(struct kone_device const *kone,
822 roccat_report_event(kone->chrdev_minor,
829 roccat_report.value = kone->actual_profile;
831 roccat_report_event(kone->chrdev_minor,
847 struct kone_device *kone = hid_get_drvdata(hdev);
854 if (kone == NULL)
862 if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
863 memcpy(&kone->last_mouse_event, event,
868 kone_keep_values_up_to_date(kone, event);
870 if (kone->roccat_claimed)
871 kone_report_to_chrdev(kone, event);
884 .name = "kone",