Lines Matching refs:kovaplus

32 static void kovaplus_profile_activated(struct kovaplus_device *kovaplus,  in kovaplus_profile_activated()  argument
35 if (new_profile_index >= ARRAY_SIZE(kovaplus->profile_settings)) in kovaplus_profile_activated()
37 kovaplus->actual_profile = new_profile_index; in kovaplus_profile_activated()
38 kovaplus->actual_cpi = kovaplus->profile_settings[new_profile_index].cpi_startup_level; in kovaplus_profile_activated()
39 kovaplus->actual_x_sensitivity = kovaplus->profile_settings[new_profile_index].sensitivity_x; in kovaplus_profile_activated()
40 kovaplus->actual_y_sensitivity = kovaplus->profile_settings[new_profile_index].sensitivity_y; in kovaplus_profile_activated()
129 struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); in kovaplus_sysfs_read() local
139 mutex_lock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_read()
141 mutex_unlock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_read()
154 struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); in kovaplus_sysfs_write() local
161 mutex_lock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_write()
164 mutex_unlock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_write()
273 struct kovaplus_device *kovaplus = in kovaplus_sysfs_show_actual_profile() local
275 return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile); in kovaplus_sysfs_show_actual_profile()
281 struct kovaplus_device *kovaplus; in kovaplus_sysfs_set_actual_profile() local
288 kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); in kovaplus_sysfs_set_actual_profile()
298 mutex_lock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_set_actual_profile()
301 mutex_unlock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_set_actual_profile()
305 kovaplus_profile_activated(kovaplus, profile); in kovaplus_sysfs_set_actual_profile()
312 roccat_report_event(kovaplus->chrdev_minor, in kovaplus_sysfs_set_actual_profile()
315 mutex_unlock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_set_actual_profile()
326 struct kovaplus_device *kovaplus = in kovaplus_sysfs_show_actual_cpi() local
328 return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi); in kovaplus_sysfs_show_actual_cpi()
335 struct kovaplus_device *kovaplus = in kovaplus_sysfs_show_actual_sensitivity_x() local
337 return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity); in kovaplus_sysfs_show_actual_sensitivity_x()
345 struct kovaplus_device *kovaplus = in kovaplus_sysfs_show_actual_sensitivity_y() local
347 return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity); in kovaplus_sysfs_show_actual_sensitivity_y()
355 struct kovaplus_device *kovaplus; in kovaplus_sysfs_show_firmware_version() local
360 kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); in kovaplus_sysfs_show_firmware_version()
363 mutex_lock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_show_firmware_version()
366 mutex_unlock(&kovaplus->kovaplus_lock); in kovaplus_sysfs_show_firmware_version()
416 struct kovaplus_device *kovaplus) in kovaplus_init_kovaplus_device_struct() argument
421 mutex_init(&kovaplus->kovaplus_lock); in kovaplus_init_kovaplus_device_struct()
426 &kovaplus->profile_settings[i], i); in kovaplus_init_kovaplus_device_struct()
432 &kovaplus->profile_buttons[i], i); in kovaplus_init_kovaplus_device_struct()
441 kovaplus_profile_activated(kovaplus, retval); in kovaplus_init_kovaplus_device_struct()
450 struct kovaplus_device *kovaplus; in kovaplus_init_specials() local
456 kovaplus = kzalloc(sizeof(*kovaplus), GFP_KERNEL); in kovaplus_init_specials()
457 if (!kovaplus) { in kovaplus_init_specials()
461 hid_set_drvdata(hdev, kovaplus); in kovaplus_init_specials()
463 retval = kovaplus_init_kovaplus_device_struct(usb_dev, kovaplus); in kovaplus_init_specials()
474 kovaplus->chrdev_minor = retval; in kovaplus_init_specials()
475 kovaplus->roccat_claimed = 1; in kovaplus_init_specials()
484 kfree(kovaplus); in kovaplus_init_specials()
491 struct kovaplus_device *kovaplus; in kovaplus_remove_specials() local
495 kovaplus = hid_get_drvdata(hdev); in kovaplus_remove_specials()
496 if (kovaplus->roccat_claimed) in kovaplus_remove_specials()
497 roccat_disconnect(kovaplus->chrdev_minor); in kovaplus_remove_specials()
498 kfree(kovaplus); in kovaplus_remove_specials()
542 static void kovaplus_keep_values_up_to_date(struct kovaplus_device *kovaplus, in kovaplus_keep_values_up_to_date() argument
554 kovaplus_profile_activated(kovaplus, button_report->data1 - 1); in kovaplus_keep_values_up_to_date()
557 kovaplus->actual_cpi = kovaplus_convert_event_cpi(button_report->data1); in kovaplus_keep_values_up_to_date()
560 kovaplus->actual_x_sensitivity = button_report->data1; in kovaplus_keep_values_up_to_date()
561 kovaplus->actual_y_sensitivity = button_report->data2; in kovaplus_keep_values_up_to_date()
568 static void kovaplus_report_to_chrdev(struct kovaplus_device const *kovaplus, in kovaplus_report_to_chrdev() argument
583 roccat_report.profile = kovaplus->actual_profile + 1; in kovaplus_report_to_chrdev()
600 roccat_report_event(kovaplus->chrdev_minor, in kovaplus_report_to_chrdev()
608 struct kovaplus_device *kovaplus = hid_get_drvdata(hdev); in kovaplus_raw_event() local
614 if (kovaplus == NULL) in kovaplus_raw_event()
617 kovaplus_keep_values_up_to_date(kovaplus, data); in kovaplus_raw_event()
619 if (kovaplus->roccat_claimed) in kovaplus_raw_event()
620 kovaplus_report_to_chrdev(kovaplus, data); in kovaplus_raw_event()