diff options
Diffstat (limited to 'drivers/of/of_pci.c')
-rw-r--r-- | drivers/of/of_pci.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c index b58be12ab277..0ee42c3e66a1 100644 --- a/drivers/of/of_pci.c +++ b/drivers/of/of_pci.c | |||
@@ -120,6 +120,27 @@ int of_get_pci_domain_nr(struct device_node *node) | |||
120 | EXPORT_SYMBOL_GPL(of_get_pci_domain_nr); | 120 | EXPORT_SYMBOL_GPL(of_get_pci_domain_nr); |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * This function will try to find the limitation of link speed by finding | ||
124 | * a property called "max-link-speed" of the given device node. | ||
125 | * | ||
126 | * @node: device tree node with the max link speed information | ||
127 | * | ||
128 | * Returns the associated max link speed from DT, or a negative value if the | ||
129 | * required property is not found or is invalid. | ||
130 | */ | ||
131 | int of_pci_get_max_link_speed(struct device_node *node) | ||
132 | { | ||
133 | u32 max_link_speed; | ||
134 | |||
135 | if (of_property_read_u32(node, "max-link-speed", &max_link_speed) || | ||
136 | max_link_speed > 4) | ||
137 | return -EINVAL; | ||
138 | |||
139 | return max_link_speed; | ||
140 | } | ||
141 | EXPORT_SYMBOL_GPL(of_pci_get_max_link_speed); | ||
142 | |||
143 | /** | ||
123 | * of_pci_check_probe_only - Setup probe only mode if linux,pci-probe-only | 144 | * of_pci_check_probe_only - Setup probe only mode if linux,pci-probe-only |
124 | * is present and valid | 145 | * is present and valid |
125 | */ | 146 | */ |