Lines Matching refs:pyra
29 static void profile_activated(struct pyra_device *pyra, in profile_activated() argument
32 if (new_profile >= ARRAY_SIZE(pyra->profile_settings)) in profile_activated()
34 pyra->actual_profile = new_profile; in profile_activated()
35 pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi; in profile_activated()
88 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_read() local
98 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_read()
100 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_read()
113 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write() local
120 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write()
122 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write()
242 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write_settings() local
252 if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings)) in pyra_sysfs_write_settings()
255 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
259 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
263 profile_activated(pyra, settings->startup_profile); in pyra_sysfs_write_settings()
268 roccat_report_event(pyra->chrdev_minor, in pyra_sysfs_write_settings()
271 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
284 struct pyra_device *pyra = in pyra_sysfs_show_actual_cpi() local
286 return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi); in pyra_sysfs_show_actual_cpi()
293 struct pyra_device *pyra = in pyra_sysfs_show_actual_profile() local
298 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
301 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
311 struct pyra_device *pyra; in pyra_sysfs_show_firmware_version() local
316 pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_show_firmware_version()
319 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
322 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
373 struct pyra_device *pyra) in pyra_init_pyra_device_struct() argument
378 mutex_init(&pyra->pyra_lock); in pyra_init_pyra_device_struct()
386 &pyra->profile_settings[i], i); in pyra_init_pyra_device_struct()
391 profile_activated(pyra, settings.startup_profile); in pyra_init_pyra_device_struct()
400 struct pyra_device *pyra; in pyra_init_specials() local
406 pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); in pyra_init_specials()
407 if (!pyra) { in pyra_init_specials()
411 hid_set_drvdata(hdev, pyra); in pyra_init_specials()
413 retval = pyra_init_pyra_device_struct(usb_dev, pyra); in pyra_init_specials()
424 pyra->chrdev_minor = retval; in pyra_init_specials()
425 pyra->roccat_claimed = 1; in pyra_init_specials()
433 kfree(pyra); in pyra_init_specials()
440 struct pyra_device *pyra; in pyra_remove_specials() local
444 pyra = hid_get_drvdata(hdev); in pyra_remove_specials()
445 if (pyra->roccat_claimed) in pyra_remove_specials()
446 roccat_disconnect(pyra->chrdev_minor); in pyra_remove_specials()
489 static void pyra_keep_values_up_to_date(struct pyra_device *pyra, in pyra_keep_values_up_to_date() argument
499 profile_activated(pyra, button_event->data1 - 1); in pyra_keep_values_up_to_date()
502 pyra->actual_cpi = button_event->data1; in pyra_keep_values_up_to_date()
509 static void pyra_report_to_chrdev(struct pyra_device const *pyra, in pyra_report_to_chrdev() argument
526 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
539 roccat_report.value = pyra->actual_profile + 1; in pyra_report_to_chrdev()
540 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
551 struct pyra_device *pyra = hid_get_drvdata(hdev); in pyra_raw_event() local
557 if (pyra == NULL) in pyra_raw_event()
560 pyra_keep_values_up_to_date(pyra, data); in pyra_raw_event()
562 if (pyra->roccat_claimed) in pyra_raw_event()
563 pyra_report_to_chrdev(pyra, data); in pyra_raw_event()