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()
396 struct host1x_client *client, *cl; in __host1x_device_del() local
403 * host1x_subdev_unregister() will remove the client from in __host1x_device_del()
407 * XXX: Alternatively, perhaps don't remove the client from in __host1x_device_del()
411 client = subdev->client; in __host1x_device_del()
415 /* add the client to the list of idle clients */ in __host1x_device_del()
417 list_add_tail(&client->list, &clients); in __host1x_device_del()
431 list_for_each_entry_safe(client, cl, &device->clients, list) in __host1x_device_del()
432 list_move_tail(&client->list, &clients); in __host1x_device_del()
452 struct host1x_client *client, *tmp; in host1x_device_add() local
493 list_for_each_entry_safe(client, tmp, &clients, list) { in host1x_device_add()
495 if (subdev->np == client->dev->of_node) { in host1x_device_add()
496 host1x_subdev_register(device, subdev, client); in host1x_device_add()
576 dev_name(subdev->client->dev)); in host1x_devices_show()
740 * __host1x_client_init() - initialize a host1x client
741 * @client: host1x client
742 * @key: lock class key for the client-specific mutex
744 void __host1x_client_init(struct host1x_client *client, struct lock_class_key *key) in __host1x_client_init() argument
746 host1x_bo_cache_init(&client->cache); in __host1x_client_init()
747 INIT_LIST_HEAD(&client->list); in __host1x_client_init()
748 __mutex_init(&client->lock, "host1x client lock", key); in __host1x_client_init()
749 client->usecount = 0; in __host1x_client_init()
754 * host1x_client_exit() - uninitialize a host1x client
755 * @client: host1x client
757 void host1x_client_exit(struct host1x_client *client) in host1x_client_exit() argument
759 mutex_destroy(&client->lock); in host1x_client_exit()
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
771 * device and call host1x_device_init(), which will in turn call each client's
774 int __host1x_client_register(struct host1x_client *client) in __host1x_client_register() argument
782 err = host1x_add_client(host1x, client); in __host1x_client_register()
792 list_add_tail(&client->list, &clients); 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
806 int host1x_client_unregister(struct host1x_client *client) in host1x_client_unregister() argument
815 err = host1x_del_client(host1x, client); in host1x_client_unregister()
826 if (c == client) { in host1x_client_unregister()
834 host1x_bo_cache_destroy(&client->cache); in host1x_client_unregister()
840 int host1x_client_suspend(struct host1x_client *client) in host1x_client_suspend() argument
844 mutex_lock(&client->lock); in host1x_client_suspend()
846 if (client->usecount == 1) { in host1x_client_suspend()
847 if (client->ops && client->ops->suspend) { in host1x_client_suspend()
848 err = client->ops->suspend(client); in host1x_client_suspend()
854 client->usecount--; in host1x_client_suspend()
855 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_suspend()
857 if (client->parent) { in host1x_client_suspend()
858 err = host1x_client_suspend(client->parent); in host1x_client_suspend()
866 if (client->usecount == 0) in host1x_client_suspend()
867 if (client->ops && client->ops->resume) in host1x_client_suspend()
868 client->ops->resume(client); in host1x_client_suspend()
870 client->usecount++; in host1x_client_suspend()
872 mutex_unlock(&client->lock); in host1x_client_suspend()
877 int host1x_client_resume(struct host1x_client *client) in host1x_client_resume() argument
881 mutex_lock(&client->lock); in host1x_client_resume()
883 if (client->parent) { in host1x_client_resume()
884 err = host1x_client_resume(client->parent); in host1x_client_resume()
889 if (client->usecount == 0) { in host1x_client_resume()
890 if (client->ops && client->ops->resume) { in host1x_client_resume()
891 err = client->ops->resume(client); in host1x_client_resume()
897 client->usecount++; in host1x_client_resume()
898 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_resume()
903 if (client->parent) in host1x_client_resume()
904 host1x_client_suspend(client->parent); in host1x_client_resume()
906 mutex_unlock(&client->lock); in host1x_client_resume()