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

1 // SPDX-License-Identifier: GPL-2.0-or-later
13 * and functionality and without the non-standard behaviours the Kone had.
22 #include <linux/hid-roccat.h>
23 #include "hid-ids.h"
24 #include "hid-roccat-common.h"
25 #include "hid-roccat-koneplus.h"
32 koneplus->actual_profile = new_profile; in koneplus_profile_activated()
38 struct roccat_common2_control control; in koneplus_send_control() local
43 return -EINVAL; in koneplus_send_control()
45 control.command = ROCCAT_COMMON_COMMAND_CONTROL; in koneplus_send_control()
46 control.value = value; in koneplus_send_control()
47 control.request = request; in koneplus_send_control()
51 &control, sizeof(struct roccat_common2_control)); in koneplus_send_control()
55 /* retval is 0-4 on success, < 0 on error */
85 struct device *dev = kobj_to_dev(kobj)->parent->parent; in koneplus_sysfs_read()
94 return -EINVAL; in koneplus_sysfs_read()
96 mutex_lock(&koneplus->koneplus_lock); in koneplus_sysfs_read()
98 mutex_unlock(&koneplus->koneplus_lock); in koneplus_sysfs_read()
110 struct device *dev = kobj_to_dev(kobj)->parent->parent; in koneplus_sysfs_write()
116 return -EINVAL; in koneplus_sysfs_write()
118 mutex_lock(&koneplus->koneplus_lock); in koneplus_sysfs_write()
121 mutex_unlock(&koneplus->koneplus_lock); in koneplus_sysfs_write()
175 KONEPLUS_BIN_ATTRIBUTE_W(control, CONTROL);
189 struct device *dev = kobj_to_dev(kobj)->parent->parent; in koneplus_sysfs_read_profilex_settings()
193 retval = koneplus_send_control(usb_dev, *(uint *)(attr->private), in koneplus_sysfs_read_profilex_settings()
207 struct device *dev = kobj_to_dev(kobj)->parent->parent; in koneplus_sysfs_read_profilex_buttons()
211 retval = koneplus_send_control(usb_dev, *(uint *)(attr->private), in koneplus_sysfs_read_profilex_buttons()
226 .private = &profile_numbers[number-1], \
232 .private = &profile_numbers[number-1], \
244 hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); in koneplus_sysfs_show_actual_profile()
245 return sysfs_emit(buf, "%d\n", koneplus->actual_profile); in koneplus_sysfs_show_actual_profile()
257 dev = dev->parent->parent; in koneplus_sysfs_set_actual_profile()
266 return -EINVAL; in koneplus_sysfs_set_actual_profile()
268 mutex_lock(&koneplus->koneplus_lock); in koneplus_sysfs_set_actual_profile()
272 mutex_unlock(&koneplus->koneplus_lock); in koneplus_sysfs_set_actual_profile()
282 roccat_report_event(koneplus->chrdev_minor, in koneplus_sysfs_set_actual_profile()
285 mutex_unlock(&koneplus->koneplus_lock); in koneplus_sysfs_set_actual_profile()
303 dev = dev->parent->parent; in koneplus_sysfs_show_firmware_version()
307 mutex_lock(&koneplus->koneplus_lock); in koneplus_sysfs_show_firmware_version()
310 mutex_unlock(&koneplus->koneplus_lock); in koneplus_sysfs_show_firmware_version()
367 mutex_init(&koneplus->koneplus_lock); in koneplus_init_koneplus_device_struct()
379 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in koneplus_init_specials()
384 if (intf->cur_altsetting->desc.bInterfaceProtocol in koneplus_init_specials()
390 return -ENOMEM; in koneplus_init_specials()
405 koneplus->chrdev_minor = retval; in koneplus_init_specials()
406 koneplus->roccat_claimed = 1; in koneplus_init_specials()
420 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in koneplus_remove_specials()
423 if (intf->cur_altsetting->desc.bInterfaceProtocol in koneplus_remove_specials()
426 if (koneplus->roccat_claimed) in koneplus_remove_specials()
427 roccat_disconnect(koneplus->chrdev_minor); in koneplus_remove_specials()
438 return -EINVAL; in koneplus_probe()
480 switch (button_report->type) { in koneplus_keep_values_up_to_date()
482 koneplus_profile_activated(koneplus, button_report->data1 - 1); in koneplus_keep_values_up_to_date()
500 if ((button_report->type == KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH || in koneplus_report_to_chrdev()
501 button_report->type == KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER) && in koneplus_report_to_chrdev()
502 button_report->data2 != KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS) in koneplus_report_to_chrdev()
505 roccat_report.type = button_report->type; in koneplus_report_to_chrdev()
506 roccat_report.data1 = button_report->data1; in koneplus_report_to_chrdev()
507 roccat_report.data2 = button_report->data2; in koneplus_report_to_chrdev()
508 roccat_report.profile = koneplus->actual_profile + 1; in koneplus_report_to_chrdev()
509 roccat_report_event(koneplus->chrdev_minor, in koneplus_report_to_chrdev()
516 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in koneplus_raw_event()
519 if (intf->cur_altsetting->desc.bInterfaceProtocol in koneplus_raw_event()
528 if (koneplus->roccat_claimed) in koneplus_raw_event()