Lines Matching refs:host1x
292 static int host1x_add_client(struct host1x *host1x, in host1x_add_client() argument
298 mutex_lock(&host1x->devices_lock); in host1x_add_client()
300 list_for_each_entry(device, &host1x->devices, list) { in host1x_add_client()
304 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
310 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
314 static int host1x_del_client(struct host1x *host1x, in host1x_del_client() argument
320 mutex_lock(&host1x->devices_lock); in host1x_del_client()
322 list_for_each_entry_safe(device, dt, &host1x->devices, list) { in host1x_del_client()
326 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
332 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
432 static int host1x_device_add(struct host1x *host1x, in host1x_device_add() argument
454 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; in host1x_device_add()
459 device->dev.parent = host1x->dev; in host1x_device_add()
461 of_dma_configure(&device->dev, host1x->dev->of_node, true); in host1x_device_add()
472 list_add_tail(&device->list, &host1x->devices); in host1x_device_add()
496 static void host1x_device_del(struct host1x *host1x, in host1x_device_del() argument
507 static void host1x_attach_driver(struct host1x *host1x, in host1x_attach_driver() argument
513 mutex_lock(&host1x->devices_lock); in host1x_attach_driver()
515 list_for_each_entry(device, &host1x->devices, list) { in host1x_attach_driver()
517 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
522 err = host1x_device_add(host1x, driver); in host1x_attach_driver()
524 dev_err(host1x->dev, "failed to allocate device: %d\n", err); in host1x_attach_driver()
526 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
529 static void host1x_detach_driver(struct host1x *host1x, in host1x_detach_driver() argument
534 mutex_lock(&host1x->devices_lock); in host1x_detach_driver()
536 list_for_each_entry_safe(device, tmp, &host1x->devices, list) in host1x_detach_driver()
538 host1x_device_del(host1x, device); in host1x_detach_driver()
540 mutex_unlock(&host1x->devices_lock); in host1x_detach_driver()
545 struct host1x *host1x = s->private; in host1x_devices_show() local
548 mutex_lock(&host1x->devices_lock); in host1x_devices_show()
550 list_for_each_entry(device, &host1x->devices, list) { in host1x_devices_show()
567 mutex_unlock(&host1x->devices_lock); in host1x_devices_show()
581 int host1x_register(struct host1x *host1x) in host1x_register() argument
586 list_add_tail(&host1x->list, &devices); in host1x_register()
592 host1x_attach_driver(host1x, driver); in host1x_register()
596 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x, in host1x_register()
609 int host1x_unregister(struct host1x *host1x) in host1x_unregister() argument
616 host1x_detach_driver(host1x, driver); in host1x_unregister()
621 list_del_init(&host1x->list); in host1x_unregister()
671 struct host1x *host1x; in host1x_driver_register_full() local
681 list_for_each_entry(host1x, &devices, list) in host1x_driver_register_full()
682 host1x_attach_driver(host1x, driver); in host1x_driver_register_full()
705 struct host1x *host1x; in host1x_driver_unregister() local
711 list_for_each_entry(host1x, &devices, list) in host1x_driver_unregister()
712 host1x_detach_driver(host1x, driver); in host1x_driver_unregister()
759 struct host1x *host1x; in __host1x_client_register() local
764 list_for_each_entry(host1x, &devices, list) { in __host1x_client_register()
765 err = host1x_add_client(host1x, client); in __host1x_client_register()
792 struct host1x *host1x; in host1x_client_unregister() local
797 list_for_each_entry(host1x, &devices, list) { in host1x_client_unregister()
798 err = host1x_del_client(host1x, client); in host1x_client_unregister()