Lines Matching full:host1x
9 #include <linux/host1x.h>
35 * @device: host1x device to add the subdevice to
36 * @driver: host1x driver containing the subdevices
87 * @device: host1x logical device
88 * @driver: host1x driver
184 * host1x_device_init() - initialize a host1x logical device
185 * @device: host1x logical device
187 * The driver for the host1x logical device can call this during execution of
246 * host1x_device_exit() - uninitialize host1x logical device
247 * @device: host1x logical device
249 * When the driver for a host1x logical device is unloaded, it can call this
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()
386 .name = "host1x",
449 static int host1x_device_add(struct host1x *host1x, in host1x_device_add() argument
471 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; in host1x_device_add()
476 device->dev.parent = host1x->dev; in host1x_device_add()
478 of_dma_configure(&device->dev, host1x->dev->of_node, true); in host1x_device_add()
489 list_add_tail(&device->list, &host1x->devices); in host1x_device_add()
511 * This function must be called with the host1x->devices_lock held.
513 static void host1x_device_del(struct host1x *host1x, in host1x_device_del() argument
524 static void host1x_attach_driver(struct host1x *host1x, in host1x_attach_driver() argument
530 mutex_lock(&host1x->devices_lock); in host1x_attach_driver()
532 list_for_each_entry(device, &host1x->devices, list) { in host1x_attach_driver()
534 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
539 err = host1x_device_add(host1x, driver); in host1x_attach_driver()
541 dev_err(host1x->dev, "failed to allocate device: %d\n", err); in host1x_attach_driver()
543 mutex_unlock(&host1x->devices_lock); in host1x_attach_driver()
546 static void host1x_detach_driver(struct host1x *host1x, in host1x_detach_driver() argument
551 mutex_lock(&host1x->devices_lock); in host1x_detach_driver()
553 list_for_each_entry_safe(device, tmp, &host1x->devices, list) in host1x_detach_driver()
555 host1x_device_del(host1x, device); in host1x_detach_driver()
557 mutex_unlock(&host1x->devices_lock); in host1x_detach_driver()
562 struct host1x *host1x = s->private; in host1x_devices_show() local
565 mutex_lock(&host1x->devices_lock); in host1x_devices_show()
567 list_for_each_entry(device, &host1x->devices, list) { in host1x_devices_show()
584 mutex_unlock(&host1x->devices_lock); in host1x_devices_show()
591 * host1x_register() - register a host1x controller
592 * @host1x: host1x controller
594 * The host1x controller driver uses this to register a host1x controller with
596 * with a single host1x instance, so this function is somewhat academic.
598 int host1x_register(struct host1x *host1x) in host1x_register() argument
603 list_add_tail(&host1x->list, &devices); in host1x_register()
609 host1x_attach_driver(host1x, driver); in host1x_register()
613 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x, in host1x_register()
620 * host1x_unregister() - unregister a host1x controller
621 * @host1x: host1x controller
623 * The host1x controller driver uses this to remove a host1x controller from
626 int host1x_unregister(struct host1x *host1x) in host1x_unregister() argument
633 host1x_detach_driver(host1x, driver); in host1x_unregister()
638 list_del_init(&host1x->list); in host1x_unregister()
676 * host1x_driver_register_full() - register a host1x driver
677 * @driver: host1x driver
680 * Drivers for host1x logical devices call this function to register a driver
683 * A logical device will be created for each host1x instance.
688 struct host1x *host1x; in host1x_driver_register_full() local
698 list_for_each_entry(host1x, &devices, list) in host1x_driver_register_full()
699 host1x_attach_driver(host1x, driver); in host1x_driver_register_full()
714 * host1x_driver_unregister() - unregister a host1x driver
715 * @driver: host1x driver
717 * Unbinds the driver from each of the host1x logical devices that it is
722 struct host1x *host1x; in host1x_driver_unregister() local
728 list_for_each_entry(host1x, &devices, list) in host1x_driver_unregister()
729 host1x_detach_driver(host1x, driver); in host1x_driver_unregister()
740 * __host1x_client_init() - initialize a host1x client
741 * @client: host1x client
748 __mutex_init(&client->lock, "host1x client lock", key); in __host1x_client_init()
754 * host1x_client_exit() - uninitialize a host1x client
755 * @client: host1x client
764 * __host1x_client_register() - register a host1x client
765 * @client: host1x client
767 * Registers a host1x client with each host1x controller instance. Note that
768 * each client will only match their parent host1x controller and will only be
770 * their parent host1x controller, the infrastructure will set up the logical
776 struct host1x *host1x; in __host1x_client_register() local
781 list_for_each_entry(host1x, &devices, list) { in __host1x_client_register()
782 err = host1x_add_client(host1x, client); in __host1x_client_register()
800 * host1x_client_unregister() - unregister a host1x client
801 * @client: host1x client
803 * Removes a host1x client from its host1x controller instance. If a logical
809 struct host1x *host1x; in host1x_client_unregister() local
814 list_for_each_entry(host1x, &devices, list) { in host1x_client_unregister()
815 err = host1x_del_client(host1x, client); in host1x_client_unregister()