Lines Matching refs:remote
1910 static struct kobj_attribute remote##SET_ID##_mode_attr = { \
1915 static struct attribute *remote##SET_ID##_serial_attrs[] = { \
1916 &remote##SET_ID##_mode_attr.attr, \
1919 static const struct attribute_group remote##SET_ID##_serial_group = { \
1921 .attrs = remote##SET_ID##_serial_attrs, \
1934 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_attr_group() local
1936 remote->remotes[index].group.name = devm_kasprintf(&wacom->hdev->dev, in wacom_remote_create_attr_group()
1939 if (!remote->remotes[index].group.name) in wacom_remote_create_attr_group()
1942 error = __wacom_devm_sysfs_create_group(wacom, remote->remote_dir, in wacom_remote_create_attr_group()
1943 &remote->remotes[index].group); in wacom_remote_create_attr_group()
1945 remote->remotes[index].group.name = NULL; in wacom_remote_create_attr_group()
2013 struct wacom_remote *remote = wacom->remote; in wacom_remotes_destroy() local
2015 if (!remote) in wacom_remotes_destroy()
2018 kobject_put(remote->remote_dir); in wacom_remotes_destroy()
2019 kfifo_free(&remote->remote_fifo); in wacom_remotes_destroy()
2020 wacom->remote = NULL; in wacom_remotes_destroy()
2026 struct wacom_remote *remote; in wacom_initialize_remotes() local
2032 remote = devm_kzalloc(&wacom->hdev->dev, sizeof(*wacom->remote), in wacom_initialize_remotes()
2034 if (!remote) in wacom_initialize_remotes()
2037 wacom->remote = remote; in wacom_initialize_remotes()
2039 spin_lock_init(&remote->remote_lock); in wacom_initialize_remotes()
2041 error = kfifo_alloc(&remote->remote_fifo, in wacom_initialize_remotes()
2049 remote->remotes[0].group = remote0_serial_group; in wacom_initialize_remotes()
2050 remote->remotes[1].group = remote1_serial_group; in wacom_initialize_remotes()
2051 remote->remotes[2].group = remote2_serial_group; in wacom_initialize_remotes()
2052 remote->remotes[3].group = remote3_serial_group; in wacom_initialize_remotes()
2053 remote->remotes[4].group = remote4_serial_group; in wacom_initialize_remotes()
2055 remote->remote_dir = kobject_create_and_add("wacom_remote", in wacom_initialize_remotes()
2057 if (!remote->remote_dir) { in wacom_initialize_remotes()
2058 kfifo_free(&remote->remote_fifo); in wacom_initialize_remotes()
2062 error = sysfs_create_files(remote->remote_dir, remote_unpair_attrs); in wacom_initialize_remotes()
2067 kfifo_free(&remote->remote_fifo); in wacom_initialize_remotes()
2068 kobject_put(remote->remote_dir); in wacom_initialize_remotes()
2074 remote->remotes[i].serial = 0; in wacom_initialize_remotes()
2602 struct wacom_remote *remote = wacom->remote; in wacom_remote_destroy_battery() local
2604 if (remote->remotes[index].battery.battery) { in wacom_remote_destroy_battery()
2606 &remote->remotes[index].battery.bat_desc); in wacom_remote_destroy_battery()
2607 remote->remotes[index].battery.battery = NULL; in wacom_remote_destroy_battery()
2608 remote->remotes[index].active_time = 0; in wacom_remote_destroy_battery()
2614 struct wacom_remote *remote = wacom->remote; in wacom_remote_destroy_one() local
2615 u32 serial = remote->remotes[index].serial; in wacom_remote_destroy_one()
2620 if (remote->remotes[i].serial == serial) { in wacom_remote_destroy_one()
2622 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2623 remote->remotes[i].registered = false; in wacom_remote_destroy_one()
2624 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2628 if (remote->remotes[i].group.name) in wacom_remote_destroy_one()
2630 &remote->remotes[i]); in wacom_remote_destroy_one()
2632 remote->remotes[i].serial = 0; in wacom_remote_destroy_one()
2633 remote->remotes[i].group.name = NULL; in wacom_remote_destroy_one()
2642 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_one() local
2650 if (remote->remotes[k].serial == serial) in wacom_remote_create_one()
2655 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2659 if (!devres_open_group(dev, &remote->remotes[index], GFP_KERNEL)) in wacom_remote_create_one()
2666 remote->remotes[index].input = wacom_allocate_input(wacom); in wacom_remote_create_one()
2667 if (!remote->remotes[index].input) { in wacom_remote_create_one()
2671 remote->remotes[index].input->uniq = remote->remotes[index].group.name; in wacom_remote_create_one()
2672 remote->remotes[index].input->name = wacom->wacom_wac.pad_name; in wacom_remote_create_one()
2674 if (!remote->remotes[index].input->name) { in wacom_remote_create_one()
2679 error = wacom_setup_pad_input_capabilities(remote->remotes[index].input, in wacom_remote_create_one()
2684 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2686 error = input_register_device(remote->remotes[index].input); in wacom_remote_create_one()
2691 &remote->remotes[index].input->dev, in wacom_remote_create_one()
2696 remote->remotes[index].registered = true; in wacom_remote_create_one()
2698 devres_close_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2702 devres_release_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2703 remote->remotes[index].serial = 0; in wacom_remote_create_one()
2709 struct wacom_remote *remote = wacom->remote; in wacom_remote_attach_battery() local
2712 if (!remote->remotes[index].registered) in wacom_remote_attach_battery()
2715 if (remote->remotes[index].battery.battery) in wacom_remote_attach_battery()
2718 if (!remote->remotes[index].active_time) in wacom_remote_attach_battery()
2725 &wacom->remote->remotes[index].battery); in wacom_remote_attach_battery()
2735 struct wacom_remote *remote = wacom->remote; in wacom_remote_work() local
2743 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_work()
2745 count = kfifo_out(&remote->remote_fifo, &remote_work_data, in wacom_remote_work()
2751 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2755 if (!kfifo_is_empty(&remote->remote_fifo)) in wacom_remote_work()
2758 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2761 work_serial = remote_work_data.remote[i].serial; in wacom_remote_work()
2764 if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT in wacom_remote_work()
2765 && remote->remotes[i].active_time != 0) in wacom_remote_work()
2768 if (remote->remotes[i].serial == work_serial) { in wacom_remote_work()
2773 if (remote->remotes[i].serial) in wacom_remote_work()
2778 } else if (remote->remotes[i].serial) { in wacom_remote_work()