Lines Matching refs:pyra
35 static void profile_activated(struct pyra_device *pyra, in profile_activated() argument
38 if (new_profile >= ARRAY_SIZE(pyra->profile_settings)) in profile_activated()
40 pyra->actual_profile = new_profile; in profile_activated()
41 pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi; in profile_activated()
95 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_read() local
105 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_read()
107 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_read()
121 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write() local
128 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write()
130 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write()
253 struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_write_settings() local
263 if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings)) in pyra_sysfs_write_settings()
266 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
270 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
274 profile_activated(pyra, settings->startup_profile); in pyra_sysfs_write_settings()
279 roccat_report_event(pyra->chrdev_minor, in pyra_sysfs_write_settings()
282 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
295 struct pyra_device *pyra = in pyra_sysfs_show_actual_cpi() local
297 return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi); in pyra_sysfs_show_actual_cpi()
304 struct pyra_device *pyra = in pyra_sysfs_show_actual_profile() local
309 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
312 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
322 struct pyra_device *pyra; in pyra_sysfs_show_firmware_version() local
327 pyra = hid_get_drvdata(dev_get_drvdata(dev)); in pyra_sysfs_show_firmware_version()
330 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
333 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
378 struct pyra_device *pyra) in pyra_init_pyra_device_struct() argument
383 mutex_init(&pyra->pyra_lock); in pyra_init_pyra_device_struct()
391 &pyra->profile_settings[i], i); in pyra_init_pyra_device_struct()
396 profile_activated(pyra, settings.startup_profile); in pyra_init_pyra_device_struct()
405 struct pyra_device *pyra; in pyra_init_specials() local
411 pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); in pyra_init_specials()
412 if (!pyra) { in pyra_init_specials()
416 hid_set_drvdata(hdev, pyra); in pyra_init_specials()
418 retval = pyra_init_pyra_device_struct(usb_dev, pyra); in pyra_init_specials()
429 pyra->chrdev_minor = retval; in pyra_init_specials()
430 pyra->roccat_claimed = 1; in pyra_init_specials()
438 kfree(pyra); in pyra_init_specials()
445 struct pyra_device *pyra; in pyra_remove_specials() local
449 pyra = hid_get_drvdata(hdev); in pyra_remove_specials()
450 if (pyra->roccat_claimed) in pyra_remove_specials()
451 roccat_disconnect(pyra->chrdev_minor); in pyra_remove_specials()
491 static void pyra_keep_values_up_to_date(struct pyra_device *pyra, in pyra_keep_values_up_to_date() argument
501 profile_activated(pyra, button_event->data1 - 1); in pyra_keep_values_up_to_date()
504 pyra->actual_cpi = button_event->data1; in pyra_keep_values_up_to_date()
511 static void pyra_report_to_chrdev(struct pyra_device const *pyra, in pyra_report_to_chrdev() argument
528 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
541 roccat_report.value = pyra->actual_profile + 1; in pyra_report_to_chrdev()
542 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
553 struct pyra_device *pyra = hid_get_drvdata(hdev); in pyra_raw_event() local
559 if (pyra == NULL) in pyra_raw_event()
562 pyra_keep_values_up_to_date(pyra, data); in pyra_raw_event()
564 if (pyra->roccat_claimed) in pyra_raw_event()
565 pyra_report_to_chrdev(pyra, data); in pyra_raw_event()