Lines Matching defs: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);
270 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
278 mutex_lock(&kone->kone_lock);
279 memcpy(buf, ((char const *)&kone->settings) + off, count);
280 mutex_unlock(&kone->kone_lock);
294 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
303 mutex_lock(&kone->kone_lock);
304 difference = memcmp(settings, &kone->settings,
317 old_profile = kone->settings.startup_profile;
318 memcpy(&kone->settings, settings, sizeof(struct kone_settings));
320 kone_profile_activated(kone, kone->settings.startup_profile);
322 if (kone->settings.startup_profile != old_profile)
323 kone_profile_report(kone, kone->settings.startup_profile);
326 mutex_unlock(&kone->kone_lock);
340 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
348 mutex_lock(&kone->kone_lock);
349 memcpy(buf, ((char const *)&kone->profiles[*(uint *)(attr->private)]) + off, count);
350 mutex_unlock(&kone->kone_lock);
360 struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
369 profile = &kone->profiles[*(uint *)(attr->private)];
371 mutex_lock(&kone->kone_lock);
380 mutex_unlock(&kone->kone_lock);
404 struct kone_device *kone =
406 return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_profile);
413 struct kone_device *kone =
415 return snprintf(buf, PAGE_SIZE, "%d\n", kone->actual_dpi);
423 struct kone_device *kone;
429 kone = hid_get_drvdata(dev_get_drvdata(dev));
432 mutex_lock(&kone->kone_lock);
434 mutex_unlock(&kone->kone_lock);
445 struct kone_device *kone =
447 return snprintf(buf, PAGE_SIZE, "%d\n", kone->firmware_version);
455 struct kone_device *kone =
457 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.tcu);
475 struct kone_device *kone;
481 kone = hid_get_drvdata(dev_get_drvdata(dev));
491 mutex_lock(&kone->kone_lock);
520 retval = kone_get_settings(usb_dev, &kone->settings);
525 if (kone->settings.tcu != state) {
526 kone->settings.tcu = state;
527 kone_set_settings_checksum(&kone->settings);
529 retval = kone_set_settings(usb_dev, &kone->settings);
536 retval = kone_get_settings(usb_dev, &kone->settings);
542 kone_profile_activated(kone, kone->settings.startup_profile);
549 mutex_unlock(&kone->kone_lock);
557 struct kone_device *kone =
559 return snprintf(buf, PAGE_SIZE, "%d\n", kone->settings.startup_profile);
565 struct kone_device *kone;
571 kone = hid_get_drvdata(dev_get_drvdata(dev));
581 mutex_lock(&kone->kone_lock);
583 kone->settings.startup_profile = new_startup_profile;
584 kone_set_settings_checksum(&kone->settings);
586 retval = kone_set_settings(usb_dev, &kone->settings);
588 mutex_unlock(&kone->kone_lock);
593 kone_profile_activated(kone, new_startup_profile);
594 kone_profile_report(kone, new_startup_profile);
596 mutex_unlock(&kone->kone_lock);
661 struct kone_device *kone)
666 mutex_init(&kone->kone_lock);
669 retval = kone_get_profile(usb_dev, &kone->profiles[i], i + 1);
674 retval = kone_get_settings(usb_dev, &kone->settings);
678 retval = kone_get_firmware_version(usb_dev, &kone->firmware_version);
682 kone_profile_activated(kone, kone->settings.startup_profile);
689 * mousepart if usb_hid is compiled into the kernel and kone is compiled as
698 struct kone_device *kone;
704 kone = kzalloc(sizeof(*kone), GFP_KERNEL);
705 if (!kone)
707 hid_set_drvdata(hdev, kone);
709 retval = kone_init_kone_device_struct(usb_dev, kone);
721 kone->roccat_claimed = 1;
722 kone->chrdev_minor = retval;
730 kfree(kone);
737 struct kone_device *kone;
741 kone = hid_get_drvdata(hdev);
742 if (kone->roccat_claimed)
743 roccat_disconnect(kone->chrdev_minor);
788 static void kone_keep_values_up_to_date(struct kone_device *kone,
793 kone->actual_dpi = kone->profiles[event->value - 1].
797 kone->actual_profile = event->value;
801 kone->actual_dpi = event->value;
806 static void kone_report_to_chrdev(struct kone_device const *kone,
819 roccat_report_event(kone->chrdev_minor,
826 roccat_report.value = kone->actual_profile;
828 roccat_report_event(kone->chrdev_minor,
844 struct kone_device *kone = hid_get_drvdata(hdev);
851 if (kone == NULL)
859 if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5))
860 memcpy(&kone->last_mouse_event, event,
865 kone_keep_values_up_to_date(kone, event);
867 if (kone->roccat_claimed)
868 kone_report_to_chrdev(kone, event);
881 .name = "kone",
893 kone_class = class_create(THIS_MODULE, "kone");