• Home
  • Raw
  • Download

Lines Matching +full:control +full:- +full:parent

25 #include <linux/hid-roccat.h>
26 #include "hid-ids.h"
27 #include "hid-roccat-common.h"
28 #include "hid-roccat-pyra.h"
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()
47 struct roccat_common2_control control; in pyra_send_control() local
52 return -EINVAL; in pyra_send_control()
54 control.command = ROCCAT_COMMON_COMMAND_CONTROL; in pyra_send_control()
55 control.value = value; in pyra_send_control()
56 control.request = request; in pyra_send_control()
59 &control, sizeof(struct roccat_common2_control)); in pyra_send_control()
93 struct device *dev = kobj_to_dev(kobj)->parent->parent; in pyra_sysfs_read()
102 return -EINVAL; in pyra_sysfs_read()
104 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_read()
106 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_read()
118 struct device *dev = kobj_to_dev(kobj)->parent->parent; in pyra_sysfs_write()
124 return -EINVAL; in pyra_sysfs_write()
126 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write()
128 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write()
183 PYRA_BIN_ATTRIBUTE_W(control, CONTROL);
192 struct device *dev = kobj_to_dev(kobj)->parent->parent; in pyra_sysfs_read_profilex_settings()
196 retval = pyra_send_control(usb_dev, *(uint *)(attr->private), in pyra_sysfs_read_profilex_settings()
210 struct device *dev = kobj_to_dev(kobj)->parent->parent; in pyra_sysfs_read_profilex_buttons()
214 retval = pyra_send_control(usb_dev, *(uint *)(attr->private), in pyra_sysfs_read_profilex_buttons()
229 .private = &profile_numbers[number-1], \
235 .private = &profile_numbers[number-1], \
247 struct device *dev = kobj_to_dev(kobj)->parent->parent; in pyra_sysfs_write_settings()
255 return -EINVAL; in pyra_sysfs_write_settings()
258 if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings)) in pyra_sysfs_write_settings()
259 return -EINVAL; in pyra_sysfs_write_settings()
261 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
265 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
269 profile_activated(pyra, settings->startup_profile); in pyra_sysfs_write_settings()
272 roccat_report.value = settings->startup_profile + 1; in pyra_sysfs_write_settings()
274 roccat_report_event(pyra->chrdev_minor, in pyra_sysfs_write_settings()
277 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_write_settings()
291 hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); in pyra_sysfs_show_actual_cpi()
292 return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi); in pyra_sysfs_show_actual_cpi()
300 hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); in pyra_sysfs_show_actual_profile()
304 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
307 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_actual_profile()
321 dev = dev->parent->parent; in pyra_sysfs_show_firmware_version()
325 mutex_lock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
328 mutex_unlock(&pyra->pyra_lock); in pyra_sysfs_show_firmware_version()
378 mutex_init(&pyra->pyra_lock); in pyra_init_pyra_device_struct()
386 &pyra->profile_settings[i], i); in pyra_init_pyra_device_struct()
398 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in pyra_init_specials()
403 if (intf->cur_altsetting->desc.bInterfaceProtocol in pyra_init_specials()
409 return -ENOMEM; in pyra_init_specials()
424 pyra->chrdev_minor = retval; in pyra_init_specials()
425 pyra->roccat_claimed = 1; in pyra_init_specials()
439 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in pyra_remove_specials()
442 if (intf->cur_altsetting->desc.bInterfaceProtocol in pyra_remove_specials()
445 if (pyra->roccat_claimed) in pyra_remove_specials()
446 roccat_disconnect(pyra->chrdev_minor); in pyra_remove_specials()
494 switch (button_event->type) { in pyra_keep_values_up_to_date()
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()
517 switch (button_event->type) { in pyra_report_to_chrdev()
520 roccat_report.type = button_event->type; in pyra_report_to_chrdev()
521 roccat_report.value = button_event->data1; in pyra_report_to_chrdev()
523 roccat_report_event(pyra->chrdev_minor, in pyra_report_to_chrdev()
529 if (button_event->data2 == PYRA_MOUSE_EVENT_BUTTON_PRESS) { in pyra_report_to_chrdev()
530 roccat_report.type = button_event->type; in pyra_report_to_chrdev()
531 roccat_report.key = button_event->data1; in pyra_report_to_chrdev()
533 * pyra reports profile numbers with range 1-5. 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()
547 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in pyra_raw_event()
550 if (intf->cur_altsetting->desc.bInterfaceProtocol in pyra_raw_event()
559 if (pyra->roccat_claimed) in pyra_raw_event()
591 pyra_class->dev_groups = pyra_groups; in pyra_init()