Lines Matching full:consumer
50 * @con: Consumer end of the link.
72 if (link->consumer == con) { in __fwnode_link_add()
83 link->consumer = con; in __fwnode_link_add()
89 pr_debug("%pfwf Linked as a fwnode consumer to %pfwf\n", in __fwnode_link_add()
114 link->consumer, link->supplier); in __fwnode_link_del()
129 link->consumer, link->supplier); in __fwnode_link_cycle()
150 * fwnode_links_purge_consumers - Delete all consumer links of fwnode_handle.
151 * @fwnode: fwnode whose consumer links need to be deleted
153 * Deletes all consumer links connecting directly to @fwnode.
181 /* Don't purge consumer links of an added child */ in fw_devlink_purge_absent_suppliers()
194 * __fwnode_links_move_consumers - Move consumer from @from to @to fwnode_handle
198 * Move all consumer links from @from fwnode to @to fwnode.
206 __fwnode_link_add(link->consumer, to, link->flags); in __fwnode_links_move_consumers()
301 * its consumer etc). Return 1 if that is the case or 0 otherwise.
324 if (link->consumer == target) in device_is_dependent()
327 ret = device_is_dependent(link->consumer, target); in device_is_dependent()
335 struct device *consumer, in device_link_init_status() argument
340 switch (consumer->links.status) { in device_link_init_status()
343 * A consumer driver can create a link to a supplier in device_link_init_status()
357 switch (consumer->links.status) { in device_link_init_status()
396 device_reorder_to_tail(link->consumer, NULL); in device_reorder_to_tail()
440 output = "consumer probing"; in status_show()
466 output = "consumer unbind"; in auto_remove_on_show()
522 put_device(link->consumer); in device_link_release_fn()
534 * synchronization in device_link_release_fn() and if the consumer or in devlink_dev_release()
553 struct device *con = link->consumer; in devlink_add_symlinks()
568 ret = sysfs_create_link(&link->link_dev.kobj, &con->kobj, "consumer"); in devlink_add_symlinks()
572 snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con)); in devlink_add_symlinks()
585 snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con)); in devlink_add_symlinks()
588 sysfs_remove_link(&link->link_dev.kobj, "consumer"); in devlink_add_symlinks()
601 struct device *con = link->consumer; in devlink_remove_symlinks()
604 sysfs_remove_link(&link->link_dev.kobj, "consumer"); in devlink_remove_symlinks()
621 snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con)); in devlink_remove_symlinks()
660 * @consumer: Consumer end of the link.
683 * after unbinding the consumer or supplier driver, respectively, from its
686 * the consumer or the supplier) is unregistered.
691 * be used to request the driver core to automatically probe for a consumer
697 * However, if a device link between the given @consumer and @supplier pair
706 * devices_kset list by moving the consumer device and all devices depending
711 * and NULL will be returned if that is not the case. The consumer device need
714 struct device_link *device_link_add(struct device *consumer, in device_link_add() argument
719 if (!consumer || !supplier || consumer == supplier || in device_link_add()
746 * reverse (non-SYNC_STATE_ONLY) dependency between the consumer and in device_link_add()
753 device_is_dependent(consumer, supplier))) { in device_link_add()
759 * SYNC_STATE_ONLY links are useless once a consumer device has probed. in device_link_add()
760 * So, only create it if the consumer hasn't probed yet. in device_link_add()
763 consumer->links.status != DL_DEV_NO_DRIVER && in device_link_add()
764 consumer->links.status != DL_DEV_PROBING) { in device_link_add()
778 if (link->consumer != consumer) in device_link_add()
787 pm_runtime_new_link(consumer); in device_link_add()
823 device_link_init_status(link, consumer, supplier); in device_link_add()
843 get_device(consumer); in device_link_add()
844 link->consumer = consumer; in device_link_add()
853 dev_bus_name(consumer), dev_name(consumer)); in device_link_add()
864 pm_runtime_new_link(consumer); in device_link_add()
871 device_link_init_status(link, consumer, supplier); in device_link_add()
874 * Some callers expect the link creation during consumer driver probe to in device_link_add()
882 list_add_tail_rcu(&link->c_node, &consumer->links.suppliers); in device_link_add()
885 dev_dbg(consumer, in device_link_add()
886 "Linked as a sync state only consumer to %s\n", in device_link_add()
893 * Move the consumer and all of the devices depending on it to the end in device_link_add()
899 device_reorder_to_tail(consumer, NULL); in device_link_add()
901 dev_dbg(consumer, "Linked as a consumer to %s\n", dev_name(supplier)); in device_link_add()
918 dev_dbg(link->consumer, "Dropping the link to %s\n", in __device_link_del()
931 else if (!device_is_registered(link->consumer)) in device_link_put_kref()
956 * @consumer: Consumer end of the link.
962 void device_link_remove(void *consumer, struct device *supplier) in device_link_remove() argument
966 if (WARN_ON(consumer == supplier)) in device_link_remove()
972 if (link->consumer == consumer) { in device_link_remove()
1022 * @dev: Consumer device.
1031 * mark the link as "consumer probe in progress" to make the supplier removal
1244 * @dev: Consumer device.
1247 * driver probe functions. So the consumer really isn't going to wait for any
1326 * Links created during consumer probe may be in the "consumer in device_links_driver_bound()
1329 * consumer probe returns first. Skip them here. in device_links_driver_bound()
1339 driver_deferred_probe_add(link->consumer); in device_links_driver_bound()
1368 * consumer device still managed to probe, there's no in device_links_driver_bound()
1370 * (consumer probed before supplier). So delete it. in device_links_driver_bound()
1459 * "consumer probe" or "active", it must have been added by in device_links_no_driver()
1460 * a probing consumer while this device was still probing. in device_links_no_driver()
1498 * autoremove the links between this @dev and its consumer in device_links_driver_cleanup()
1519 * Check each consumer of the device and return 'true' if its link's status
1520 * is one of "consumer probe" or "active" (meaning that the given consumer is
1522 * state to "supplier unbind" to prevent the consumer from being probed
1559 * "consumer probe" state, wait for all device probes in progress to complete
1563 * and check if the link was in the "active" state. If so, force the consumer
1564 * driver to unbind and start over (the consumer will not re-probe as we have
1592 struct device *consumer = link->consumer; in device_links_unbind_consumers() local
1594 get_device(consumer); in device_links_unbind_consumers()
1598 device_release_driver_internal(consumer, NULL, in device_links_unbind_consumers()
1599 consumer->parent); in device_links_unbind_consumers()
1600 put_device(consumer); in device_links_unbind_consumers()
1744 dev_dbg(link->consumer, "Relaxing link with %s\n", in fw_devlink_relax_link()
1779 dev_name(link->consumer)); in fw_devlink_dev_sync_state()
1906 * @con: Potential consumer device.
1955 * driver, sup_dev can't be a consumer of @con. So, no need to check in __fw_devlink_relax_cycles()
2016 * fw_devlink_create_devlink - Create a device link from a consumer to fwnode
2017 * @con: consumer device for the device link
2021 * This function will try to create a device link between the consumer device
2027 * device link from the consumer to a missing supplier.
2043 if (con->fwnode == link->consumer) in fw_devlink_create_devlink()
2072 * is because the consumer and supplier might be part of multiple cycles in fw_devlink_create_devlink()
2138 * This function looks at all the consumer fwnodes of @dev and creates device
2139 * links between the consumer device and @dev (supplier).
2141 * If the consumer device has not been added yet, then this function creates a
2143 * of the consumer fwnode. This is necessary to make sure @dev doesn't get a
2144 * sync_state() callback before the real consumer device gets to be added and
2147 * Once device links are created from the real consumer to @dev (supplier), the
2160 con_dev = get_dev_from_fwnode(link->consumer); in __fw_devlink_link_to_consumers()
2162 * If consumer device is not available yet, make a "proxy" in __fw_devlink_link_to_consumers()
2163 * SYNC_STATE_ONLY link from the consumer's parent device to in __fw_devlink_link_to_consumers()
2166 * consumer can create a device link to the supplier. in __fw_devlink_link_to_consumers()
2169 * consumer's parent device is added before the supplier. in __fw_devlink_link_to_consumers()
2172 con_dev = fwnode_get_next_parent_dev(link->consumer); in __fw_devlink_link_to_consumers()
2174 * However, if the consumer's parent device is also the in __fw_devlink_link_to_consumers()
2176 * consumer-supplier link from the parent to its child in __fw_devlink_link_to_consumers()
2202 * @dev: The consumer device that needs to be linked to its suppliers
2206 * @fwnode and creates device links between @dev (consumer) and all the
2217 * @dev (consumer) and these suppliers to make sure they don't execute their
2221 * between the real consumer and supplier devices.
2244 * case where the supplier is added before the consumer's parent device in __fw_devlink_link_to_suppliers()
3644 * case the consumer device is able to operate without this supplier. in device_add()