|
22 | 22 | #define pr_fmt(fmt) "OF: " fmt |
23 | 23 |
|
24 | 24 | #include <linux/of.h> |
| 25 | +#include <linux/of_address.h> |
25 | 26 | #include <linux/of_device.h> |
26 | 27 | #include <linux/of_graph.h> |
27 | 28 | #include <linux/of_irq.h> |
@@ -872,6 +873,20 @@ static bool of_fwnode_device_is_available(const struct fwnode_handle *fwnode) |
872 | 873 | return of_device_is_available(to_of_node(fwnode)); |
873 | 874 | } |
874 | 875 |
|
| 876 | +static bool of_fwnode_device_dma_supported(const struct fwnode_handle *fwnode) |
| 877 | +{ |
| 878 | + return true; |
| 879 | +} |
| 880 | + |
| 881 | +static enum dev_dma_attr |
| 882 | +of_fwnode_device_get_dma_attr(const struct fwnode_handle *fwnode) |
| 883 | +{ |
| 884 | + if (of_dma_is_coherent(to_of_node(fwnode))) |
| 885 | + return DEV_DMA_COHERENT; |
| 886 | + else |
| 887 | + return DEV_DMA_NON_COHERENT; |
| 888 | +} |
| 889 | + |
875 | 890 | static bool of_fwnode_property_present(const struct fwnode_handle *fwnode, |
876 | 891 | const char *propname) |
877 | 892 | { |
@@ -1472,6 +1487,8 @@ const struct fwnode_operations of_fwnode_ops = { |
1472 | 1487 | .put = of_fwnode_put, |
1473 | 1488 | .device_is_available = of_fwnode_device_is_available, |
1474 | 1489 | .device_get_match_data = of_fwnode_device_get_match_data, |
| 1490 | + .device_dma_supported = of_fwnode_device_dma_supported, |
| 1491 | + .device_get_dma_attr = of_fwnode_device_get_dma_attr, |
1475 | 1492 | .property_present = of_fwnode_property_present, |
1476 | 1493 | .property_read_int_array = of_fwnode_property_read_int_array, |
1477 | 1494 | .property_read_string_array = of_fwnode_property_read_string_array, |
|
0 commit comments