Lines Matching +full:interface +full:- +full:node

1 // SPDX-License-Identifier: GPL-2.0
3 * property.c - Unified device property interface.
23 return IS_ENABLED(CONFIG_OF) && dev->of_node ? in __dev_fwnode()
24 of_fwnode_handle(dev->of_node) : dev->fwnode; in __dev_fwnode()
30 return IS_ENABLED(CONFIG_OF) && dev->of_node ? in __dev_fwnode_const()
31 of_fwnode_handle(dev->of_node) : dev->fwnode; in __dev_fwnode_const()
36 * device_property_present - check if a property of a device is present
51 * fwnode_property_present - check if a property of a firmware node is present
52 * @fwnode: Firmware node whose property to check
69 return fwnode_call_bool_op(fwnode->secondary, property_present, propname); in fwnode_property_present()
74 * device_property_read_u8_array - return a u8 array property of a device
88 * %-EINVAL if given arguments are not valid,
89 * %-ENODATA if the property does not have a value,
90 * %-EPROTO if the property is not an array of numbers,
91 * %-EOVERFLOW if the size of the property is not as expected.
92 * %-ENXIO if no suitable firmware interface is present.
102 * device_property_read_u16_array - return a u16 array property of a device
116 * %-EINVAL if given arguments are not valid,
117 * %-ENODATA if the property does not have a value,
118 * %-EPROTO if the property is not an array of numbers,
119 * %-EOVERFLOW if the size of the property is not as expected.
120 * %-ENXIO if no suitable firmware interface is present.
130 * device_property_read_u32_array - return a u32 array property of a device
144 * %-EINVAL if given arguments are not valid,
145 * %-ENODATA if the property does not have a value,
146 * %-EPROTO if the property is not an array of numbers,
147 * %-EOVERFLOW if the size of the property is not as expected.
148 * %-ENXIO if no suitable firmware interface is present.
158 * device_property_read_u64_array - return a u64 array property of a device
172 * %-EINVAL if given arguments are not valid,
173 * %-ENODATA if the property does not have a value,
174 * %-EPROTO if the property is not an array of numbers,
175 * %-EOVERFLOW if the size of the property is not as expected.
176 * %-ENXIO if no suitable firmware interface is present.
186 * device_property_read_string_array - return a string array property of device
198 * Return: number of values read on success if @val is non-NULL,
200 * %-EINVAL if given arguments are not valid,
201 * %-ENODATA if the property does not have a value,
202 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
203 * %-EOVERFLOW if the size of the property is not as expected.
204 * %-ENXIO if no suitable firmware interface is present.
214 * device_property_read_string - return a string property of a device
223 * %-EINVAL if given arguments are not valid,
224 * %-ENODATA if the property does not have a value,
225 * %-EPROTO or %-EILSEQ if the property type is not a string.
226 * %-ENXIO if no suitable firmware interface is present.
236 * device_property_match_string - find a string in an array and return index
245 * %-EINVAL if given arguments are not valid,
246 * %-ENODATA if the property does not have a value,
247 * %-EPROTO if the property is not an array of strings,
248 * %-ENXIO if no suitable firmware interface is present.
265 return -EINVAL; in fwnode_property_read_int_array()
269 if (ret != -EINVAL) in fwnode_property_read_int_array()
272 return fwnode_call_int_op(fwnode->secondary, property_read_int_array, propname, in fwnode_property_read_int_array()
277 * fwnode_property_read_u8_array - return a u8 array property of firmware node
278 * @fwnode: Firmware node to get the property of
291 * %-EINVAL if given arguments are not valid,
292 * %-ENODATA if the property does not have a value,
293 * %-EPROTO if the property is not an array of numbers,
294 * %-EOVERFLOW if the size of the property is not as expected,
295 * %-ENXIO if no suitable firmware interface is present.
306 * fwnode_property_read_u16_array - return a u16 array property of firmware node
307 * @fwnode: Firmware node to get the property of
320 * %-EINVAL if given arguments are not valid,
321 * %-ENODATA if the property does not have a value,
322 * %-EPROTO if the property is not an array of numbers,
323 * %-EOVERFLOW if the size of the property is not as expected,
324 * %-ENXIO if no suitable firmware interface is present.
335 * fwnode_property_read_u32_array - return a u32 array property of firmware node
336 * @fwnode: Firmware node to get the property of
349 * %-EINVAL if given arguments are not valid,
350 * %-ENODATA if the property does not have a value,
351 * %-EPROTO if the property is not an array of numbers,
352 * %-EOVERFLOW if the size of the property is not as expected,
353 * %-ENXIO if no suitable firmware interface is present.
364 * fwnode_property_read_u64_array - return a u64 array property firmware node
365 * @fwnode: Firmware node to get the property of
378 * %-EINVAL if given arguments are not valid,
379 * %-ENODATA if the property does not have a value,
380 * %-EPROTO if the property is not an array of numbers,
381 * %-EOVERFLOW if the size of the property is not as expected,
382 * %-ENXIO if no suitable firmware interface is present.
393 * fwnode_property_read_string_array - return string array property of a node
394 * @fwnode: Firmware node to get the property of
399 * Read an string list property @propname from the given firmware node and store
405 * Return: number of values read on success if @val is non-NULL,
407 * %-EINVAL if given arguments are not valid,
408 * %-ENODATA if the property does not have a value,
409 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
410 * %-EOVERFLOW if the size of the property is not as expected,
411 * %-ENXIO if no suitable firmware interface is present.
420 return -EINVAL; in fwnode_property_read_string_array()
424 if (ret != -EINVAL) in fwnode_property_read_string_array()
427 return fwnode_call_int_op(fwnode->secondary, property_read_string_array, propname, in fwnode_property_read_string_array()
433 * fwnode_property_read_string - return a string property of a firmware node
434 * @fwnode: Firmware node to get the property of
438 * Read property @propname from the given firmware node and store the value into
442 * %-EINVAL if given arguments are not valid,
443 * %-ENODATA if the property does not have a value,
444 * %-EPROTO or %-EILSEQ if the property is not a string,
445 * %-ENXIO if no suitable firmware interface is present.
457 * fwnode_property_match_string - find a string in an array and return index
458 * @fwnode: Firmware node to get the property of
466 * %-EINVAL if given arguments are not valid,
467 * %-ENODATA if the property does not have a value,
468 * %-EPROTO if the property is not an array of strings,
469 * %-ENXIO if no suitable firmware interface is present.
482 return -ENODATA; in fwnode_property_match_string()
486 return -ENOMEM; in fwnode_property_match_string()
494 ret = -ENODATA; in fwnode_property_match_string()
503 * fwnode_property_match_property_string - find a property string value in an array and return index
504 * @fwnode: Firmware node to get the property of
513 * %-ENOENT when the string value was not found in the @array,
514 * %-EINVAL if given arguments are not valid,
515 * %-ENODATA if the property does not have a value,
516 * %-EPROTO or %-EILSEQ if the property is not a string,
517 * %-ENXIO if no suitable firmware interface is present.
531 ret = -ENOENT; in fwnode_property_match_property_string()
538 * fwnode_property_get_reference_args() - Find a reference with arguments
539 * @fwnode: Firmware node where to look for the reference
542 * arguments in the referred node. NULL if @nargs is known,
544 * @nargs: Number of arguments. Ignored if @nargs_prop is non-NULL.
553 * @args->fwnode pointer.
556 * %-ENOENT when the index is out of bounds, the index has an empty
558 * %-EINVAL on parse error
568 return -ENOENT; in fwnode_property_get_reference_args()
575 if (IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_get_reference_args()
578 return fwnode_call_int_op(fwnode->secondary, get_reference_args, prop, nargs_prop, in fwnode_property_get_reference_args()
584 * fwnode_find_reference - Find named reference to a fwnode_handle
585 * @fwnode: Firmware node where to look for the reference
611 * fwnode_get_name - Return the name of a node
612 * @fwnode: The firmware node
614 * Return: a pointer to the node name, or %NULL.
623 * fwnode_get_name_prefix - Return the prefix of node for printing purposes
624 * @fwnode: The firmware node
626 * Return: the prefix of a node, intended to be printed right before the node.
635 * fwnode_name_eq - Return true if node name is equal
636 * @fwnode: The firmware node
637 * @name: The name to which to compare the node name
639 * Compare the name provided as an argument to the name of the node, stopping
641 * function is generally used for comparing node names while ignoring the
642 * possible unit address of the node.
644 * Return: true if the node name matches with the name provided in the @name
656 len = strchrnul(node_name, '@') - node_name; in fwnode_name_eq()
663 * fwnode_get_parent - Return parent firwmare node
669 * Return: parent firmware node of the given node if possible or %NULL if no
679 * fwnode_get_next_parent - Iterate to the node's parent
683 * on the passed node, making it suitable for iterating through a
684 * node's parents.
690 * Return: parent firmware node of the given node if possible or %NULL if no
704 * fwnode_count_parents - Return the number of parents a node has
705 * @fwnode: The node the parents of which are to be counted
707 * Return: the number of parents a node has.
722 * fwnode_get_nth_parent - Return an nth parent of a node
723 * @fwnode: The node the parent of which is requested
724 * @depth: Distance of the parent from the node
729 * Return: the nth parent of a node. If there is no parent at the requested
742 if (--depth == 0) in fwnode_get_nth_parent()
750 * fwnode_get_next_child_node - Return the next child node handle for a node
751 * @fwnode: Firmware node to find the next child node for.
752 * @child: Handle to one of the node's child nodes or a %NULL handle.
767 * fwnode_get_next_available_child_node - Return the next available child node handle for a node
768 * @fwnode: Firmware node to find the next child node for.
769 * @child: Handle to one of the node's child nodes or a %NULL handle.
795 * device_get_next_child_node - Return the next child node handle for a device
796 * @dev: Device to find the next child node for.
818 return fwnode_get_next_child_node(fwnode->secondary, child); in device_get_next_child_node()
823 * fwnode_get_named_child_node - Return first matching named child node handle
824 * @fwnode: Firmware node to find the named child node for.
825 * @childname: String to match child node name against.
839 * device_get_named_child_node - Return first matching named child node handle
840 * @dev: Device to find the named child node for.
841 * @childname: String to match child node name against.
854 * fwnode_handle_get - Obtain a reference to a device node
855 * @fwnode: Pointer to the device node to obtain the reference to.
872 * fwnode_device_is_available - check if a device is available for use
877 * For fwnode node types that don't implement the .device_is_available()
893 * device_get_child_node_count - return the number of child nodes for device
926 * fwnode_get_phy_mode - Get phy mode for given firmware node
927 * @fwnode: Pointer to the given node
929 * The function gets phy interface string from property 'phy-mode' or
930 * 'phy-connection-type', and return its index in phy_modes table, or errno in
938 err = fwnode_property_read_string(fwnode, "phy-mode", &pm); in fwnode_get_phy_mode()
941 "phy-connection-type", &pm); in fwnode_get_phy_mode()
949 return -ENODEV; in fwnode_get_phy_mode()
954 * device_get_phy_mode - Get phy mode for given device
957 * The function gets phy interface string from property 'phy-mode' or
958 * 'phy-connection-type', and return its index in phy_modes table, or errno in
968 * fwnode_iomap - Maps the memory mapped IO for a given fwnode
969 * @fwnode: Pointer to the firmware node
981 * fwnode_irq_get - Get IRQ directly from a fwnode
982 * @fwnode: Pointer to the firmware node
983 * @index: Zero-based index of the IRQ
994 return -EINVAL; in fwnode_irq_get()
1001 * fwnode_irq_get_byname - Get IRQ from a fwnode using its name
1002 * @fwnode: Pointer to the firmware node
1006 * Find a match to the string @name in the 'interrupt-names' string array
1018 return -EINVAL; in fwnode_irq_get_byname()
1020 index = fwnode_property_match_string(fwnode, "interrupt-names", name); in fwnode_irq_get_byname()
1029 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node
1030 * @fwnode: Pointer to the parent firmware node
1031 * @prev: Previous endpoint node or %NULL to get the first
1037 * Return: an endpoint firmware node pointer or %NULL if no more endpoints
1049 * an endpoint from fwnode->secondary, then we need to use the secondary in fwnode_graph_get_next_endpoint()
1065 ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); in fwnode_graph_get_next_endpoint()
1074 * fwnode_graph_get_port_parent - Return the device fwnode of a port endpoint
1075 * @endpoint: Endpoint firmware node of the port
1080 * Return: the firmware node of the device the @endpoint belongs to.
1097 * fwnode_graph_get_remote_port_parent - Return fwnode of a remote device
1098 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1100 * Extracts firmware node of a remote device the @fwnode points to.
1120 * fwnode_graph_get_remote_port - Return fwnode of a remote port
1121 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1123 * Extracts firmware node of a remote port the @fwnode points to.
1136 * fwnode_graph_get_remote_endpoint - Return fwnode of a remote endpoint
1137 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1139 * Extracts firmware node of a remote endpoint the @fwnode points to.
1164 * fwnode_graph_get_endpoint_by_id - get endpoint by port and endpoint numbers
1166 * @port: identifier of the port node
1167 * @endpoint: identifier of the endpoint node under the port node
1231 * fwnode_graph_get_endpoint_count - Count endpoints on a device node
1232 * @fwnode: The node related to a device
1234 * Count endpoints in a device node.
1256 * fwnode_graph_parse_endpoint - parse common endpoint node properties
1260 * Parse @fwnode representing a graph endpoint node and store the
1285 struct fwnode_handle *node; in fwnode_graph_devcon_matches() local
1296 node = fwnode_graph_get_remote_port_parent(ep); in fwnode_graph_devcon_matches()
1297 if (!fwnode_device_is_available(node)) { in fwnode_graph_devcon_matches()
1298 fwnode_handle_put(node); in fwnode_graph_devcon_matches()
1302 ret = match(node, con_id, data); in fwnode_graph_devcon_matches()
1303 fwnode_handle_put(node); in fwnode_graph_devcon_matches()
1319 struct fwnode_handle *node; in fwnode_devcon_matches() local
1328 node = fwnode_find_reference(fwnode, con_id, i); in fwnode_devcon_matches()
1329 if (IS_ERR(node)) in fwnode_devcon_matches()
1332 ret = match(node, NULL, data); in fwnode_devcon_matches()
1333 fwnode_handle_put(node); in fwnode_devcon_matches()
1345 * fwnode_connection_find_match - Find connection from a device node
1346 * @fwnode: Device node with the connection
1352 * device node. @match will be used to convert the connection description to
1375 * fwnode_connection_find_matches - Find connections from a device node
1376 * @fwnode: Device node with the connection
1402 return -EINVAL; in fwnode_connection_find_matches()
1409 matches_len -= count_graph; in fwnode_connection_find_matches()