Lines Matching full:client
27 struct host1x_client *client; member
111 struct host1x_client *client) in host1x_subdev_register() argument
117 * and associate it with a client. At the same time, associate the in host1x_subdev_register()
118 * client with its parent device. in host1x_subdev_register()
122 list_move_tail(&client->list, &device->clients); in host1x_subdev_register()
124 client->host = &device->dev; in host1x_subdev_register()
125 subdev->client = client; in host1x_subdev_register()
141 struct host1x_client *client = subdev->client; in __host1x_subdev_unregister() local
159 subdev->client = NULL; in __host1x_subdev_unregister()
160 client->host = NULL; in __host1x_subdev_unregister()
167 * used to remove the subdevice when a client is unregistered but in __host1x_subdev_unregister()
170 list_del_init(&client->list); in __host1x_subdev_unregister()
188 * The client drivers access the subsystem specific driver data using the
194 struct host1x_client *client; in host1x_device_init() local
199 list_for_each_entry(client, &device->clients, list) { in host1x_device_init()
200 if (client->ops && client->ops->early_init) { in host1x_device_init()
201 err = client->ops->early_init(client); in host1x_device_init()
204 dev_name(client->dev), err); in host1x_device_init()
210 list_for_each_entry(client, &device->clients, list) { in host1x_device_init()
211 if (client->ops && client->ops->init) { in host1x_device_init()
212 err = client->ops->init(client); in host1x_device_init()
216 dev_name(client->dev), err); in host1x_device_init()
227 list_for_each_entry_continue_reverse(client, &device->clients, list) in host1x_device_init()
228 if (client->ops->exit) in host1x_device_init()
229 client->ops->exit(client); in host1x_device_init()
231 /* reset client to end of list for late teardown */ in host1x_device_init()
232 client = list_entry(&device->clients, struct host1x_client, list); in host1x_device_init()
235 list_for_each_entry_continue_reverse(client, &device->clients, list) in host1x_device_init()
236 if (client->ops->late_exit) in host1x_device_init()
237 client->ops->late_exit(client); in host1x_device_init()
255 struct host1x_client *client; in host1x_device_exit() local
260 list_for_each_entry_reverse(client, &device->clients, list) { in host1x_device_exit()
261 if (client->ops && client->ops->exit) { in host1x_device_exit()
262 err = client->ops->exit(client); in host1x_device_exit()
266 dev_name(client->dev), err); in host1x_device_exit()
273 list_for_each_entry_reverse(client, &device->clients, list) { in host1x_device_exit()
274 if (client->ops && client->ops->late_exit) { in host1x_device_exit()
275 err = client->ops->late_exit(client); in host1x_device_exit()
278 dev_name(client->dev), err); in host1x_device_exit()
292 struct host1x_client *client) in host1x_add_client() argument
301 if (subdev->np == client->dev->of_node) { in host1x_add_client()
302 host1x_subdev_register(device, subdev, client); in host1x_add_client()
314 struct host1x_client *client) in host1x_del_client() argument
323 if (subdev->client == client) { in host1x_del_client()
395 struct host1x_client *client, *cl; in __host1x_device_del() local
402 * host1x_subdev_unregister() will remove the client from in __host1x_device_del()
406 * XXX: Alternatively, perhaps don't remove the client from in __host1x_device_del()
410 client = subdev->client; in __host1x_device_del()
414 /* add the client to the list of idle clients */ in __host1x_device_del()
416 list_add_tail(&client->list, &clients); in __host1x_device_del()
430 list_for_each_entry_safe(client, cl, &device->clients, list) in __host1x_device_del()
431 list_move_tail(&client->list, &clients); in __host1x_device_del()
451 struct host1x_client *client, *tmp; in host1x_device_add() local
492 list_for_each_entry_safe(client, tmp, &clients, list) { in host1x_device_add()
494 if (subdev->np == client->dev->of_node) { in host1x_device_add()
495 host1x_subdev_register(device, subdev, client); in host1x_device_add()
575 dev_name(subdev->client->dev)); in host1x_devices_show()
739 * __host1x_client_init() - initialize a host1x client
740 * @client: host1x client
741 * @key: lock class key for the client-specific mutex
743 void __host1x_client_init(struct host1x_client *client, struct lock_class_key *key) in __host1x_client_init() argument
745 INIT_LIST_HEAD(&client->list); in __host1x_client_init()
746 __mutex_init(&client->lock, "host1x client lock", key); in __host1x_client_init()
747 client->usecount = 0; in __host1x_client_init()
752 * host1x_client_exit() - uninitialize a host1x client
753 * @client: host1x client
755 void host1x_client_exit(struct host1x_client *client) in host1x_client_exit() argument
757 mutex_destroy(&client->lock); in host1x_client_exit()
762 * __host1x_client_register() - register a host1x client
763 * @client: host1x client
764 * @key: lock class key for the client-specific mutex
766 * Registers a host1x client with each host1x controller instance. Note that
767 * each client will only match their parent host1x controller and will only be
770 * device and call host1x_device_init(), which will in turn call each client's
773 int __host1x_client_register(struct host1x_client *client) in __host1x_client_register() argument
781 err = host1x_add_client(host1x, client); in __host1x_client_register()
791 list_add_tail(&client->list, &clients); in __host1x_client_register()
799 * host1x_client_unregister() - unregister a host1x client
800 * @client: host1x client
802 * Removes a host1x client from its host1x controller instance. If a logical
805 int host1x_client_unregister(struct host1x_client *client) in host1x_client_unregister() argument
814 err = host1x_del_client(host1x, client); in host1x_client_unregister()
825 if (c == client) { in host1x_client_unregister()
837 int host1x_client_suspend(struct host1x_client *client) in host1x_client_suspend() argument
841 mutex_lock(&client->lock); in host1x_client_suspend()
843 if (client->usecount == 1) { in host1x_client_suspend()
844 if (client->ops && client->ops->suspend) { in host1x_client_suspend()
845 err = client->ops->suspend(client); in host1x_client_suspend()
851 client->usecount--; in host1x_client_suspend()
852 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_suspend()
854 if (client->parent) { in host1x_client_suspend()
855 err = host1x_client_suspend(client->parent); in host1x_client_suspend()
863 if (client->usecount == 0) in host1x_client_suspend()
864 if (client->ops && client->ops->resume) in host1x_client_suspend()
865 client->ops->resume(client); in host1x_client_suspend()
867 client->usecount++; in host1x_client_suspend()
869 mutex_unlock(&client->lock); in host1x_client_suspend()
874 int host1x_client_resume(struct host1x_client *client) in host1x_client_resume() argument
878 mutex_lock(&client->lock); in host1x_client_resume()
880 if (client->parent) { in host1x_client_resume()
881 err = host1x_client_resume(client->parent); in host1x_client_resume()
886 if (client->usecount == 0) { in host1x_client_resume()
887 if (client->ops && client->ops->resume) { in host1x_client_resume()
888 err = client->ops->resume(client); in host1x_client_resume()
894 client->usecount++; in host1x_client_resume()
895 dev_dbg(client->dev, "use count: %u\n", client->usecount); in host1x_client_resume()
900 if (client->parent) in host1x_client_resume()
901 host1x_client_suspend(client->parent); in host1x_client_resume()
903 mutex_unlock(&client->lock); in host1x_client_resume()