Lines Matching refs:remote
1804 static struct kobj_attribute remote##SET_ID##_mode_attr = { \
1809 static struct attribute *remote##SET_ID##_serial_attrs[] = { \
1810 &remote##SET_ID##_mode_attr.attr, \
1813 static struct attribute_group remote##SET_ID##_serial_group = { \
1815 .attrs = remote##SET_ID##_serial_attrs, \
1828 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_attr_group() local
1830 remote->remotes[index].group.name = devm_kasprintf(&wacom->hdev->dev, in wacom_remote_create_attr_group()
1833 if (!remote->remotes[index].group.name) in wacom_remote_create_attr_group()
1836 error = __wacom_devm_sysfs_create_group(wacom, remote->remote_dir, in wacom_remote_create_attr_group()
1837 &remote->remotes[index].group); in wacom_remote_create_attr_group()
1839 remote->remotes[index].group.name = NULL; in wacom_remote_create_attr_group()
1907 struct wacom_remote *remote = wacom->remote; in wacom_remotes_destroy() local
1909 if (!remote) in wacom_remotes_destroy()
1912 kobject_put(remote->remote_dir); in wacom_remotes_destroy()
1913 kfifo_free(&remote->remote_fifo); in wacom_remotes_destroy()
1914 wacom->remote = NULL; in wacom_remotes_destroy()
1920 struct wacom_remote *remote; in wacom_initialize_remotes() local
1926 remote = devm_kzalloc(&wacom->hdev->dev, sizeof(*wacom->remote), in wacom_initialize_remotes()
1928 if (!remote) in wacom_initialize_remotes()
1931 wacom->remote = remote; in wacom_initialize_remotes()
1933 spin_lock_init(&remote->remote_lock); in wacom_initialize_remotes()
1935 error = kfifo_alloc(&remote->remote_fifo, in wacom_initialize_remotes()
1943 remote->remotes[0].group = remote0_serial_group; in wacom_initialize_remotes()
1944 remote->remotes[1].group = remote1_serial_group; in wacom_initialize_remotes()
1945 remote->remotes[2].group = remote2_serial_group; in wacom_initialize_remotes()
1946 remote->remotes[3].group = remote3_serial_group; in wacom_initialize_remotes()
1947 remote->remotes[4].group = remote4_serial_group; in wacom_initialize_remotes()
1949 remote->remote_dir = kobject_create_and_add("wacom_remote", in wacom_initialize_remotes()
1951 if (!remote->remote_dir) in wacom_initialize_remotes()
1954 error = sysfs_create_files(remote->remote_dir, remote_unpair_attrs); in wacom_initialize_remotes()
1964 remote->remotes[i].serial = 0; in wacom_initialize_remotes()
2454 struct wacom_remote *remote = wacom->remote; in wacom_remote_destroy_one() local
2455 u32 serial = remote->remotes[index].serial; in wacom_remote_destroy_one()
2460 if (remote->remotes[i].serial == serial) { in wacom_remote_destroy_one()
2462 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2463 remote->remotes[i].registered = false; in wacom_remote_destroy_one()
2464 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2466 if (remote->remotes[i].battery.battery) in wacom_remote_destroy_one()
2468 &remote->remotes[i].battery.bat_desc); in wacom_remote_destroy_one()
2470 if (remote->remotes[i].group.name) in wacom_remote_destroy_one()
2472 &remote->remotes[i]); in wacom_remote_destroy_one()
2474 remote->remotes[i].serial = 0; in wacom_remote_destroy_one()
2475 remote->remotes[i].group.name = NULL; in wacom_remote_destroy_one()
2476 remote->remotes[i].battery.battery = NULL; in wacom_remote_destroy_one()
2485 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_one() local
2493 if (remote->remotes[k].serial == serial) in wacom_remote_create_one()
2498 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2502 if (!devres_open_group(dev, &remote->remotes[index], GFP_KERNEL)) in wacom_remote_create_one()
2509 remote->remotes[index].input = wacom_allocate_input(wacom); in wacom_remote_create_one()
2510 if (!remote->remotes[index].input) { in wacom_remote_create_one()
2514 remote->remotes[index].input->uniq = remote->remotes[index].group.name; in wacom_remote_create_one()
2515 remote->remotes[index].input->name = wacom->wacom_wac.pad_name; in wacom_remote_create_one()
2517 if (!remote->remotes[index].input->name) { in wacom_remote_create_one()
2522 error = wacom_setup_pad_input_capabilities(remote->remotes[index].input, in wacom_remote_create_one()
2527 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2529 error = input_register_device(remote->remotes[index].input); in wacom_remote_create_one()
2534 &remote->remotes[index].input->dev, in wacom_remote_create_one()
2539 remote->remotes[index].registered = true; in wacom_remote_create_one()
2541 devres_close_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2545 devres_release_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2546 remote->remotes[index].serial = 0; in wacom_remote_create_one()
2552 struct wacom_remote *remote = wacom->remote; in wacom_remote_attach_battery() local
2555 if (!remote->remotes[index].registered) in wacom_remote_attach_battery()
2558 if (remote->remotes[index].battery.battery) in wacom_remote_attach_battery()
2565 &wacom->remote->remotes[index].battery); in wacom_remote_attach_battery()
2575 struct wacom_remote *remote = wacom->remote; in wacom_remote_work() local
2582 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_work()
2584 count = kfifo_out(&remote->remote_fifo, &data, sizeof(data)); in wacom_remote_work()
2589 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2593 if (!kfifo_is_empty(&remote->remote_fifo)) in wacom_remote_work()
2596 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2599 serial = data.remote[i].serial; in wacom_remote_work()
2600 if (data.remote[i].connected) { in wacom_remote_work()
2602 if (remote->remotes[i].serial == serial) { in wacom_remote_work()
2607 if (remote->remotes[i].serial) in wacom_remote_work()
2612 } else if (remote->remotes[i].serial) { in wacom_remote_work()