Lines Matching refs:fwnode

23 		of_fwnode_handle(dev->of_node) : dev->fwnode;  in dev_fwnode()
45 bool fwnode_property_present(const struct fwnode_handle *fwnode, in fwnode_property_present() argument
50 ret = fwnode_call_bool_op(fwnode, property_present, propname); in fwnode_property_present()
51 if (ret == false && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_present()
52 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_present()
53 ret = fwnode_call_bool_op(fwnode->secondary, property_present, in fwnode_property_present()
228 static int fwnode_property_read_int_array(const struct fwnode_handle *fwnode, in fwnode_property_read_int_array() argument
235 ret = fwnode_call_int_op(fwnode, property_read_int_array, propname, in fwnode_property_read_int_array()
237 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_read_int_array()
238 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_read_int_array()
240 fwnode->secondary, property_read_int_array, propname, in fwnode_property_read_int_array()
264 int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u8_array() argument
267 return fwnode_property_read_int_array(fwnode, propname, sizeof(u8), in fwnode_property_read_u8_array()
290 int fwnode_property_read_u16_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u16_array() argument
293 return fwnode_property_read_int_array(fwnode, propname, sizeof(u16), in fwnode_property_read_u16_array()
316 int fwnode_property_read_u32_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u32_array() argument
319 return fwnode_property_read_int_array(fwnode, propname, sizeof(u32), in fwnode_property_read_u32_array()
342 int fwnode_property_read_u64_array(const struct fwnode_handle *fwnode, in fwnode_property_read_u64_array() argument
345 return fwnode_property_read_int_array(fwnode, propname, sizeof(u64), in fwnode_property_read_u64_array()
368 int fwnode_property_read_string_array(const struct fwnode_handle *fwnode, in fwnode_property_read_string_array() argument
374 ret = fwnode_call_int_op(fwnode, property_read_string_array, propname, in fwnode_property_read_string_array()
376 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) && in fwnode_property_read_string_array()
377 !IS_ERR_OR_NULL(fwnode->secondary)) in fwnode_property_read_string_array()
378 ret = fwnode_call_int_op(fwnode->secondary, in fwnode_property_read_string_array()
400 int fwnode_property_read_string(const struct fwnode_handle *fwnode, in fwnode_property_read_string() argument
403 int ret = fwnode_property_read_string_array(fwnode, propname, val, 1); in fwnode_property_read_string()
424 int fwnode_property_match_string(const struct fwnode_handle *fwnode, in fwnode_property_match_string() argument
430 nval = fwnode_property_read_string_array(fwnode, propname, NULL, 0); in fwnode_property_match_string()
441 ret = fwnode_property_read_string_array(fwnode, propname, values, nval); in fwnode_property_match_string()
476 int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, in fwnode_property_get_reference_args() argument
481 return fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop, in fwnode_property_get_reference_args()
497 struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode, in fwnode_find_reference() argument
504 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index, in fwnode_find_reference()
506 return ret ? ERR_PTR(ret) : args.fwnode; in fwnode_find_reference()
520 struct fwnode_handle *fwnode = dev_fwnode(dev); in device_remove_properties() local
522 if (!fwnode) in device_remove_properties()
525 if (is_software_node(fwnode->secondary)) { in device_remove_properties()
526 fwnode_remove_software_node(fwnode->secondary); in device_remove_properties()
547 struct fwnode_handle *fwnode; in device_add_properties() local
549 fwnode = fwnode_create_software_node(properties, NULL); in device_add_properties()
550 if (IS_ERR(fwnode)) in device_add_properties()
551 return PTR_ERR(fwnode); in device_add_properties()
553 set_secondary_fwnode(dev, fwnode); in device_add_properties()
564 const char *fwnode_get_name(const struct fwnode_handle *fwnode) in fwnode_get_name() argument
566 return fwnode_call_ptr_op(fwnode, get_name); in fwnode_get_name()
577 const char *fwnode_get_name_prefix(const struct fwnode_handle *fwnode) in fwnode_get_name_prefix() argument
579 return fwnode_call_ptr_op(fwnode, get_name_prefix); in fwnode_get_name_prefix()
589 struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode) in fwnode_get_parent() argument
591 return fwnode_call_ptr_op(fwnode, get_parent); in fwnode_get_parent()
606 struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode) in fwnode_get_next_parent() argument
608 struct fwnode_handle *parent = fwnode_get_parent(fwnode); in fwnode_get_next_parent()
610 fwnode_handle_put(fwnode); in fwnode_get_next_parent()
627 struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode) in fwnode_get_next_parent_dev() argument
631 fwnode_handle_get(fwnode); in fwnode_get_next_parent_dev()
633 fwnode = fwnode_get_next_parent(fwnode); in fwnode_get_next_parent_dev()
634 if (!fwnode) in fwnode_get_next_parent_dev()
636 dev = get_dev_from_fwnode(fwnode); in fwnode_get_next_parent_dev()
638 fwnode_handle_put(fwnode); in fwnode_get_next_parent_dev()
648 unsigned int fwnode_count_parents(const struct fwnode_handle *fwnode) in fwnode_count_parents() argument
653 __fwnode = fwnode_get_parent(fwnode); in fwnode_count_parents()
674 struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode, in fwnode_get_nth_parent() argument
679 fwnode_handle_get(fwnode); in fwnode_get_nth_parent()
681 for (i = 0; i < depth && fwnode; i++) in fwnode_get_nth_parent()
682 fwnode = fwnode_get_next_parent(fwnode); in fwnode_get_nth_parent()
684 return fwnode; in fwnode_get_nth_parent()
721 fwnode_get_next_child_node(const struct fwnode_handle *fwnode, in fwnode_get_next_child_node() argument
724 return fwnode_call_ptr_op(fwnode, get_next_child_node, child); in fwnode_get_next_child_node()
735 fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode, in fwnode_get_next_available_child_node() argument
740 if (!fwnode) in fwnode_get_next_available_child_node()
744 next_child = fwnode_get_next_child_node(fwnode, next_child); in fwnode_get_next_available_child_node()
761 const struct fwnode_handle *fwnode = dev_fwnode(dev); in device_get_next_child_node() local
765 next = fwnode_get_next_child_node(fwnode, child); in device_get_next_child_node()
770 if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary)) in device_get_next_child_node()
771 next = fwnode_get_next_child_node(fwnode->secondary, child); in device_get_next_child_node()
783 fwnode_get_named_child_node(const struct fwnode_handle *fwnode, in fwnode_get_named_child_node() argument
786 return fwnode_call_ptr_op(fwnode, get_named_child_node, childname); in fwnode_get_named_child_node()
808 struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode) in fwnode_handle_get() argument
810 if (!fwnode_has_op(fwnode, get)) in fwnode_handle_get()
811 return fwnode; in fwnode_handle_get()
813 return fwnode_call_ptr_op(fwnode, get); in fwnode_handle_get()
825 void fwnode_handle_put(struct fwnode_handle *fwnode) in fwnode_handle_put() argument
827 fwnode_call_void_op(fwnode, put); in fwnode_handle_put()
838 bool fwnode_device_is_available(const struct fwnode_handle *fwnode) in fwnode_device_is_available() argument
840 if (!fwnode_has_op(fwnode, device_is_available)) in fwnode_device_is_available()
843 return fwnode_call_bool_op(fwnode, device_is_available); in fwnode_device_is_available()
865 const struct fwnode_handle *fwnode = dev_fwnode(dev); in device_dma_supported() local
871 if (is_of_node(fwnode)) in device_dma_supported()
874 return acpi_dma_supported(to_acpi_device_node(fwnode)); in device_dma_supported()
880 const struct fwnode_handle *fwnode = dev_fwnode(dev); in device_get_dma_attr() local
883 if (is_of_node(fwnode)) { in device_get_dma_attr()
884 if (of_dma_is_coherent(to_of_node(fwnode))) in device_get_dma_attr()
889 attr = acpi_get_dma_attr(to_acpi_device_node(fwnode)); in device_get_dma_attr()
903 int fwnode_get_phy_mode(struct fwnode_handle *fwnode) in fwnode_get_phy_mode() argument
908 err = fwnode_property_read_string(fwnode, "phy-mode", &pm); in fwnode_get_phy_mode()
910 err = fwnode_property_read_string(fwnode, in fwnode_get_phy_mode()
945 int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index) in fwnode_irq_get() argument
950 if (is_of_node(fwnode)) in fwnode_irq_get()
951 return of_irq_get(to_of_node(fwnode), index); in fwnode_irq_get()
953 ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res); in fwnode_irq_get()
970 fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode, in fwnode_graph_get_next_endpoint() argument
984 parent = fwnode; in fwnode_graph_get_next_endpoint()
1023 fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_port_parent() argument
1027 endpoint = fwnode_graph_get_remote_endpoint(fwnode); in fwnode_graph_get_remote_port_parent()
1043 fwnode_graph_get_remote_port(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_port() argument
1045 return fwnode_get_next_parent(fwnode_graph_get_remote_endpoint(fwnode)); in fwnode_graph_get_remote_port()
1056 fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode) in fwnode_graph_get_remote_endpoint() argument
1058 return fwnode_call_ptr_op(fwnode, graph_get_remote_endpoint); in fwnode_graph_get_remote_endpoint()
1072 fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id, in fwnode_graph_get_remote_node() argument
1077 while ((endpoint = fwnode_graph_get_next_endpoint(fwnode, endpoint))) { in fwnode_graph_get_remote_node()
1121 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode, in fwnode_graph_get_endpoint_by_id() argument
1129 while ((ep = fwnode_graph_get_next_endpoint(fwnode, ep))) { in fwnode_graph_get_endpoint_by_id()
1184 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, in fwnode_graph_parse_endpoint() argument
1189 return fwnode_call_int_op(fwnode, graph_parse_endpoint, endpoint); in fwnode_graph_parse_endpoint()
1200 fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const char *con_id, in fwnode_graph_devcon_match() argument
1207 fwnode_graph_for_each_endpoint(fwnode, ep) { in fwnode_graph_devcon_match()
1223 fwnode_devcon_match(struct fwnode_handle *fwnode, const char *con_id, in fwnode_devcon_match() argument
1231 node = fwnode_find_reference(fwnode, con_id, i); in fwnode_devcon_match()
1255 void *fwnode_connection_find_match(struct fwnode_handle *fwnode, in fwnode_connection_find_match() argument
1261 if (!fwnode || !match) in fwnode_connection_find_match()
1264 ret = fwnode_graph_devcon_match(fwnode, con_id, data, match); in fwnode_connection_find_match()
1268 return fwnode_devcon_match(fwnode, con_id, data, match); in fwnode_connection_find_match()