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()
379 struct host1x_client *client, *cl; in __host1x_device_del() local
386 * host1x_subdev_unregister() will remove the client from in __host1x_device_del()
390 * XXX: Alternatively, perhaps don't remove the client from in __host1x_device_del()
394 client = subdev->client; in __host1x_device_del()
398 /* add the client to the list of idle clients */ in __host1x_device_del()
400 list_add_tail(&client->list, &clients); in __host1x_device_del()
414 list_for_each_entry_safe(client, cl, &device->clients, list) in __host1x_device_del()
415 list_move_tail(&client->list, &clients); in __host1x_device_del()
435 struct host1x_client *client, *tmp; in host1x_device_add() local
476 list_for_each_entry_safe(client, tmp, &clients, list) { in host1x_device_add()
478 if (subdev->np == client->dev->of_node) { in host1x_device_add()
479 host1x_subdev_register(device, subdev, client); in host1x_device_add()
559 dev_name(subdev->client->dev)); in host1x_devices_show()
723 * __host1x_client_init() - initialize a host1x client
724 * @client: host1x client
725 * @key: lock class key for the client-specific mutex
727 void __host1x_client_init(struct host1x_client *client, struct lock_class_key *key) in __host1x_client_init() argument
729 host1x_bo_cache_init(&client->cache); in __host1x_client_init()
730 INIT_LIST_HEAD(&client->list); in __host1x_client_init()
731 __mutex_init(&client->lock, "host1x client lock", key); in __host1x_client_init()
732 client->usecount = 0; in __host1x_client_init()
737 * host1x_client_exit() - uninitialize a host1x client
738 * @client: host1x client
740 void host1x_client_exit(struct host1x_client *client) in host1x_client_exit() argument
742 mutex_destroy(&client->lock); in host1x_client_exit()
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
754 * device and call host1x_device_init(), which will in turn call each client's
757 int __host1x_client_register(struct host1x_client *client) in __host1x_client_register() argument
765 err = host1x_add_client(host1x, client); in __host1x_client_register()
775 list_add_tail(&client->list, &clients); in __host1x_client_register()
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
789 void host1x_client_unregister(struct host1x_client *client) in host1x_client_unregister() argument
798 err = host1x_del_client(host1x, client); in host1x_client_unregister()
809 if (c == client) { in host1x_client_unregister()
817 host1x_bo_cache_destroy(&client->cache); in host1x_client_unregister()
821 int host1x_client_suspend(struct host1x_client *client) in host1x_client_suspend() argument
825 mutex_lock(&client->lock); in host1x_client_suspend()
827 if (client->usecount == 1) { in host1x_client_suspend()
828 if (client->ops && client->ops->suspend) { in host1x_client_suspend()
829 err = client->ops->suspend(client); in host1x_client_suspend()
835 client->usecount--; in host1x_client_suspend()
836 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_suspend()
838 if (client->parent) { in host1x_client_suspend()
839 err = host1x_client_suspend(client->parent); in host1x_client_suspend()
847 if (client->usecount == 0) in host1x_client_suspend()
848 if (client->ops && client->ops->resume) in host1x_client_suspend()
849 client->ops->resume(client); in host1x_client_suspend()
851 client->usecount++; in host1x_client_suspend()
853 mutex_unlock(&client->lock); in host1x_client_suspend()
858 int host1x_client_resume(struct host1x_client *client) in host1x_client_resume() argument
862 mutex_lock(&client->lock); in host1x_client_resume()
864 if (client->parent) { in host1x_client_resume()
865 err = host1x_client_resume(client->parent); in host1x_client_resume()
870 if (client->usecount == 0) { in host1x_client_resume()
871 if (client->ops && client->ops->resume) { in host1x_client_resume()
872 err = client->ops->resume(client); in host1x_client_resume()
878 client->usecount++; in host1x_client_resume()
879 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_resume()
884 if (client->parent) in host1x_client_resume()
885 host1x_client_suspend(client->parent); in host1x_client_resume()
887 mutex_unlock(&client->lock); in host1x_client_resume()