Lines Matching defs:dca
29 #include <linux/dca.h>
94 struct dca_provider *dca, *_dca;
116 list_for_each_entry_safe(dca, _dca, &domain->dca_providers, node) {
117 list_del(&dca->node);
118 list_add(&dca->node, &unregistered_providers);
125 list_for_each_entry_safe(dca, _dca, &unregistered_providers, node) {
126 dca_sysfs_remove_provider(dca);
127 list_del(&dca->node);
165 struct dca_provider *dca;
183 list_for_each_entry(dca, &domain->dca_providers, node)
184 if ((!dev) || (dca->ops->dev_managed(dca, dev)))
185 return dca;
191 * dca_add_requester - add a dca client to the list
192 * @dev - the device that wants dca service
196 struct dca_provider *dca;
208 dca = dca_find_provider_by_dev(dev);
209 if (dca) {
221 list_for_each_entry(dca, &domain->dca_providers, node) {
222 slot = dca->ops->add_requester(dca, dev);
232 err = dca_sysfs_add_req(dca, dev, slot);
235 if (dca == dca_find_provider_by_dev(dev))
236 dca->ops->remove_requester(dca, dev);
246 * dca_remove_requester - remove a dca client from the list
247 * @dev - the device that wants dca service
251 struct dca_provider *dca;
259 dca = dca_find_provider_by_dev(dev);
260 if (!dca) {
264 slot = dca->ops->remove_requester(dca, dev);
270 dca_sysfs_remove_req(dca, slot);
277 * dca_common_get_tag - return the dca tag (serves both new and old api)
278 * @dev - the device that wants dca service
283 struct dca_provider *dca;
289 dca = dca_find_provider_by_dev(dev);
290 if (!dca) {
294 tag = dca->ops->get_tag(dca, dev, cpu);
301 * dca3_get_tag - return the dca tag to the requester device
303 * @dev - the device that wants dca service
316 * dca_get_tag - return the dca tag for the given cpu (old api)
328 * alloc_dca_provider - get data struct for describing a dca provider
329 * @ops - pointer to struct of dca operation function pointers
334 struct dca_provider *dca;
337 alloc_size = (sizeof(*dca) + priv_size);
338 dca = kzalloc(alloc_size, GFP_KERNEL);
339 if (!dca)
341 dca->ops = ops;
343 return dca;
348 * free_dca_provider - release the dca provider data struct
349 * @ops - pointer to struct of dca operation function pointers
352 void free_dca_provider(struct dca_provider *dca)
354 kfree(dca);
359 * register_dca_provider - register a dca provider
360 * @dca - struct created by alloc_dca_provider()
361 * @dev - device providing dca services
363 int register_dca_provider(struct dca_provider *dca, struct device *dev)
376 err = dca_sysfs_add_provider(dca, dev);
385 dca_sysfs_remove_provider(dca);
392 list_add(&dca->node, &domain->dca_providers);
402 * unregister_dca_provider - remove a dca provider
403 * @dca - struct created by alloc_dca_provider()
405 void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
416 list_del(&dca->node);
425 dca_sysfs_remove_provider(dca);
449 pr_info("dca service started, version %s\n", DCA_VERSION);