Lines Matching refs:fwnode

24 		&dev->of_node->fwnode : dev->fwnode;  in dev_fwnode()
46 bool fwnode_property_present(const struct fwnode_handle *fwnode, in fwnode_property_present() argument
51 ret = fwnode_call_bool_op(fwnode, property_present, propname); in fwnode_property_present()
52 if (ret == false && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_present()
53 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_present()
54 ret = fwnode_call_bool_op(fwnode->secondary, property_present, in fwnode_property_present()
229 static int fwnode_property_read_int_array(const struct fwnode_handle *fwnode, in fwnode_property_read_int_array() argument
236 ret = fwnode_call_int_op(fwnode, property_read_int_array, propname, in fwnode_property_read_int_array()
238 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_read_int_array()
239 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_read_int_array()
241 fwnode->secondary, property_read_int_array, propname, in fwnode_property_read_int_array()
265 int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u8_array() argument
268 return fwnode_property_read_int_array(fwnode, propname, sizeof(u8), in fwnode_property_read_u8_array()
291 int fwnode_property_read_u16_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u16_array() argument
294 return fwnode_property_read_int_array(fwnode, propname, sizeof(u16), in fwnode_property_read_u16_array()
317 int fwnode_property_read_u32_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u32_array() argument
320 return fwnode_property_read_int_array(fwnode, propname, sizeof(u32), in fwnode_property_read_u32_array()
343 int fwnode_property_read_u64_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u64_array() argument
346 return fwnode_property_read_int_array(fwnode, propname, sizeof(u64), in fwnode_property_read_u64_array()
369 int fwnode_property_read_string_array(const struct fwnode_handle *fwnode, in fwnode_property_read_string_array() argument
375 ret = fwnode_call_int_op(fwnode, property_read_string_array, propname, in fwnode_property_read_string_array()
377 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_read_string_array()
378 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_read_string_array()
379 ret = fwnode_call_int_op(fwnode->secondary, in fwnode_property_read_string_array()
401 int fwnode_property_read_string(const struct fwnode_handle *fwnode, in fwnode_property_read_string() argument
404 int ret = fwnode_property_read_string_array(fwnode, propname, val, 1); in fwnode_property_read_string()
425 int fwnode_property_match_string(const struct fwnode_handle *fwnode, in fwnode_property_match_string() argument
431 nval = fwnode_property_read_string_array(fwnode, propname, NULL, 0); in fwnode_property_match_string()
442 ret = fwnode_property_read_string_array(fwnode, propname, values, nval); in fwnode_property_match_string()
477 int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, in fwnode_property_get_reference_args() argument
482 return fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop, in fwnode_property_get_reference_args()
498 struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode, in fwnode_find_reference() argument
505 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index, in fwnode_find_reference()
507 return ret ? ERR_PTR(ret) : args.fwnode; in fwnode_find_reference()
521 struct fwnode_handle *fwnode = dev_fwnode(dev); in device_remove_properties() local
523 if (!fwnode) in device_remove_properties()
526 if (is_software_node(fwnode->secondary)) { in device_remove_properties()
527 fwnode_remove_software_node(fwnode->secondary); in device_remove_properties()
548 struct fwnode_handle *fwnode; in device_add_properties() local
550 fwnode = fwnode_create_software_node(properties, NULL); in device_add_properties()
551 if (IS_ERR(fwnode)) in device_add_properties()
552 return PTR_ERR(fwnode); in device_add_properties()
554 set_secondary_fwnode(dev, fwnode); in device_add_properties()
565 const char *fwnode_get_name(const struct fwnode_handle *fwnode) in fwnode_get_name() argument
567 return fwnode_call_ptr_op(fwnode, get_name); in fwnode_get_name()
578 const char *fwnode_get_name_prefix(const struct fwnode_handle *fwnode) in fwnode_get_name_prefix() argument
580 return fwnode_call_ptr_op(fwnode, get_name_prefix); in fwnode_get_name_prefix()
590 struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode) in fwnode_get_parent() argument
592 return fwnode_call_ptr_op(fwnode, get_parent); in fwnode_get_parent()
607 struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode) in fwnode_get_next_parent() argument
609 struct fwnode_handle *parent = fwnode_get_parent(fwnode); in fwnode_get_next_parent()
611 fwnode_handle_put(fwnode); in fwnode_get_next_parent()
623 unsigned int fwnode_count_parents(const struct fwnode_handle *fwnode) in fwnode_count_parents() argument
628 __fwnode = fwnode_get_parent(fwnode); in fwnode_count_parents()
649 struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode, in fwnode_get_nth_parent() argument
654 fwnode_handle_get(fwnode); in fwnode_get_nth_parent()
656 for (i = 0; i < depth && fwnode; i++) in fwnode_get_nth_parent()
657 fwnode = fwnode_get_next_parent(fwnode); in fwnode_get_nth_parent()
659 return fwnode; in fwnode_get_nth_parent()
669 fwnode_get_next_child_node(const struct fwnode_handle *fwnode, in fwnode_get_next_child_node() argument
672 return fwnode_call_ptr_op(fwnode, get_next_child_node, child); in fwnode_get_next_child_node()
683 fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode, in fwnode_get_next_available_child_node() argument
688 if (!fwnode) in fwnode_get_next_available_child_node()
692 next_child = fwnode_get_next_child_node(fwnode, next_child); in fwnode_get_next_available_child_node()
711 struct fwnode_handle *fwnode = NULL, *next; in device_get_next_child_node() local
714 fwnode = &dev->of_node->fwnode; in device_get_next_child_node()
716 fwnode = acpi_fwnode_handle(adev); in device_get_next_child_node()
719 next = fwnode_get_next_child_node(fwnode, child); in device_get_next_child_node()
724 if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) in device_get_next_child_node()
725 next = fwnode_get_next_child_node(fwnode->secondary, child); in device_get_next_child_node()
737 fwnode_get_named_child_node(const struct fwnode_handle *fwnode, in fwnode_get_named_child_node() argument
740 return fwnode_call_ptr_op(fwnode, get_named_child_node, childname); in fwnode_get_named_child_node()
762 struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode) in fwnode_handle_get() argument
764 if (!fwnode_has_op(fwnode, get)) in fwnode_handle_get()
765 return fwnode; in fwnode_handle_get()
767 return fwnode_call_ptr_op(fwnode, get); in fwnode_handle_get()
779 void fwnode_handle_put(struct fwnode_handle *fwnode) in fwnode_handle_put() argument
781 fwnode_call_void_op(fwnode, put); in fwnode_handle_put()
789 bool fwnode_device_is_available(const struct fwnode_handle *fwnode) in fwnode_device_is_available() argument
791 return fwnode_call_bool_op(fwnode, device_is_available); in fwnode_device_is_available()
848 int fwnode_get_phy_mode(struct fwnode_handle *fwnode) in fwnode_get_phy_mode() argument
853 err = fwnode_property_read_string(fwnode, "phy-mode", &pm); in fwnode_get_phy_mode()
855 err = fwnode_property_read_string(fwnode, in fwnode_get_phy_mode()
882 static void *fwnode_get_mac_addr(struct fwnode_handle *fwnode, in fwnode_get_mac_addr() argument
886 int ret = fwnode_property_read_u8_array(fwnode, name, addr, alen); in fwnode_get_mac_addr()
916 void *fwnode_get_mac_address(struct fwnode_handle *fwnode, char *addr, int alen) in fwnode_get_mac_address() argument
920 res = fwnode_get_mac_addr(fwnode, "mac-address", addr, alen); in fwnode_get_mac_address()
924 res = fwnode_get_mac_addr(fwnode, "local-mac-address", addr, alen); in fwnode_get_mac_address()
928 return fwnode_get_mac_addr(fwnode, "address", addr, alen); in fwnode_get_mac_address()
952 int fwnode_irq_get(struct fwnode_handle *fwnode, unsigned int index) in fwnode_irq_get() argument
954 struct device_node *of_node = to_of_node(fwnode); in fwnode_irq_get()
961 ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res); in fwnode_irq_get()
978 fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode, in fwnode_graph_get_next_endpoint() argument
981 return fwnode_call_ptr_op(fwnode, graph_get_next_endpoint, prev); in fwnode_graph_get_next_endpoint()
1012 fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_port_parent() argument
1016 endpoint = fwnode_graph_get_remote_endpoint(fwnode); in fwnode_graph_get_remote_port_parent()
1032 fwnode_graph_get_remote_port(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_port() argument
1034 return fwnode_get_next_parent(fwnode_graph_get_remote_endpoint(fwnode)); in fwnode_graph_get_remote_port()
1045 fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_endpoint() argument
1047 return fwnode_call_ptr_op(fwnode, graph_get_remote_endpoint); in fwnode_graph_get_remote_endpoint()
1061 fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id, in fwnode_graph_get_remote_node() argument
1066 while ((endpoint = fwnode_graph_get_next_endpoint(fwnode, endpoint))) { in fwnode_graph_get_remote_node()
1110 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, in fwnode_graph_get_endpoint_by_id() argument
1118 while ((ep = fwnode_graph_get_next_endpoint(fwnode, ep))) { in fwnode_graph_get_endpoint_by_id()
1173 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, in fwnode_graph_parse_endpoint() argument
1178 return fwnode_call_int_op(fwnode, graph_parse_endpoint, endpoint); in fwnode_graph_parse_endpoint()
1189 fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const char *con_id, in fwnode_graph_devcon_match() argument
1196 fwnode_graph_for_each_endpoint(fwnode, ep) { in fwnode_graph_devcon_match()
1212 fwnode_devcon_match(struct fwnode_handle *fwnode, const char *con_id, in fwnode_devcon_match() argument
1220 node = fwnode_find_reference(fwnode, con_id, i); in fwnode_devcon_match()
1244 void *fwnode_connection_find_match(struct fwnode_handle *fwnode, in fwnode_connection_find_match() argument
1250 if (!fwnode || !match) in fwnode_connection_find_match()
1253 ret = fwnode_graph_devcon_match(fwnode, con_id, data, match); in fwnode_connection_find_match()
1257 return fwnode_devcon_match(fwnode, con_id, data, match); in fwnode_connection_find_match()