Lines Matching refs:pyra
32 static void profile_activated(struct pyra_device *pyra, in profile_activated() argument
35 if (new_profile >= ARRAY_SIZE(pyra->profile_settings)) in profile_activated()
37 pyra->actual_profile = new_profile; in profile_activated()
38 pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi; in profile_activated()
91 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_read() local
101 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_read()
103 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_read()
116 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write() local
123 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write()
125 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write()
245 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write_settings() local
255 if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings)) in pyra_sysfs_write_settings()
258 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
262 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
266 profile_activated(pyra, settings->startup_profile); in pyra_sysfs_write_settings()
271 roccat_report_event(pyra->chrdev_minor, in pyra_sysfs_write_settings()
274 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
287 struct pyra_device *pyra = in pyra_sysfs_show_actual_cpi() local
289 return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi); in pyra_sysfs_show_actual_cpi()
296 struct pyra_device *pyra = in pyra_sysfs_show_actual_profile() local
301 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
304 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
314 struct pyra_device *pyra; in pyra_sysfs_show_firmware_version() local
319 pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_show_firmware_version()
322 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
325 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
370 struct pyra_device *pyra) in pyra_init_pyra_device_struct() argument
375 mutex_init(&pyra->pyra_lock); in pyra_init_pyra_device_struct()
383 &pyra->profile_settings[i], i); in pyra_init_pyra_device_struct()
388 profile_activated(pyra, settings.startup_profile); in pyra_init_pyra_device_struct()
397 struct pyra_device *pyra; in pyra_init_specials() local
403 pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); in pyra_init_specials()
404 if (!pyra) { in pyra_init_specials()
408 hid_set_drvdata(hdev, pyra); in pyra_init_specials()
410 retval = pyra_init_pyra_device_struct(usb_dev, pyra); in pyra_init_specials()
421 pyra->chrdev_minor = retval; in pyra_init_specials()
422 pyra->roccat_claimed = 1; in pyra_init_specials()
430 kfree(pyra); in pyra_init_specials()
437 struct pyra_device *pyra; in pyra_remove_specials() local
441 pyra = hid_get_drvdata(hdev); in pyra_remove_specials()
442 if (pyra->roccat_claimed) in pyra_remove_specials()
443 roccat_disconnect(pyra->chrdev_minor); in pyra_remove_specials()
486 static void pyra_keep_values_up_to_date(struct pyra_device *pyra, in pyra_keep_values_up_to_date() argument
496 profile_activated(pyra, button_event->data1 - 1); in pyra_keep_values_up_to_date()
499 pyra->actual_cpi = button_event->data1; in pyra_keep_values_up_to_date()
506 static void pyra_report_to_chrdev(struct pyra_device const *pyra, in pyra_report_to_chrdev() argument
523 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
536 roccat_report.value = pyra->actual_profile + 1; in pyra_report_to_chrdev()
537 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
548 struct pyra_device *pyra = hid_get_drvdata(hdev); in pyra_raw_event() local
554 if (pyra == NULL) in pyra_raw_event()
557 pyra_keep_values_up_to_date(pyra, data); in pyra_raw_event()
559 if (pyra->roccat_claimed) in pyra_raw_event()
560 pyra_report_to_chrdev(pyra, data); in pyra_raw_event()