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

1 // SPDX-License-Identifier: GPL-2.0
3 * property.c - Unified device property interface.
22 return IS_ENABLED(CONFIG_OF) && dev->of_node ? in __dev_fwnode()
23 of_fwnode_handle(dev->of_node) : dev->fwnode; in __dev_fwnode()
29 return IS_ENABLED(CONFIG_OF) && dev->of_node ? in __dev_fwnode_const()
30 of_fwnode_handle(dev->of_node) : dev->fwnode; in __dev_fwnode_const()
35 * device_property_present - check if a property of a device is present
37 * @propname: Name of the property
39 * Check if property @propname is present in the device firmware description.
50 * fwnode_property_present - check if a property of a firmware node is present
51 * @fwnode: Firmware node whose property to check
52 * @propname: Name of the property
68 return fwnode_call_bool_op(fwnode->secondary, property_present, propname); in fwnode_property_present()
73 * device_property_read_u8_array - return a u8 array property of a device
75 * @propname: Name of the property
80 * firmware description and stores them to @val if found.
87 * %-EINVAL if given arguments are not valid,
88 * %-ENODATA if the property does not have a value,
89 * %-EPROTO if the property is not an array of numbers,
90 * %-EOVERFLOW if the size of the property is not as expected.
91 * %-ENXIO if no suitable firmware interface is present.
101 * device_property_read_u16_array - return a u16 array property of a device
103 * @propname: Name of the property
108 * firmware description and stores them to @val if found.
115 * %-EINVAL if given arguments are not valid,
116 * %-ENODATA if the property does not have a value,
117 * %-EPROTO if the property is not an array of numbers,
118 * %-EOVERFLOW if the size of the property is not as expected.
119 * %-ENXIO if no suitable firmware interface is present.
129 * device_property_read_u32_array - return a u32 array property of a device
131 * @propname: Name of the property
136 * firmware description and stores them to @val if found.
143 * %-EINVAL if given arguments are not valid,
144 * %-ENODATA if the property does not have a value,
145 * %-EPROTO if the property is not an array of numbers,
146 * %-EOVERFLOW if the size of the property is not as expected.
147 * %-ENXIO if no suitable firmware interface is present.
157 * device_property_read_u64_array - return a u64 array property of a device
159 * @propname: Name of the property
164 * firmware description and stores them to @val if found.
171 * %-EINVAL if given arguments are not valid,
172 * %-ENODATA if the property does not have a value,
173 * %-EPROTO if the property is not an array of numbers,
174 * %-EOVERFLOW if the size of the property is not as expected.
175 * %-ENXIO if no suitable firmware interface is present.
185 * device_property_read_string_array - return a string array property of device
187 * @propname: Name of the property
192 * firmware description and stores them to @val if found.
197 * Return: number of values read on success if @val is non-NULL,
199 * %-EINVAL if given arguments are not valid,
200 * %-ENODATA if the property does not have a value,
201 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
202 * %-EOVERFLOW if the size of the property is not as expected.
203 * %-ENXIO if no suitable firmware interface is present.
213 * device_property_read_string - return a string property of a device
215 * @propname: Name of the property
218 * Function reads property @propname from the device firmware description and
222 * %-EINVAL if given arguments are not valid,
223 * %-ENODATA if the property does not have a value,
224 * %-EPROTO or %-EILSEQ if the property type is not a string.
225 * %-ENXIO if no suitable firmware interface is present.
235 * device_property_match_string - find a string in an array and return index
237 * @propname: Name of the property holding the array
244 * %-EINVAL if given arguments are not valid,
245 * %-ENODATA if the property does not have a value,
246 * %-EPROTO if the property is not an array of strings,
247 * %-ENXIO if no suitable firmware interface is present.
264 return -EINVAL; in fwnode_property_read_int_array()
268 if (ret != -EINVAL) in fwnode_property_read_int_array()
271 return fwnode_call_int_op(fwnode->secondary, property_read_int_array, propname, in fwnode_property_read_int_array()
276 * fwnode_property_read_u8_array - return a u8 array property of firmware node
277 * @fwnode: Firmware node to get the property of
278 * @propname: Name of the property
290 * %-EINVAL if given arguments are not valid,
291 * %-ENODATA if the property does not have a value,
292 * %-EPROTO if the property is not an array of numbers,
293 * %-EOVERFLOW if the size of the property is not as expected,
294 * %-ENXIO if no suitable firmware interface is present.
305 * fwnode_property_read_u16_array - return a u16 array property of firmware node
306 * @fwnode: Firmware node to get the property of
307 * @propname: Name of the property
319 * %-EINVAL if given arguments are not valid,
320 * %-ENODATA if the property does not have a value,
321 * %-EPROTO if the property is not an array of numbers,
322 * %-EOVERFLOW if the size of the property is not as expected,
323 * %-ENXIO if no suitable firmware interface is present.
334 * fwnode_property_read_u32_array - return a u32 array property of firmware node
335 * @fwnode: Firmware node to get the property of
336 * @propname: Name of the property
348 * %-EINVAL if given arguments are not valid,
349 * %-ENODATA if the property does not have a value,
350 * %-EPROTO if the property is not an array of numbers,
351 * %-EOVERFLOW if the size of the property is not as expected,
352 * %-ENXIO if no suitable firmware interface is present.
363 * fwnode_property_read_u64_array - return a u64 array property firmware node
364 * @fwnode: Firmware node to get the property of
365 * @propname: Name of the property
377 * %-EINVAL if given arguments are not valid,
378 * %-ENODATA if the property does not have a value,
379 * %-EPROTO if the property is not an array of numbers,
380 * %-EOVERFLOW if the size of the property is not as expected,
381 * %-ENXIO if no suitable firmware interface is present.
392 * fwnode_property_read_string_array - return string array property of a node
393 * @fwnode: Firmware node to get the property of
394 * @propname: Name of the property
398 * Read an string list property @propname from the given firmware node and store
404 * Return: number of values read on success if @val is non-NULL,
406 * %-EINVAL if given arguments are not valid,
407 * %-ENODATA if the property does not have a value,
408 * %-EPROTO or %-EILSEQ if the property is not an array of strings,
409 * %-EOVERFLOW if the size of the property is not as expected,
410 * %-ENXIO if no suitable firmware interface is present.
419 return -EINVAL; in fwnode_property_read_string_array()
423 if (ret != -EINVAL) in fwnode_property_read_string_array()
426 return fwnode_call_int_op(fwnode->secondary, property_read_string_array, propname, in fwnode_property_read_string_array()
432 * fwnode_property_read_string - return a string property of a firmware node
433 * @fwnode: Firmware node to get the property of
434 * @propname: Name of the property
437 * Read property @propname from the given firmware node and store the value into
441 * %-EINVAL if given arguments are not valid,
442 * %-ENODATA if the property does not have a value,
443 * %-EPROTO or %-EILSEQ if the property is not a string,
444 * %-ENXIO if no suitable firmware interface is present.
456 * fwnode_property_match_string - find a string in an array and return index
457 * @fwnode: Firmware node to get the property of
458 * @propname: Name of the property holding the array
465 * %-EINVAL if given arguments are not valid,
466 * %-ENODATA if the property does not have a value,
467 * %-EPROTO if the property is not an array of strings,
468 * %-ENXIO if no suitable firmware interface is present.
481 return -ENODATA; in fwnode_property_match_string()
485 return -ENOMEM; in fwnode_property_match_string()
493 ret = -ENODATA; in fwnode_property_match_string()
502 * fwnode_property_get_reference_args() - Find a reference with arguments
503 * @fwnode: Firmware node where to look for the reference
504 * @prop: The name of the property
505 * @nargs_prop: The name of the property telling the number of
508 * @nargs: Number of arguments. Ignored if @nargs_prop is non-NULL.
516 * @args->fwnode pointer.
519 * %-ENOENT when the index is out of bounds, the index has an empty
521 * %-EINVAL on parse error
531 return -ENOENT; in fwnode_property_get_reference_args()
538 if (IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_get_reference_args()
541 return fwnode_call_int_op(fwnode->secondary, get_reference_args, prop, nargs_prop, in fwnode_property_get_reference_args()
547 * fwnode_find_reference - Find named reference to a fwnode_handle
548 * @fwnode: Firmware node where to look for the reference
549 * @name: The name of the reference
561 const char *name, in fwnode_find_reference() argument
567 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index, in fwnode_find_reference()
574 * fwnode_get_name - Return the name of a node
575 * @fwnode: The firmware node
577 * Return: a pointer to the node name, or %NULL.
586 * fwnode_get_name_prefix - Return the prefix of node for printing purposes
587 * @fwnode: The firmware node
598 * fwnode_get_parent - Return parent firwmare node
599 * @fwnode: Firmware whose parent is retrieved
604 * Return: parent firmware node of the given node if possible or %NULL if no
614 * fwnode_get_next_parent - Iterate to the node's parent
615 * @fwnode: Firmware whose parent is retrieved
625 * Return: parent firmware node of the given node if possible or %NULL if no
639 * fwnode_get_next_parent_dev - Find device of closest ancestor fwnode
640 * @fwnode: firmware node
642 * Given a firmware node (@fwnode), this function finds its closest ancestor
643 * firmware node that has a corresponding struct device and returns that struct
667 * fwnode_count_parents - Return the number of parents a node has
685 * fwnode_get_nth_parent - Return an nth parent of a node
705 if (--depth == 0) in fwnode_get_nth_parent()
713 * fwnode_is_ancestor_of - Test if @ancestor is ancestor of @child
714 * @ancestor: Firmware which is tested for being an ancestor
715 * @child: Firmware which is tested for being the child
741 * fwnode_get_next_child_node - Return the next child node handle for a node
742 * @fwnode: Firmware node to find the next child node for.
758 * fwnode_get_next_available_child_node - Return the next available child node handle for a node
759 * @fwnode: Firmware node to find the next child node for.
786 * device_get_next_child_node - Return the next child node handle for a device
809 return fwnode_get_next_child_node(fwnode->secondary, child); in device_get_next_child_node()
814 * fwnode_get_named_child_node - Return first matching named child node handle
815 * @fwnode: Firmware node to find the named child node for.
816 * @childname: String to match child node name against.
830 * device_get_named_child_node - Return first matching named child node handle
832 * @childname: String to match child node name against.
845 * fwnode_handle_get - Obtain a reference to a device node
863 * fwnode_handle_put - Drop reference to a device node
877 * fwnode_device_is_available - check if a device is available for use
898 * device_get_child_node_count - return the number of child nodes for device
931 * fwnode_get_phy_mode - Get phy mode for given firmware node
934 * The function gets phy interface string from property 'phy-mode' or
935 * 'phy-connection-type', and return its index in phy_modes table, or errno in
943 err = fwnode_property_read_string(fwnode, "phy-mode", &pm); in fwnode_get_phy_mode()
946 "phy-connection-type", &pm); in fwnode_get_phy_mode()
954 return -ENODEV; in fwnode_get_phy_mode()
959 * device_get_phy_mode - Get phy mode for given device
962 * The function gets phy interface string from property 'phy-mode' or
963 * 'phy-connection-type', and return its index in phy_modes table, or errno in
973 * fwnode_iomap - Maps the memory mapped IO for a given fwnode
974 * @fwnode: Pointer to the firmware node
986 * fwnode_irq_get - Get IRQ directly from a fwnode
987 * @fwnode: Pointer to the firmware node
988 * @index: Zero-based index of the IRQ
999 return -EINVAL; in fwnode_irq_get()
1006 * fwnode_irq_get_byname - Get IRQ from a fwnode using its name
1007 * @fwnode: Pointer to the firmware node
1008 * @name: IRQ name
1011 * Find a match to the string @name in the 'interrupt-names' string array
1018 int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name) in fwnode_irq_get_byname() argument
1022 if (!name) in fwnode_irq_get_byname()
1023 return -EINVAL; in fwnode_irq_get_byname()
1025 index = fwnode_property_match_string(fwnode, "interrupt-names", name); in fwnode_irq_get_byname()
1034 * fwnode_graph_get_next_endpoint - Get next endpoint firmware node
1035 * @fwnode: Pointer to the parent firmware node
1042 * Return: an endpoint firmware node pointer or %NULL if no more endpoints
1054 * an endpoint from fwnode->secondary, then we need to use the secondary in fwnode_graph_get_next_endpoint()
1070 ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); in fwnode_graph_get_next_endpoint()
1079 * fwnode_graph_get_port_parent - Return the device fwnode of a port endpoint
1080 * @endpoint: Endpoint firmware node of the port
1085 * Return: the firmware node of the device the @endpoint belongs to.
1102 * fwnode_graph_get_remote_port_parent - Return fwnode of a remote device
1103 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1105 * Extracts firmware node of a remote device the @fwnode points to.
1125 * fwnode_graph_get_remote_port - Return fwnode of a remote port
1126 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1128 * Extracts firmware node of a remote port the @fwnode points to.
1141 * fwnode_graph_get_remote_endpoint - Return fwnode of a remote endpoint
1142 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1144 * Extracts firmware node of a remote endpoint the @fwnode points to.
1169 * fwnode_graph_get_endpoint_by_id - get endpoint by port and endpoint numbers
1236 * fwnode_graph_get_endpoint_count - Count endpoints on a device node
1261 * fwnode_graph_parse_endpoint - parse common endpoint node properties
1350 * fwnode_connection_find_match - Find connection from a device node
1380 * fwnode_connection_find_matches - Find connections from a device node
1407 return -EINVAL; in fwnode_connection_find_matches()
1414 matches_len -= count_graph; in fwnode_connection_find_matches()