Lines Matching refs:host1x

259 static int host1x_add_client(struct host1x *host1x,  in host1x_add_client()  argument
265 mutex_lock(&host1x->devices_lock); in host1x_add_client()
267 list_for_each_entry(device, &host1x->devices, list) { in host1x_add_client()
271 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
277 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
281 static int host1x_del_client(struct host1x *host1x, in host1x_del_client() argument
287 mutex_lock(&host1x->devices_lock); in host1x_del_client()
289 list_for_each_entry_safe(device, dt, &host1x->devices, list) { in host1x_del_client()
293 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
299 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
416 static int host1x_device_add(struct host1x *host1x, in host1x_device_add() argument
438 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; in host1x_device_add()
443 device->dev.parent = host1x->dev; in host1x_device_add()
445 of_dma_configure(&device->dev, host1x->dev->of_node, true); in host1x_device_add()
456 list_add_tail(&device->list, &host1x->devices); in host1x_device_add()
480 static void host1x_device_del(struct host1x *host1x, in host1x_device_del() argument
491 static void host1x_attach_driver(struct host1x *host1x, in host1x_attach_driver() argument
497 mutex_lock(&host1x->devices_lock); in host1x_attach_driver()
499 list_for_each_entry(device, &host1x->devices, list) { in host1x_attach_driver()
501 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
506 err = host1x_device_add(host1x, driver); in host1x_attach_driver()
508 dev_err(host1x->dev, "failed to allocate device: %d\n", err); in host1x_attach_driver()
510 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
513 static void host1x_detach_driver(struct host1x *host1x, in host1x_detach_driver() argument
518 mutex_lock(&host1x->devices_lock); in host1x_detach_driver()
520 list_for_each_entry_safe(device, tmp, &host1x->devices, list) in host1x_detach_driver()
522 host1x_device_del(host1x, device); in host1x_detach_driver()
524 mutex_unlock(&host1x->devices_lock); in host1x_detach_driver()
529 struct host1x *host1x = s->private; in host1x_devices_show() local
532 mutex_lock(&host1x->devices_lock); in host1x_devices_show()
534 list_for_each_entry(device, &host1x->devices, list) { in host1x_devices_show()
551 mutex_unlock(&host1x->devices_lock); in host1x_devices_show()
565 int host1x_register(struct host1x *host1x) in host1x_register() argument
570 list_add_tail(&host1x->list, &devices); in host1x_register()
576 host1x_attach_driver(host1x, driver); in host1x_register()
580 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x, in host1x_register()
593 int host1x_unregister(struct host1x *host1x) in host1x_unregister() argument
600 host1x_detach_driver(host1x, driver); in host1x_unregister()
605 list_del_init(&host1x->list); in host1x_unregister()
655 struct host1x *host1x; in host1x_driver_register_full() local
665 list_for_each_entry(host1x, &devices, list) in host1x_driver_register_full()
666 host1x_attach_driver(host1x, driver); in host1x_driver_register_full()
689 struct host1x *host1x; in host1x_driver_unregister() local
695 list_for_each_entry(host1x, &devices, list) in host1x_driver_unregister()
696 host1x_detach_driver(host1x, driver); in host1x_driver_unregister()
743 struct host1x *host1x; in __host1x_client_register() local
748 list_for_each_entry(host1x, &devices, list) { in __host1x_client_register()
749 err = host1x_add_client(host1x, client); in __host1x_client_register()
776 struct host1x *host1x; in host1x_client_unregister() local
781 list_for_each_entry(host1x, &devices, list) { in host1x_client_unregister()
782 err = host1x_del_client(host1x, client); in host1x_client_unregister()