Lines Matching refs: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,
298 mutex_lock(&host1x->devices_lock);
300 list_for_each_entry(device, &host1x->devices, list) {
304 mutex_unlock(&host1x->devices_lock);
310 mutex_unlock(&host1x->devices_lock);
314 static int host1x_del_client(struct host1x *host1x,
320 mutex_lock(&host1x->devices_lock);
322 list_for_each_entry_safe(device, dt, &host1x->devices, list) {
326 mutex_unlock(&host1x->devices_lock);
332 mutex_unlock(&host1x->devices_lock);
369 .name = "host1x",
432 static int host1x_device_add(struct host1x *host1x,
454 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask;
459 device->dev.parent = host1x->dev;
461 of_dma_configure(&device->dev, host1x->dev->of_node, true);
472 list_add_tail(&device->list, &host1x->devices);
494 * This function must be called with the host1x->devices_lock held.
496 static void host1x_device_del(struct host1x *host1x,
507 static void host1x_attach_driver(struct host1x *host1x,
513 mutex_lock(&host1x->devices_lock);
515 list_for_each_entry(device, &host1x->devices, list) {
517 mutex_unlock(&host1x->devices_lock);
522 err = host1x_device_add(host1x, driver);
524 dev_err(host1x->dev, "failed to allocate device: %d\n", err);
526 mutex_unlock(&host1x->devices_lock);
529 static void host1x_detach_driver(struct host1x *host1x,
534 mutex_lock(&host1x->devices_lock);
536 list_for_each_entry_safe(device, tmp, &host1x->devices, list)
538 host1x_device_del(host1x, device);
540 mutex_unlock(&host1x->devices_lock);
545 struct host1x *host1x = s->private;
548 mutex_lock(&host1x->devices_lock);
550 list_for_each_entry(device, &host1x->devices, list) {
567 mutex_unlock(&host1x->devices_lock);
574 * host1x_register() - register a host1x controller
575 * @host1x: host1x controller
577 * The host1x controller driver uses this to register a host1x controller with
579 * with a single host1x instance, so this function is somewhat academic.
581 int host1x_register(struct host1x *host1x)
586 list_add_tail(&host1x->list, &devices);
592 host1x_attach_driver(host1x, driver);
596 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x,
603 * host1x_unregister() - unregister a host1x controller
604 * @host1x: host1x controller
606 * The host1x controller driver uses this to remove a host1x controller from
609 int host1x_unregister(struct host1x *host1x)
616 host1x_detach_driver(host1x, driver);
621 list_del_init(&host1x->list);
659 * host1x_driver_register_full() - register a host1x driver
660 * @driver: host1x driver
663 * Drivers for host1x logical devices call this function to register a driver
666 * A logical device will be created for each host1x instance.
671 struct host1x *host1x;
681 list_for_each_entry(host1x, &devices, list)
682 host1x_attach_driver(host1x, driver);
697 * host1x_driver_unregister() - unregister a host1x driver
698 * @driver: host1x driver
700 * Unbinds the driver from each of the host1x logical devices that it is
705 struct host1x *host1x;
711 list_for_each_entry(host1x, &devices, list)
712 host1x_detach_driver(host1x, driver);
723 * __host1x_client_init() - initialize a host1x client
724 * @client: host1x client
731 __mutex_init(&client->lock, "host1x client lock", key);
737 * host1x_client_exit() - uninitialize a host1x client
738 * @client: host1x client
747 * __host1x_client_register() - register a host1x client
748 * @client: host1x client
750 * Registers a host1x client with each host1x controller instance. Note that
751 * each client will only match their parent host1x controller and will only be
753 * their parent host1x controller, the infrastructure will set up the logical
759 struct host1x *host1x;
764 list_for_each_entry(host1x, &devices, list) {
765 err = host1x_add_client(host1x, client);
783 * host1x_client_unregister() - unregister a host1x client
784 * @client: host1x client
786 * Removes a host1x client from its host1x controller instance. If a logical
792 struct host1x *host1x;
797 list_for_each_entry(host1x, &devices, list) {
798 err = host1x_del_client(host1x, client);