Lines Matching refs:remote
1839 static struct kobj_attribute remote##SET_ID##_mode_attr = { \
1844 static struct attribute *remote##SET_ID##_serial_attrs[] = { \
1845 &remote##SET_ID##_mode_attr.attr, \
1848 static struct attribute_group remote##SET_ID##_serial_group = { \
1850 .attrs = remote##SET_ID##_serial_attrs, \
1863 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_attr_group() local
1865 remote->remotes[index].group.name = devm_kasprintf(&wacom->hdev->dev, in wacom_remote_create_attr_group()
1868 if (!remote->remotes[index].group.name) in wacom_remote_create_attr_group()
1871 error = __wacom_devm_sysfs_create_group(wacom, remote->remote_dir, in wacom_remote_create_attr_group()
1872 &remote->remotes[index].group); in wacom_remote_create_attr_group()
1874 remote->remotes[index].group.name = NULL; in wacom_remote_create_attr_group()
1942 struct wacom_remote *remote = wacom->remote; in wacom_remotes_destroy() local
1944 if (!remote) in wacom_remotes_destroy()
1947 kobject_put(remote->remote_dir); in wacom_remotes_destroy()
1948 kfifo_free(&remote->remote_fifo); in wacom_remotes_destroy()
1949 wacom->remote = NULL; in wacom_remotes_destroy()
1955 struct wacom_remote *remote; in wacom_initialize_remotes() local
1961 remote = devm_kzalloc(&wacom->hdev->dev, sizeof(*wacom->remote), in wacom_initialize_remotes()
1963 if (!remote) in wacom_initialize_remotes()
1966 wacom->remote = remote; in wacom_initialize_remotes()
1968 spin_lock_init(&remote->remote_lock); in wacom_initialize_remotes()
1970 error = kfifo_alloc(&remote->remote_fifo, in wacom_initialize_remotes()
1978 remote->remotes[0].group = remote0_serial_group; in wacom_initialize_remotes()
1979 remote->remotes[1].group = remote1_serial_group; in wacom_initialize_remotes()
1980 remote->remotes[2].group = remote2_serial_group; in wacom_initialize_remotes()
1981 remote->remotes[3].group = remote3_serial_group; in wacom_initialize_remotes()
1982 remote->remotes[4].group = remote4_serial_group; in wacom_initialize_remotes()
1984 remote->remote_dir = kobject_create_and_add("wacom_remote", in wacom_initialize_remotes()
1986 if (!remote->remote_dir) in wacom_initialize_remotes()
1989 error = sysfs_create_files(remote->remote_dir, remote_unpair_attrs); in wacom_initialize_remotes()
1999 remote->remotes[i].serial = 0; in wacom_initialize_remotes()
2489 struct wacom_remote *remote = wacom->remote; in wacom_remote_destroy_one() local
2490 u32 serial = remote->remotes[index].serial; in wacom_remote_destroy_one()
2495 if (remote->remotes[i].serial == serial) { in wacom_remote_destroy_one()
2497 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2498 remote->remotes[i].registered = false; in wacom_remote_destroy_one()
2499 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_destroy_one()
2501 if (remote->remotes[i].battery.battery) in wacom_remote_destroy_one()
2503 &remote->remotes[i].battery.bat_desc); in wacom_remote_destroy_one()
2505 if (remote->remotes[i].group.name) in wacom_remote_destroy_one()
2507 &remote->remotes[i]); in wacom_remote_destroy_one()
2509 remote->remotes[i].serial = 0; in wacom_remote_destroy_one()
2510 remote->remotes[i].group.name = NULL; in wacom_remote_destroy_one()
2511 remote->remotes[i].battery.battery = NULL; in wacom_remote_destroy_one()
2520 struct wacom_remote *remote = wacom->remote; in wacom_remote_create_one() local
2528 if (remote->remotes[k].serial == serial) in wacom_remote_create_one()
2533 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2537 if (!devres_open_group(dev, &remote->remotes[index], GFP_KERNEL)) in wacom_remote_create_one()
2544 remote->remotes[index].input = wacom_allocate_input(wacom); in wacom_remote_create_one()
2545 if (!remote->remotes[index].input) { in wacom_remote_create_one()
2549 remote->remotes[index].input->uniq = remote->remotes[index].group.name; in wacom_remote_create_one()
2550 remote->remotes[index].input->name = wacom->wacom_wac.pad_name; in wacom_remote_create_one()
2552 if (!remote->remotes[index].input->name) { in wacom_remote_create_one()
2557 error = wacom_setup_pad_input_capabilities(remote->remotes[index].input, in wacom_remote_create_one()
2562 remote->remotes[index].serial = serial; in wacom_remote_create_one()
2564 error = input_register_device(remote->remotes[index].input); in wacom_remote_create_one()
2569 &remote->remotes[index].input->dev, in wacom_remote_create_one()
2574 remote->remotes[index].registered = true; in wacom_remote_create_one()
2576 devres_close_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2580 devres_release_group(dev, &remote->remotes[index]); in wacom_remote_create_one()
2581 remote->remotes[index].serial = 0; in wacom_remote_create_one()
2587 struct wacom_remote *remote = wacom->remote; in wacom_remote_attach_battery() local
2590 if (!remote->remotes[index].registered) in wacom_remote_attach_battery()
2593 if (remote->remotes[index].battery.battery) in wacom_remote_attach_battery()
2600 &wacom->remote->remotes[index].battery); in wacom_remote_attach_battery()
2610 struct wacom_remote *remote = wacom->remote; in wacom_remote_work() local
2617 spin_lock_irqsave(&remote->remote_lock, flags); in wacom_remote_work()
2619 count = kfifo_out(&remote->remote_fifo, &data, sizeof(data)); in wacom_remote_work()
2624 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2628 if (!kfifo_is_empty(&remote->remote_fifo)) in wacom_remote_work()
2631 spin_unlock_irqrestore(&remote->remote_lock, flags); in wacom_remote_work()
2634 serial = data.remote[i].serial; in wacom_remote_work()
2635 if (data.remote[i].connected) { in wacom_remote_work()
2637 if (remote->remotes[i].serial == serial) { in wacom_remote_work()
2642 if (remote->remotes[i].serial) in wacom_remote_work()
2647 } else if (remote->remotes[i].serial) { in wacom_remote_work()