Lines Matching +full:firmware +full:- +full:name

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
38 * @propname: Name of the property
40 * Check if property @propname is present in the device firmware description.
51 * fwnode_property_present - check if a property of a firmware node is present
52 * @fwnode: Firmware node whose property to check
53 * @propname: Name of the property
69 return fwnode_call_bool_op(fwnode->secondary, property_present, propname); in fwnode_property_present()
74 * device_property_read_bool - Return the value for a boolean property of a device
76 * @propname: Name of the property
78 * Return if property @propname is true or false in the device firmware description.
89 * fwnode_property_read_bool - Return the value for a boolean property of a firmware node
90 * @fwnode: Firmware node whose property to check
91 * @propname: Name of the property
93 * Return if property @propname is true or false in the firmware description.
107 return fwnode_call_bool_op(fwnode->secondary, property_read_bool, propname); in fwnode_property_read_bool()
112 * device_property_read_u8_array - return a u8 array property of a device
114 * @propname: Name of the property
119 * firmware description and stores them to @val if found.
126 * %-EINVAL if given arguments are not valid,
127 * %-ENODATA if the property does not have a value,
128 * %-EPROTO if the property is not an array of numbers,
129 * %-EOVERFLOW if the size of the property is not as expected.
130 * %-ENXIO if no suitable firmware interface is present.
140 * device_property_read_u16_array - return a u16 array property of a device
142 * @propname: Name of the property
147 * firmware description and stores them to @val if found.
154 * %-EINVAL if given arguments are not valid,
155 * %-ENODATA if the property does not have a value,
156 * %-EPROTO if the property is not an array of numbers,
157 * %-EOVERFLOW if the size of the property is not as expected.
158 * %-ENXIO if no suitable firmware interface is present.
168 * device_property_read_u32_array - return a u32 array property of a device
170 * @propname: Name of the property
175 * firmware description and stores them to @val if found.
182 * %-EINVAL if given arguments are not valid,
183 * %-ENODATA if the property does not have a value,
184 * %-EPROTO if the property is not an array of numbers,
185 * %-EOVERFLOW if the size of the property is not as expected.
186 * %-ENXIO if no suitable firmware interface is present.
196 * device_property_read_u64_array - return a u64 array property of a device
198 * @propname: Name of the property
203 * firmware description and stores them to @val if found.
210 * %-EINVAL if given arguments are not valid,
211 * %-ENODATA if the property does not have a value,
212 * %-EPROTO if the property is not an array of numbers,
213 * %-EOVERFLOW if the size of the property is not as expected.
214 * %-ENXIO if no suitable firmware interface is present.
224 * device_property_read_string_array - return a string array property of device
226 * @propname: Name of the property
231 * firmware description and stores them to @val if found.
236 * Return: number of values read on success if @val is non-NULL,
238 * %-EINVAL if given arguments are not valid,
239 * %-ENODATA if the property does not have a value,
240 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
241 * %-EOVERFLOW if the size of the property is not as expected.
242 * %-ENXIO if no suitable firmware interface is present.
252 * device_property_read_string - return a string property of a device
254 * @propname: Name of the property
257 * Function reads property @propname from the device firmware description and
261 * %-EINVAL if given arguments are not valid,
262 * %-ENODATA if the property does not have a value,
263 * %-EPROTO or %-EILSEQ if the property type is not a string.
264 * %-ENXIO if no suitable firmware interface is present.
274 * device_property_match_string - find a string in an array and return index
276 * @propname: Name of the property holding the array
283 * %-EINVAL if given arguments are not valid,
284 * %-ENODATA if the property does not have a value,
285 * %-EPROTO if the property is not an array of strings,
286 * %-ENXIO if no suitable firmware interface is present.
303 return -EINVAL; in fwnode_property_read_int_array()
307 if (ret != -EINVAL) in fwnode_property_read_int_array()
310 return fwnode_call_int_op(fwnode->secondary, property_read_int_array, propname, in fwnode_property_read_int_array()
315 * fwnode_property_read_u8_array - return a u8 array property of firmware node
316 * @fwnode: Firmware node to get the property of
317 * @propname: Name of the property
329 * %-EINVAL if given arguments are not valid,
330 * %-ENODATA if the property does not have a value,
331 * %-EPROTO if the property is not an array of numbers,
332 * %-EOVERFLOW if the size of the property is not as expected,
333 * %-ENXIO if no suitable firmware interface is present.
344 * fwnode_property_read_u16_array - return a u16 array property of firmware node
345 * @fwnode: Firmware node to get the property of
346 * @propname: Name of the property
358 * %-EINVAL if given arguments are not valid,
359 * %-ENODATA if the property does not have a value,
360 * %-EPROTO if the property is not an array of numbers,
361 * %-EOVERFLOW if the size of the property is not as expected,
362 * %-ENXIO if no suitable firmware interface is present.
373 * fwnode_property_read_u32_array - return a u32 array property of firmware node
374 * @fwnode: Firmware node to get the property of
375 * @propname: Name of the property
387 * %-EINVAL if given arguments are not valid,
388 * %-ENODATA if the property does not have a value,
389 * %-EPROTO if the property is not an array of numbers,
390 * %-EOVERFLOW if the size of the property is not as expected,
391 * %-ENXIO if no suitable firmware interface is present.
402 * fwnode_property_read_u64_array - return a u64 array property firmware node
403 * @fwnode: Firmware node to get the property of
404 * @propname: Name of the property
416 * %-EINVAL if given arguments are not valid,
417 * %-ENODATA if the property does not have a value,
418 * %-EPROTO if the property is not an array of numbers,
419 * %-EOVERFLOW if the size of the property is not as expected,
420 * %-ENXIO if no suitable firmware interface is present.
431 * fwnode_property_read_string_array - return string array property of a node
432 * @fwnode: Firmware node to get the property of
433 * @propname: Name of the property
437 * Read an string list property @propname from the given firmware node and store
443 * Return: number of values read on success if @val is non-NULL,
445 * %-EINVAL if given arguments are not valid,
446 * %-ENODATA if the property does not have a value,
447 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
448 * %-EOVERFLOW if the size of the property is not as expected,
449 * %-ENXIO if no suitable firmware interface is present.
458 return -EINVAL; in fwnode_property_read_string_array()
462 if (ret != -EINVAL) in fwnode_property_read_string_array()
465 return fwnode_call_int_op(fwnode->secondary, property_read_string_array, propname, in fwnode_property_read_string_array()
471 * fwnode_property_read_string - return a string property of a firmware node
472 * @fwnode: Firmware node to get the property of
473 * @propname: Name of the property
476 * Read property @propname from the given firmware node and store the value into
480 * %-EINVAL if given arguments are not valid,
481 * %-ENODATA if the property does not have a value,
482 * %-EPROTO or %-EILSEQ if the property is not a string,
483 * %-ENXIO if no suitable firmware interface is present.
495 * fwnode_property_match_string - find a string in an array and return index
496 * @fwnode: Firmware node to get the property of
497 * @propname: Name of the property holding the array
504 * %-EINVAL if given arguments are not valid,
505 * %-ENODATA if the property does not have a value,
506 * %-EPROTO if the property is not an array of strings,
507 * %-ENXIO if no suitable firmware interface is present.
520 return -ENODATA; in fwnode_property_match_string()
524 return -ENOMEM; in fwnode_property_match_string()
532 ret = -ENODATA; in fwnode_property_match_string()
541 * fwnode_property_match_property_string - find a property string value in an array and return index
542 * @fwnode: Firmware node to get the property of
543 * @propname: Name of the property holding the string value
551 * %-ENOENT when the string value was not found in the @array,
552 * %-EINVAL if given arguments are not valid,
553 * %-ENODATA if the property does not have a value,
554 * %-EPROTO or %-EILSEQ if the property is not a string,
555 * %-ENXIO if no suitable firmware interface is present.
569 ret = -ENOENT; in fwnode_property_match_property_string()
576 * fwnode_property_get_reference_args() - Find a reference with arguments
577 * @fwnode: Firmware node where to look for the reference
578 * @prop: The name of the property
579 * @nargs_prop: The name of the property telling the number of
582 * @nargs: Number of arguments. Ignored if @nargs_prop is non-NULL.
591 * @args->fwnode pointer.
594 * %-ENOENT when the index is out of bounds, the index has an empty
596 * %-EINVAL on parse error
606 return -ENOENT; in fwnode_property_get_reference_args()
613 if (IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_get_reference_args()
616 return fwnode_call_int_op(fwnode->secondary, get_reference_args, prop, nargs_prop, in fwnode_property_get_reference_args()
622 * fwnode_find_reference - Find named reference to a fwnode_handle
623 * @fwnode: Firmware node where to look for the reference
624 * @name: The name of the reference
636 const char *name, in fwnode_find_reference() argument
642 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index, in fwnode_find_reference()
649 * fwnode_get_name - Return the name of a node
650 * @fwnode: The firmware node
652 * Return: a pointer to the node name, or %NULL.
661 * fwnode_get_name_prefix - Return the prefix of node for printing purposes
662 * @fwnode: The firmware node
673 * fwnode_name_eq - Return true if node name is equal
674 * @fwnode: The firmware node
675 * @name: The name to which to compare the node name
677 * Compare the name provided as an argument to the name of the node, stopping
682 * Return: true if the node name matches with the name provided in the @name
685 bool fwnode_name_eq(const struct fwnode_handle *fwnode, const char *name) in fwnode_name_eq() argument
694 len = strchrnul(node_name, '@') - node_name; in fwnode_name_eq()
696 return str_has_prefix(node_name, name) == len; in fwnode_name_eq()
701 * fwnode_get_parent - Return parent firwmare node
702 * @fwnode: Firmware whose parent is retrieved
707 * Return: parent firmware node of the given node if possible or %NULL if no
717 * fwnode_get_next_parent - Iterate to the node's parent
718 * @fwnode: Firmware whose parent is retrieved
728 * Return: parent firmware node of the given node if possible or %NULL if no
742 * fwnode_count_parents - Return the number of parents a node has
760 * fwnode_get_nth_parent - Return an nth parent of a node
780 if (--depth == 0) in fwnode_get_nth_parent()
788 * fwnode_get_next_child_node - Return the next child node handle for a node
789 * @fwnode: Firmware node to find the next child node for.
805 * fwnode_get_next_available_child_node - Return the next available child node handle for a node
806 * @fwnode: Firmware node to find the next child node for.
833 * device_get_next_child_node - Return the next child node handle for a device
856 return fwnode_get_next_child_node(fwnode->secondary, child); in device_get_next_child_node()
861 * fwnode_get_named_child_node - Return first matching named child node handle
862 * @fwnode: Firmware node to find the named child node for.
863 * @childname: String to match child node name against.
877 * device_get_named_child_node - Return first matching named child node handle
879 * @childname: String to match child node name against.
892 * fwnode_handle_get - Obtain a reference to a device node
910 * fwnode_device_is_available - check if a device is available for use
931 * device_get_child_node_count - return the number of child nodes for device
964 * fwnode_get_phy_mode - Get phy mode for given firmware node
967 * The function gets phy interface string from property 'phy-mode' or
968 * 'phy-connection-type', and return its index in phy_modes table, or errno in
976 err = fwnode_property_read_string(fwnode, "phy-mode", &pm); in fwnode_get_phy_mode()
979 "phy-connection-type", &pm); in fwnode_get_phy_mode()
987 return -ENODEV; in fwnode_get_phy_mode()
992 * device_get_phy_mode - Get phy mode for given device
995 * The function gets phy interface string from property 'phy-mode' or
996 * 'phy-connection-type', and return its index in phy_modes table, or errno in
1006 * fwnode_iomap - Maps the memory mapped IO for a given fwnode
1007 * @fwnode: Pointer to the firmware node
1019 * fwnode_irq_get - Get IRQ directly from a fwnode
1020 * @fwnode: Pointer to the firmware node
1021 * @index: Zero-based index of the IRQ
1032 return -EINVAL; in fwnode_irq_get()
1039 * fwnode_irq_get_byname - Get IRQ from a fwnode using its name
1040 * @fwnode: Pointer to the firmware node
1041 * @name: IRQ name
1044 * Find a match to the string @name in the 'interrupt-names' string array
1051 int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name) in fwnode_irq_get_byname() argument
1055 if (!name) in fwnode_irq_get_byname()
1056 return -EINVAL; in fwnode_irq_get_byname()
1058 index = fwnode_property_match_string(fwnode, "interrupt-names", name); in fwnode_irq_get_byname()
1067 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node
1068 * @fwnode: Pointer to the parent firmware node
1075 * Return: an endpoint firmware node pointer or %NULL if no more endpoints
1087 * an endpoint from fwnode->secondary, then we need to use the secondary in fwnode_graph_get_next_endpoint()
1103 ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); in fwnode_graph_get_next_endpoint()
1112 * fwnode_graph_get_port_parent - Return the device fwnode of a port endpoint
1113 * @endpoint: Endpoint firmware node of the port
1118 * Return: the firmware node of the device the @endpoint belongs to.
1135 * fwnode_graph_get_remote_port_parent - Return fwnode of a remote device
1136 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1138 * Extracts firmware node of a remote device the @fwnode points to.
1158 * fwnode_graph_get_remote_port - Return fwnode of a remote port
1159 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1161 * Extracts firmware node of a remote port the @fwnode points to.
1174 * fwnode_graph_get_remote_endpoint - Return fwnode of a remote endpoint
1175 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1177 * Extracts firmware node of a remote endpoint the @fwnode points to.
1202 * fwnode_graph_get_endpoint_by_id - get endpoint by port and endpoint numbers
1269 * fwnode_graph_get_endpoint_count - Count endpoints on a device node
1294 * fwnode_graph_parse_endpoint - parse common endpoint node properties
1383 * fwnode_connection_find_match - Find connection from a device node
1413 * fwnode_connection_find_matches - Find connections from a device node
1440 return -EINVAL; in fwnode_connection_find_matches()
1447 matches_len -= count_graph; in fwnode_connection_find_matches()