Lines Matching refs:host1x

8 #include <linux/host1x.h>
34 * @device: host1x device to add the subdevice to
85 * @device: host1x logical device
86 * @driver: host1x driver
182 * host1x_device_init() - initialize a host1x logical device
183 * @device: host1x logical device
185 * The driver for the host1x logical device can call this during execution of
225 * host1x_device_exit() - uninitialize host1x logical device
226 * @device: host1x logical device
228 * When the driver for a host1x logical device is unloaded, it can call this
259 static int host1x_add_client(struct host1x *host1x,
265 mutex_lock(&host1x->devices_lock);
267 list_for_each_entry(device, &host1x->devices, list) {
271 mutex_unlock(&host1x->devices_lock);
277 mutex_unlock(&host1x->devices_lock);
281 static int host1x_del_client(struct host1x *host1x,
287 mutex_lock(&host1x->devices_lock);
289 list_for_each_entry_safe(device, dt, &host1x->devices, list) {
293 mutex_unlock(&host1x->devices_lock);
299 mutex_unlock(&host1x->devices_lock);
353 .name = "host1x",
416 static int host1x_device_add(struct host1x *host1x,
438 device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask;
443 device->dev.parent = host1x->dev;
445 of_dma_configure(&device->dev, host1x->dev->of_node, true);
456 list_add_tail(&device->list, &host1x->devices);
478 * This function must be called with the host1x->devices_lock held.
480 static void host1x_device_del(struct host1x *host1x,
491 static void host1x_attach_driver(struct host1x *host1x,
497 mutex_lock(&host1x->devices_lock);
499 list_for_each_entry(device, &host1x->devices, list) {
501 mutex_unlock(&host1x->devices_lock);
506 err = host1x_device_add(host1x, driver);
508 dev_err(host1x->dev, "failed to allocate device: %d\n", err);
510 mutex_unlock(&host1x->devices_lock);
513 static void host1x_detach_driver(struct host1x *host1x,
518 mutex_lock(&host1x->devices_lock);
520 list_for_each_entry_safe(device, tmp, &host1x->devices, list)
522 host1x_device_del(host1x, device);
524 mutex_unlock(&host1x->devices_lock);
529 struct host1x *host1x = s->private;
532 mutex_lock(&host1x->devices_lock);
534 list_for_each_entry(device, &host1x->devices, list) {
551 mutex_unlock(&host1x->devices_lock);
558 * host1x_register() - register a host1x controller
559 * @host1x: host1x controller
561 * The host1x controller driver uses this to register a host1x controller with
563 * with a single host1x instance, so this function is somewhat academic.
565 int host1x_register(struct host1x *host1x)
570 list_add_tail(&host1x->list, &devices);
576 host1x_attach_driver(host1x, driver);
580 debugfs_create_file("devices", S_IRUGO, host1x->debugfs, host1x,
587 * host1x_unregister() - unregister a host1x controller
588 * @host1x: host1x controller
590 * The host1x controller driver uses this to remove a host1x controller from
593 int host1x_unregister(struct host1x *host1x)
600 host1x_detach_driver(host1x, driver);
605 list_del_init(&host1x->list);
643 * host1x_driver_register_full() - register a host1x driver
644 * @driver: host1x driver
647 * Drivers for host1x logical devices call this function to register a driver
650 * A logical device will be created for each host1x instance.
655 struct host1x *host1x;
665 list_for_each_entry(host1x, &devices, list)
666 host1x_attach_driver(host1x, driver);
681 * host1x_driver_unregister() - unregister a host1x driver
682 * @driver: host1x driver
684 * Unbinds the driver from each of the host1x logical devices that it is
689 struct host1x *host1x;
695 list_for_each_entry(host1x, &devices, list)
696 host1x_detach_driver(host1x, driver);
707 * __host1x_client_init() - initialize a host1x client
708 * @client: host1x client
714 __mutex_init(&client->lock, "host1x client lock", key);
720 * host1x_client_exit() - uninitialize a host1x client
721 * @client: host1x client
730 * __host1x_client_register() - register a host1x client
731 * @client: host1x client
734 * Registers a host1x client with each host1x controller instance. Note that
735 * each client will only match their parent host1x controller and will only be
737 * their parent host1x controller, the infrastructure will set up the logical
743 struct host1x *host1x;
748 list_for_each_entry(host1x, &devices, list) {
749 err = host1x_add_client(host1x, client);
767 * host1x_client_unregister() - unregister a host1x client
768 * @client: host1x client
770 * Removes a host1x client from its host1x controller instance. If a logical
776 struct host1x *host1x;
781 list_for_each_entry(host1x, &devices, list) {
782 err = host1x_del_client(host1x, client);