Lines Matching full:client

28 	struct host1x_client *client;  member
112 struct host1x_client *client) in host1x_subdev_register() argument
118 * and associate it with a client. At the same time, associate the in host1x_subdev_register()
119 * client with its parent device. in host1x_subdev_register()
123 list_move_tail(&client->list, &device->clients); in host1x_subdev_register()
125 client->host = &device->dev; in host1x_subdev_register()
126 subdev->client = client; in host1x_subdev_register()
142 struct host1x_client *client = subdev->client; in __host1x_subdev_unregister() local
160 subdev->client = NULL; in __host1x_subdev_unregister()
161 client->host = NULL; in __host1x_subdev_unregister()
168 * used to remove the subdevice when a client is unregistered but in __host1x_subdev_unregister()
171 list_del_init(&client->list); in __host1x_subdev_unregister()
189 * The client drivers access the subsystem specific driver data using the
195 struct host1x_client *client; in host1x_device_init() local
200 list_for_each_entry(client, &device->clients, list) { in host1x_device_init()
201 if (client->ops && client->ops->early_init) { in host1x_device_init()
202 err = client->ops->early_init(client); in host1x_device_init()
205 dev_name(client->dev), err); in host1x_device_init()
211 list_for_each_entry(client, &device->clients, list) { in host1x_device_init()
212 if (client->ops && client->ops->init) { in host1x_device_init()
213 err = client->ops->init(client); in host1x_device_init()
217 dev_name(client->dev), err); in host1x_device_init()
228 list_for_each_entry_continue_reverse(client, &device->clients, list) in host1x_device_init()
229 if (client->ops->exit) in host1x_device_init()
230 client->ops->exit(client); in host1x_device_init()
232 /* reset client to end of list for late teardown */ in host1x_device_init()
233 client = list_entry(&device->clients, struct host1x_client, list); in host1x_device_init()
236 list_for_each_entry_continue_reverse(client, &device->clients, list) in host1x_device_init()
237 if (client->ops->late_exit) in host1x_device_init()
238 client->ops->late_exit(client); in host1x_device_init()
256 struct host1x_client *client; in host1x_device_exit() local
261 list_for_each_entry_reverse(client, &device->clients, list) { in host1x_device_exit()
262 if (client->ops && client->ops->exit) { in host1x_device_exit()
263 err = client->ops->exit(client); in host1x_device_exit()
267 dev_name(client->dev), err); in host1x_device_exit()
274 list_for_each_entry_reverse(client, &device->clients, list) { in host1x_device_exit()
275 if (client->ops && client->ops->late_exit) { in host1x_device_exit()
276 err = client->ops->late_exit(client); in host1x_device_exit()
279 dev_name(client->dev), err); in host1x_device_exit()
293 struct host1x_client *client) in host1x_add_client() argument
302 if (subdev->np == client->dev->of_node) { in host1x_add_client()
303 host1x_subdev_register(device, subdev, client); in host1x_add_client()
315 struct host1x_client *client) in host1x_del_client() argument
324 if (subdev->client == client) { in host1x_del_client()
373 struct host1x_client *client, *cl; in __host1x_device_del() local
380 * host1x_subdev_unregister() will remove the client from in __host1x_device_del()
384 * XXX: Alternatively, perhaps don't remove the client from in __host1x_device_del()
388 client = subdev->client; in __host1x_device_del()
392 /* add the client to the list of idle clients */ in __host1x_device_del()
394 list_add_tail(&client->list, &clients); in __host1x_device_del()
408 list_for_each_entry_safe(client, cl, &device->clients, list) in __host1x_device_del()
409 list_move_tail(&client->list, &clients); in __host1x_device_del()
429 struct host1x_client *client, *tmp; in host1x_device_add() local
468 list_for_each_entry_safe(client, tmp, &clients, list) { in host1x_device_add()
470 if (subdev->np == client->dev->of_node) { in host1x_device_add()
471 host1x_subdev_register(device, subdev, client); in host1x_device_add()
551 dev_name(subdev->client->dev)); in host1x_devices_show()
715 * __host1x_client_init() - initialize a host1x client
716 * @client: host1x client
717 * @key: lock class key for the client-specific mutex
719 void __host1x_client_init(struct host1x_client *client, struct lock_class_key *key) in __host1x_client_init() argument
721 host1x_bo_cache_init(&client->cache); in __host1x_client_init()
722 INIT_LIST_HEAD(&client->list); in __host1x_client_init()
723 __mutex_init(&client->lock, "host1x client lock", key); in __host1x_client_init()
724 client->usecount = 0; in __host1x_client_init()
729 * host1x_client_exit() - uninitialize a host1x client
730 * @client: host1x client
732 void host1x_client_exit(struct host1x_client *client) in host1x_client_exit() argument
734 mutex_destroy(&client->lock); in host1x_client_exit()
739 * __host1x_client_register() - register a host1x client
740 * @client: host1x client
742 * Registers a host1x client with each host1x controller instance. Note that
743 * each client will only match their parent host1x controller and will only be
746 * device and call host1x_device_init(), which will in turn call each client's
749 int __host1x_client_register(struct host1x_client *client) in __host1x_client_register() argument
757 err = host1x_add_client(host1x, client); in __host1x_client_register()
767 list_add_tail(&client->list, &clients); in __host1x_client_register()
775 * host1x_client_unregister() - unregister a host1x client
776 * @client: host1x client
778 * Removes a host1x client from its host1x controller instance. If a logical
781 void host1x_client_unregister(struct host1x_client *client) in host1x_client_unregister() argument
790 err = host1x_del_client(host1x, client); in host1x_client_unregister()
801 if (c == client) { in host1x_client_unregister()
809 host1x_bo_cache_destroy(&client->cache); in host1x_client_unregister()
813 int host1x_client_suspend(struct host1x_client *client) in host1x_client_suspend() argument
817 mutex_lock(&client->lock); in host1x_client_suspend()
819 if (client->usecount == 1) { in host1x_client_suspend()
820 if (client->ops && client->ops->suspend) { in host1x_client_suspend()
821 err = client->ops->suspend(client); in host1x_client_suspend()
827 client->usecount--; in host1x_client_suspend()
828 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_suspend()
830 if (client->parent) { in host1x_client_suspend()
831 err = host1x_client_suspend(client->parent); in host1x_client_suspend()
839 if (client->usecount == 0) in host1x_client_suspend()
840 if (client->ops && client->ops->resume) in host1x_client_suspend()
841 client->ops->resume(client); in host1x_client_suspend()
843 client->usecount++; in host1x_client_suspend()
845 mutex_unlock(&client->lock); in host1x_client_suspend()
850 int host1x_client_resume(struct host1x_client *client) in host1x_client_resume() argument
854 mutex_lock(&client->lock); in host1x_client_resume()
856 if (client->parent) { in host1x_client_resume()
857 err = host1x_client_resume(client->parent); in host1x_client_resume()
862 if (client->usecount == 0) { in host1x_client_resume()
863 if (client->ops && client->ops->resume) { in host1x_client_resume()
864 err = client->ops->resume(client); in host1x_client_resume()
870 client->usecount++; in host1x_client_resume()
871 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_resume()
876 if (client->parent) in host1x_client_resume()
877 host1x_client_suspend(client->parent); in host1x_client_resume()
879 mutex_unlock(&client->lock); in host1x_client_resume()