diff options
Diffstat (limited to 'include/linux/property.h')
-rw-r--r-- | include/linux/property.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/linux/property.h b/include/linux/property.h index f6189a3ac63c..769d372c1edf 100644 --- a/include/linux/property.h +++ b/include/linux/property.h | |||
@@ -83,11 +83,17 @@ struct fwnode_handle *fwnode_get_next_parent( | |||
83 | struct fwnode_handle *fwnode); | 83 | struct fwnode_handle *fwnode); |
84 | struct fwnode_handle *fwnode_get_next_child_node( | 84 | struct fwnode_handle *fwnode_get_next_child_node( |
85 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); | 85 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); |
86 | struct fwnode_handle *fwnode_get_next_available_child_node( | ||
87 | const struct fwnode_handle *fwnode, struct fwnode_handle *child); | ||
86 | 88 | ||
87 | #define fwnode_for_each_child_node(fwnode, child) \ | 89 | #define fwnode_for_each_child_node(fwnode, child) \ |
88 | for (child = fwnode_get_next_child_node(fwnode, NULL); child; \ | 90 | for (child = fwnode_get_next_child_node(fwnode, NULL); child; \ |
89 | child = fwnode_get_next_child_node(fwnode, child)) | 91 | child = fwnode_get_next_child_node(fwnode, child)) |
90 | 92 | ||
93 | #define fwnode_for_each_available_child_node(fwnode, child) \ | ||
94 | for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\ | ||
95 | child = fwnode_get_next_available_child_node(fwnode, child)) | ||
96 | |||
91 | struct fwnode_handle *device_get_next_child_node( | 97 | struct fwnode_handle *device_get_next_child_node( |
92 | struct device *dev, struct fwnode_handle *child); | 98 | struct device *dev, struct fwnode_handle *child); |
93 | 99 | ||
@@ -103,6 +109,8 @@ struct fwnode_handle *device_get_named_child_node(struct device *dev, | |||
103 | struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode); | 109 | struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode); |
104 | void fwnode_handle_put(struct fwnode_handle *fwnode); | 110 | void fwnode_handle_put(struct fwnode_handle *fwnode); |
105 | 111 | ||
112 | int fwnode_irq_get(struct fwnode_handle *fwnode, unsigned int index); | ||
113 | |||
106 | unsigned int device_get_child_node_count(struct device *dev); | 114 | unsigned int device_get_child_node_count(struct device *dev); |
107 | 115 | ||
108 | static inline bool device_property_read_bool(struct device *dev, | 116 | static inline bool device_property_read_bool(struct device *dev, |
@@ -206,7 +214,7 @@ struct property_entry { | |||
206 | */ | 214 | */ |
207 | 215 | ||
208 | #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ | 216 | #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ |
209 | { \ | 217 | (struct property_entry) { \ |
210 | .name = _name_, \ | 218 | .name = _name_, \ |
211 | .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ | 219 | .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ |
212 | .is_array = true, \ | 220 | .is_array = true, \ |
@@ -224,7 +232,7 @@ struct property_entry { | |||
224 | PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) | 232 | PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) |
225 | 233 | ||
226 | #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ | 234 | #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ |
227 | { \ | 235 | (struct property_entry) { \ |
228 | .name = _name_, \ | 236 | .name = _name_, \ |
229 | .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ | 237 | .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ |
230 | .is_array = true, \ | 238 | .is_array = true, \ |
@@ -233,7 +241,7 @@ struct property_entry { | |||
233 | } | 241 | } |
234 | 242 | ||
235 | #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ | 243 | #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ |
236 | { \ | 244 | (struct property_entry) { \ |
237 | .name = _name_, \ | 245 | .name = _name_, \ |
238 | .length = sizeof(_type_), \ | 246 | .length = sizeof(_type_), \ |
239 | .is_string = false, \ | 247 | .is_string = false, \ |
@@ -250,7 +258,7 @@ struct property_entry { | |||
250 | PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) | 258 | PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) |
251 | 259 | ||
252 | #define PROPERTY_ENTRY_STRING(_name_, _val_) \ | 260 | #define PROPERTY_ENTRY_STRING(_name_, _val_) \ |
253 | { \ | 261 | (struct property_entry) { \ |
254 | .name = _name_, \ | 262 | .name = _name_, \ |
255 | .length = sizeof(_val_), \ | 263 | .length = sizeof(_val_), \ |
256 | .is_string = true, \ | 264 | .is_string = true, \ |
@@ -258,7 +266,7 @@ struct property_entry { | |||
258 | } | 266 | } |
259 | 267 | ||
260 | #define PROPERTY_ENTRY_BOOL(_name_) \ | 268 | #define PROPERTY_ENTRY_BOOL(_name_) \ |
261 | { \ | 269 | (struct property_entry) { \ |
262 | .name = _name_, \ | 270 | .name = _name_, \ |
263 | } | 271 | } |
264 | 272 | ||
@@ -275,10 +283,15 @@ bool device_dma_supported(struct device *dev); | |||
275 | 283 | ||
276 | enum dev_dma_attr device_get_dma_attr(struct device *dev); | 284 | enum dev_dma_attr device_get_dma_attr(struct device *dev); |
277 | 285 | ||
286 | void *device_get_match_data(struct device *dev); | ||
287 | |||
278 | int device_get_phy_mode(struct device *dev); | 288 | int device_get_phy_mode(struct device *dev); |
279 | 289 | ||
280 | void *device_get_mac_address(struct device *dev, char *addr, int alen); | 290 | void *device_get_mac_address(struct device *dev, char *addr, int alen); |
281 | 291 | ||
292 | int fwnode_get_phy_mode(struct fwnode_handle *fwnode); | ||
293 | void *fwnode_get_mac_address(struct fwnode_handle *fwnode, | ||
294 | char *addr, int alen); | ||
282 | struct fwnode_handle *fwnode_graph_get_next_endpoint( | 295 | struct fwnode_handle *fwnode_graph_get_next_endpoint( |
283 | const struct fwnode_handle *fwnode, struct fwnode_handle *prev); | 296 | const struct fwnode_handle *fwnode, struct fwnode_handle *prev); |
284 | struct fwnode_handle * | 297 | struct fwnode_handle * |