Lines Matching refs:host1x
218 static int host1x_add_client(struct host1x *host1x, in host1x_add_client() argument
224 mutex_lock(&host1x->devices_lock); in host1x_add_client()
226 list_for_each_entry(device, &host1x->devices, list) { in host1x_add_client()
230 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
236 mutex_unlock(&host1x->devices_lock); in host1x_add_client()
240 static int host1x_del_client(struct host1x *host1x, in host1x_del_client() argument
246 mutex_lock(&host1x->devices_lock); in host1x_del_client()
248 list_for_each_entry_safe(device, dt, &host1x->devices, list) { in host1x_del_client()
252 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
258 mutex_unlock(&host1x->devices_lock); in host1x_del_client()
372 static int host1x_device_add(struct host1x *host1x, in host1x_device_add() argument
394 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; in host1x_device_add()
399 device->dev.parent = host1x->dev; in host1x_device_add()
407 list_add_tail(&device->list, &host1x->devices); in host1x_device_add()
431 static void host1x_device_del(struct host1x *host1x, in host1x_device_del() argument
442 static void host1x_attach_driver(struct host1x *host1x, in host1x_attach_driver() argument
448 mutex_lock(&host1x->devices_lock); in host1x_attach_driver()
450 list_for_each_entry(device, &host1x->devices, list) { in host1x_attach_driver()
452 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
457 err = host1x_device_add(host1x, driver); in host1x_attach_driver()
459 dev_err(host1x->dev, "failed to allocate device: %d\n", err); in host1x_attach_driver()
461 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
464 static void host1x_detach_driver(struct host1x *host1x, in host1x_detach_driver() argument
469 mutex_lock(&host1x->devices_lock); in host1x_detach_driver()
471 list_for_each_entry_safe(device, tmp, &host1x->devices, list) in host1x_detach_driver()
473 host1x_device_del(host1x, device); in host1x_detach_driver()
475 mutex_unlock(&host1x->devices_lock); in host1x_detach_driver()
478 int host1x_register(struct host1x *host1x) in host1x_register() argument
483 list_add_tail(&host1x->list, &devices); in host1x_register()
489 host1x_attach_driver(host1x, driver); in host1x_register()
496 int host1x_unregister(struct host1x *host1x) in host1x_unregister() argument
503 host1x_detach_driver(host1x, driver); in host1x_unregister()
508 list_del_init(&host1x->list); in host1x_unregister()
517 struct host1x *host1x; in host1x_driver_register_full() local
527 list_for_each_entry(host1x, &devices, list) in host1x_driver_register_full()
528 host1x_attach_driver(host1x, driver); in host1x_driver_register_full()
549 struct host1x *host1x; in host1x_client_register() local
554 list_for_each_entry(host1x, &devices, list) { in host1x_client_register()
555 err = host1x_add_client(host1x, client); in host1x_client_register()
575 struct host1x *host1x; in host1x_client_unregister() local
580 list_for_each_entry(host1x, &devices, list) { in host1x_client_unregister()
581 err = host1x_del_client(host1x, client); in host1x_client_unregister()