Lines Matching refs:host1x

291 static int host1x_add_client(struct host1x *host1x,  in host1x_add_client()  argument
297 mutex_lock(&host1x->devices_lock); in host1x_add_client()
299 list_for_each_entry(device, &host1x->devices, list) { in host1x_add_client()
303 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
309 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
313 static int host1x_del_client(struct host1x *host1x, in host1x_del_client() argument
319 mutex_lock(&host1x->devices_lock); in host1x_del_client()
321 list_for_each_entry_safe(device, dt, &host1x->devices, list) { in host1x_del_client()
325 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
331 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
448 static int host1x_device_add(struct host1x *host1x, in host1x_device_add() argument
470 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; in host1x_device_add()
475 device->dev.parent = host1x->dev; in host1x_device_add()
477 of_dma_configure(&device->dev, host1x->dev->of_node, true); in host1x_device_add()
488 list_add_tail(&device->list, &host1x->devices); in host1x_device_add()
512 static void host1x_device_del(struct host1x *host1x, in host1x_device_del() argument
523 static void host1x_attach_driver(struct host1x *host1x, in host1x_attach_driver() argument
529 mutex_lock(&host1x->devices_lock); in host1x_attach_driver()
531 list_for_each_entry(device, &host1x->devices, list) { in host1x_attach_driver()
533 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
538 err = host1x_device_add(host1x, driver); in host1x_attach_driver()
540 dev_err(host1x->dev, "failed to allocate device: %d\n", err); in host1x_attach_driver()
542 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
545 static void host1x_detach_driver(struct host1x *host1x, in host1x_detach_driver() argument
550 mutex_lock(&host1x->devices_lock); in host1x_detach_driver()
552 list_for_each_entry_safe(device, tmp, &host1x->devices, list) in host1x_detach_driver()
554 host1x_device_del(host1x, device); in host1x_detach_driver()
556 mutex_unlock(&host1x->devices_lock); in host1x_detach_driver()
561 struct host1x *host1x = s->private; in host1x_devices_show() local
564 mutex_lock(&host1x->devices_lock); in host1x_devices_show()
566 list_for_each_entry(device, &host1x->devices, list) { in host1x_devices_show()
583 mutex_unlock(&host1x->devices_lock); in host1x_devices_show()
597 int host1x_register(struct host1x *host1x) in host1x_register() argument
602 list_add_tail(&host1x->list, &devices); in host1x_register()
608 host1x_attach_driver(host1x, driver); in host1x_register()
612 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x, in host1x_register()
625 int host1x_unregister(struct host1x *host1x) in host1x_unregister() argument
632 host1x_detach_driver(host1x, driver); in host1x_unregister()
637 list_del_init(&host1x->list); in host1x_unregister()
687 struct host1x *host1x; in host1x_driver_register_full() local
697 list_for_each_entry(host1x, &devices, list) in host1x_driver_register_full()
698 host1x_attach_driver(host1x, driver); in host1x_driver_register_full()
721 struct host1x *host1x; in host1x_driver_unregister() local
727 list_for_each_entry(host1x, &devices, list) in host1x_driver_unregister()
728 host1x_detach_driver(host1x, driver); in host1x_driver_unregister()
775 struct host1x *host1x; in __host1x_client_register() local
780 list_for_each_entry(host1x, &devices, list) { in __host1x_client_register()
781 err = host1x_add_client(host1x, client); in __host1x_client_register()
808 struct host1x *host1x; in host1x_client_unregister() local
813 list_for_each_entry(host1x, &devices, list) { in host1x_client_unregister()
814 err = host1x_del_client(host1x, client); in host1x_client_unregister()