Lines Matching refs:fwnode

24 		of_fwnode_handle(dev->of_node) : dev->fwnode;
31 of_fwnode_handle(dev->of_node) : dev->fwnode;
52 * @fwnode: Firmware node whose property to check
57 bool fwnode_property_present(const struct fwnode_handle *fwnode,
62 if (IS_ERR_OR_NULL(fwnode))
65 ret = fwnode_call_bool_op(fwnode, property_present, propname);
69 return fwnode_call_bool_op(fwnode->secondary, property_present, propname);
257 static int fwnode_property_read_int_array(const struct fwnode_handle *fwnode,
264 if (IS_ERR_OR_NULL(fwnode))
267 ret = fwnode_call_int_op(fwnode, property_read_int_array, propname,
272 return fwnode_call_int_op(fwnode->secondary, property_read_int_array, propname,
278 * @fwnode: Firmware node to get the property of
283 * Read an array of u8 properties with @propname from @fwnode and stores them to
297 int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode,
300 return fwnode_property_read_int_array(fwnode, propname, sizeof(u8),
307 * @fwnode: Firmware node to get the property of
312 * Read an array of u16 properties with @propname from @fwnode and store them to
326 int fwnode_property_read_u16_array(const struct fwnode_handle *fwnode,
329 return fwnode_property_read_int_array(fwnode, propname, sizeof(u16),
336 * @fwnode: Firmware node to get the property of
341 * Read an array of u32 properties with @propname from @fwnode store them to
355 int fwnode_property_read_u32_array(const struct fwnode_handle *fwnode,
358 return fwnode_property_read_int_array(fwnode, propname, sizeof(u32),
365 * @fwnode: Firmware node to get the property of
370 * Read an array of u64 properties with @propname from @fwnode and store them to
384 int fwnode_property_read_u64_array(const struct fwnode_handle *fwnode,
387 return fwnode_property_read_int_array(fwnode, propname, sizeof(u64),
394 * @fwnode: Firmware node to get the property of
413 int fwnode_property_read_string_array(const struct fwnode_handle *fwnode,
419 if (IS_ERR_OR_NULL(fwnode))
422 ret = fwnode_call_int_op(fwnode, property_read_string_array, propname,
427 return fwnode_call_int_op(fwnode->secondary, property_read_string_array, propname,
434 * @fwnode: Firmware node to get the property of
447 int fwnode_property_read_string(const struct fwnode_handle *fwnode,
450 int ret = fwnode_property_read_string_array(fwnode, propname, val, 1);
458 * @fwnode: Firmware node to get the property of
471 int fwnode_property_match_string(const struct fwnode_handle *fwnode,
477 nval = fwnode_property_string_array_count(fwnode, propname);
488 ret = fwnode_property_read_string_array(fwnode, propname, values, nval);
504 * @fwnode: Firmware node to get the property of
519 int fwnode_property_match_property_string(const struct fwnode_handle *fwnode,
525 ret = fwnode_property_read_string(fwnode, propname, &string);
539 * @fwnode: Firmware node where to look for the reference
549 * Obtain a reference based on a named property in an fwnode, with
553 * @args->fwnode pointer.
560 int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
567 if (IS_ERR_OR_NULL(fwnode))
570 ret = fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop,
575 if (IS_ERR_OR_NULL(fwnode->secondary))
578 return fwnode_call_int_op(fwnode->secondary, get_reference_args, prop, nargs_prop,
585 * @fwnode: Firmware node where to look for the reference
592 * fwnode pointer.
594 * Return: a pointer to the reference fwnode, when found. Otherwise,
597 struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode,
604 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index,
606 return ret ? ERR_PTR(ret) : args.fwnode;
612 * @fwnode: The firmware node
616 const char *fwnode_get_name(const struct fwnode_handle *fwnode)
618 return fwnode_call_ptr_op(fwnode, get_name);
624 * @fwnode: The firmware node
629 const char *fwnode_get_name_prefix(const struct fwnode_handle *fwnode)
631 return fwnode_call_ptr_op(fwnode, get_name_prefix);
636 * @fwnode: The firmware node
647 bool fwnode_name_eq(const struct fwnode_handle *fwnode, const char *name)
652 node_name = fwnode_get_name(fwnode);
664 * @fwnode: Firmware whose parent is retrieved
667 * fwnode pointer.
672 struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode)
674 return fwnode_call_ptr_op(fwnode, get_parent);
680 * @fwnode: Firmware whose parent is retrieved
687 * fwnode pointer. Note that this function also puts a reference to @fwnode
693 struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode)
695 struct fwnode_handle *parent = fwnode_get_parent(fwnode);
697 fwnode_handle_put(fwnode);
705 * @fwnode: The node the parents of which are to be counted
709 unsigned int fwnode_count_parents(const struct fwnode_handle *fwnode)
714 fwnode_for_each_parent_node(fwnode, parent)
723 * @fwnode: The node the parent of which is requested
727 * fwnode pointer.
733 struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode,
739 return fwnode_handle_get(fwnode);
741 fwnode_for_each_parent_node(fwnode, parent) {
751 * @fwnode: Firmware node to find the next child node for.
755 * fwnode pointer. Note that this function also puts a reference to @child
759 fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
762 return fwnode_call_ptr_op(fwnode, get_next_child_node, child);
768 * @fwnode: Firmware node to find the next child node for.
772 * fwnode pointer. Note that this function also puts a reference to @child
776 fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
781 if (IS_ERR_OR_NULL(fwnode))
785 next_child = fwnode_get_next_child_node(fwnode, next_child);
800 * fwnode pointer. Note that this function also puts a reference to @child
806 const struct fwnode_handle *fwnode = dev_fwnode(dev);
809 if (IS_ERR_OR_NULL(fwnode))
812 /* Try to find a child in primary fwnode */
813 next = fwnode_get_next_child_node(fwnode, child);
818 return fwnode_get_next_child_node(fwnode->secondary, child);
824 * @fwnode: Firmware node to find the named child node for.
828 * fwnode pointer.
831 fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
834 return fwnode_call_ptr_op(fwnode, get_named_child_node, childname);
844 * fwnode pointer.
855 * @fwnode: Pointer to the device node to obtain the reference to.
858 * fwnode pointer.
860 * Return: the fwnode handle.
862 struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode)
864 if (!fwnode_has_op(fwnode, get))
865 return fwnode;
867 return fwnode_call_ptr_op(fwnode, get);
873 * @fwnode: Pointer to the device node to drop the reference to.
879 void fwnode_handle_put(struct fwnode_handle *fwnode)
881 fwnode_call_void_op(fwnode, put);
887 * @fwnode: Pointer to the fwnode of the device.
891 * For fwnode node types that don't implement the .device_is_available()
894 bool fwnode_device_is_available(const struct fwnode_handle *fwnode)
896 if (IS_ERR_OR_NULL(fwnode))
899 if (!fwnode_has_op(fwnode, device_is_available))
902 return fwnode_call_bool_op(fwnode, device_is_available);
941 * @fwnode: Pointer to the given node
947 int fwnode_get_phy_mode(const struct fwnode_handle *fwnode)
952 err = fwnode_property_read_string(fwnode, "phy-mode", &pm);
954 err = fwnode_property_read_string(fwnode,
982 * fwnode_iomap - Maps the memory mapped IO for a given fwnode
983 * @fwnode: Pointer to the firmware node
988 void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index)
990 return fwnode_call_ptr_op(fwnode, iomap, index);
995 * fwnode_irq_get - Get IRQ directly from a fwnode
996 * @fwnode: Pointer to the firmware node
1001 int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
1005 ret = fwnode_call_int_op(fwnode, irq_get, index);
1015 * fwnode_irq_get_byname - Get IRQ from a fwnode using its name
1016 * @fwnode: Pointer to the firmware node
1027 int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name)
1034 index = fwnode_property_match_string(fwnode, "interrupt-names", name);
1038 return fwnode_irq_get(fwnode, index);
1044 * @fwnode: Pointer to the parent firmware node
1048 * fwnode pointer. Note that this function also puts a reference to @prev
1055 fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
1063 * an endpoint from fwnode->secondary, then we need to use the secondary
1064 * as parent rather than @fwnode.
1070 parent = fwnode;
1088 * fwnode_graph_get_port_parent - Return the device fwnode of a port endpoint
1092 * fwnode pointer.
1111 * fwnode_graph_get_remote_port_parent - Return fwnode of a remote device
1112 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1114 * Extracts firmware node of a remote device the @fwnode points to.
1117 * fwnode pointer.
1120 fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode)
1124 endpoint = fwnode_graph_get_remote_endpoint(fwnode);
1134 * fwnode_graph_get_remote_port - Return fwnode of a remote port
1135 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1137 * Extracts firmware node of a remote port the @fwnode points to.
1140 * fwnode pointer.
1143 fwnode_graph_get_remote_port(const struct fwnode_handle *fwnode)
1145 return fwnode_get_next_parent(fwnode_graph_get_remote_endpoint(fwnode));
1150 * fwnode_graph_get_remote_endpoint - Return fwnode of a remote endpoint
1151 * @fwnode: Endpoint firmware node pointing to the remote endpoint
1153 * Extracts firmware node of a remote endpoint the @fwnode points to.
1156 * fwnode pointer.
1159 fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode)
1161 return fwnode_call_ptr_op(fwnode, graph_get_remote_endpoint);
1179 * @fwnode: parent fwnode_handle containing the graph
1182 * @flags: fwnode lookup flags
1185 * fwnode pointer.
1187 * Return: the fwnode handle of the local endpoint corresponding the port and
1198 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
1206 fwnode_graph_for_each_endpoint(fwnode, ep) {
1246 * @fwnode: The node related to a device
1247 * @flags: fwnode lookup flags
1253 unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
1259 fwnode_graph_for_each_endpoint(fwnode, ep) {
1271 * @fwnode: pointer to endpoint fwnode_handle
1272 * @endpoint: pointer to the fwnode endpoint data structure
1274 * Parse @fwnode representing a graph endpoint node and store the
1276 * @fwnode.
1278 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
1283 return fwnode_call_int_op(fwnode, graph_parse_endpoint, endpoint);
1293 static unsigned int fwnode_graph_devcon_matches(const struct fwnode_handle *fwnode,
1304 fwnode_graph_for_each_endpoint(fwnode, ep) {
1327 static unsigned int fwnode_devcon_matches(const struct fwnode_handle *fwnode,
1342 node = fwnode_find_reference(fwnode, con_id, i);
1360 * @fwnode: Device node with the connection
1365 * Find a connection with unique identifier @con_id between @fwnode and another
1369 void *fwnode_connection_find_match(const struct fwnode_handle *fwnode,
1376 if (!fwnode || !match)
1379 count = fwnode_graph_devcon_matches(fwnode, con_id, data, match, &ret, 1);
1383 count = fwnode_devcon_matches(fwnode, con_id, data, match, &ret, 1);
1390 * @fwnode: Device node with the connection
1398 * @fwnode and other device nodes. @match will be used to convert the
1407 int fwnode_connection_find_matches(const struct fwnode_handle *fwnode,
1415 if (!fwnode || !match)
1418 count_graph = fwnode_graph_devcon_matches(fwnode, con_id, data, match,
1426 count_ref = fwnode_devcon_matches(fwnode, con_id, data, match,