This source file includes following definitions.
- dev_fwnode
- device_property_present
- fwnode_property_present
- device_property_read_u8_array
- device_property_read_u16_array
- device_property_read_u32_array
- device_property_read_u64_array
- device_property_read_string_array
- device_property_read_string
- device_property_match_string
- fwnode_property_read_int_array
- fwnode_property_read_u8_array
- fwnode_property_read_u16_array
- fwnode_property_read_u32_array
- fwnode_property_read_u64_array
- fwnode_property_read_string_array
- fwnode_property_read_string
- fwnode_property_match_string
- fwnode_property_get_reference_args
- fwnode_find_reference
- device_remove_properties
- device_add_properties
- fwnode_get_next_parent
- fwnode_get_parent
- fwnode_get_next_child_node
- fwnode_get_next_available_child_node
- device_get_next_child_node
- fwnode_get_named_child_node
- device_get_named_child_node
- fwnode_handle_get
- fwnode_handle_put
- fwnode_device_is_available
- device_get_child_node_count
- device_dma_supported
- device_get_dma_attr
- fwnode_get_phy_mode
- device_get_phy_mode
- fwnode_get_mac_addr
- fwnode_get_mac_address
- device_get_mac_address
- fwnode_irq_get
- fwnode_graph_get_next_endpoint
- fwnode_graph_get_port_parent
- fwnode_graph_get_remote_port_parent
- fwnode_graph_get_remote_port
- fwnode_graph_get_remote_endpoint
- fwnode_graph_get_remote_node
- fwnode_graph_get_endpoint_by_id
- fwnode_graph_parse_endpoint
- device_get_match_data
1
2
3
4
5
6
7
8
9
10 #include <linux/acpi.h>
11 #include <linux/export.h>
12 #include <linux/kernel.h>
13 #include <linux/of.h>
14 #include <linux/of_address.h>
15 #include <linux/of_graph.h>
16 #include <linux/of_irq.h>
17 #include <linux/property.h>
18 #include <linux/etherdevice.h>
19 #include <linux/phy.h>
20
21 struct fwnode_handle *dev_fwnode(struct device *dev)
22 {
23 return IS_ENABLED(CONFIG_OF) && dev->of_node ?
24 &dev->of_node->fwnode : dev->fwnode;
25 }
26 EXPORT_SYMBOL_GPL(dev_fwnode);
27
28
29
30
31
32
33
34
35 bool device_property_present(struct device *dev, const char *propname)
36 {
37 return fwnode_property_present(dev_fwnode(dev), propname);
38 }
39 EXPORT_SYMBOL_GPL(device_property_present);
40
41
42
43
44
45
46 bool fwnode_property_present(const struct fwnode_handle *fwnode,
47 const char *propname)
48 {
49 bool ret;
50
51 ret = fwnode_call_bool_op(fwnode, property_present, propname);
52 if (ret == false && !IS_ERR_OR_NULL(fwnode) &&
53 !IS_ERR_OR_NULL(fwnode->secondary))
54 ret = fwnode_call_bool_op(fwnode->secondary, property_present,
55 propname);
56 return ret;
57 }
58 EXPORT_SYMBOL_GPL(fwnode_property_present);
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 int device_property_read_u8_array(struct device *dev, const char *propname,
79 u8 *val, size_t nval)
80 {
81 return fwnode_property_read_u8_array(dev_fwnode(dev), propname, val, nval);
82 }
83 EXPORT_SYMBOL_GPL(device_property_read_u8_array);
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103 int device_property_read_u16_array(struct device *dev, const char *propname,
104 u16 *val, size_t nval)
105 {
106 return fwnode_property_read_u16_array(dev_fwnode(dev), propname, val, nval);
107 }
108 EXPORT_SYMBOL_GPL(device_property_read_u16_array);
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 int device_property_read_u32_array(struct device *dev, const char *propname,
129 u32 *val, size_t nval)
130 {
131 return fwnode_property_read_u32_array(dev_fwnode(dev), propname, val, nval);
132 }
133 EXPORT_SYMBOL_GPL(device_property_read_u32_array);
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 int device_property_read_u64_array(struct device *dev, const char *propname,
154 u64 *val, size_t nval)
155 {
156 return fwnode_property_read_u64_array(dev_fwnode(dev), propname, val, nval);
157 }
158 EXPORT_SYMBOL_GPL(device_property_read_u64_array);
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178 int device_property_read_string_array(struct device *dev, const char *propname,
179 const char **val, size_t nval)
180 {
181 return fwnode_property_read_string_array(dev_fwnode(dev), propname, val, nval);
182 }
183 EXPORT_SYMBOL_GPL(device_property_read_string_array);
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200 int device_property_read_string(struct device *dev, const char *propname,
201 const char **val)
202 {
203 return fwnode_property_read_string(dev_fwnode(dev), propname, val);
204 }
205 EXPORT_SYMBOL_GPL(device_property_read_string);
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222 int device_property_match_string(struct device *dev, const char *propname,
223 const char *string)
224 {
225 return fwnode_property_match_string(dev_fwnode(dev), propname, string);
226 }
227 EXPORT_SYMBOL_GPL(device_property_match_string);
228
229 static int fwnode_property_read_int_array(const struct fwnode_handle *fwnode,
230 const char *propname,
231 unsigned int elem_size, void *val,
232 size_t nval)
233 {
234 int ret;
235
236 ret = fwnode_call_int_op(fwnode, property_read_int_array, propname,
237 elem_size, val, nval);
238 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) &&
239 !IS_ERR_OR_NULL(fwnode->secondary))
240 ret = fwnode_call_int_op(
241 fwnode->secondary, property_read_int_array, propname,
242 elem_size, val, nval);
243
244 return ret;
245 }
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265 int fwnode_property_read_u8_array(const struct fwnode_handle *fwnode,
266 const char *propname, u8 *val, size_t nval)
267 {
268 return fwnode_property_read_int_array(fwnode, propname, sizeof(u8),
269 val, nval);
270 }
271 EXPORT_SYMBOL_GPL(fwnode_property_read_u8_array);
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291 int fwnode_property_read_u16_array(const struct fwnode_handle *fwnode,
292 const char *propname, u16 *val, size_t nval)
293 {
294 return fwnode_property_read_int_array(fwnode, propname, sizeof(u16),
295 val, nval);
296 }
297 EXPORT_SYMBOL_GPL(fwnode_property_read_u16_array);
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317 int fwnode_property_read_u32_array(const struct fwnode_handle *fwnode,
318 const char *propname, u32 *val, size_t nval)
319 {
320 return fwnode_property_read_int_array(fwnode, propname, sizeof(u32),
321 val, nval);
322 }
323 EXPORT_SYMBOL_GPL(fwnode_property_read_u32_array);
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343 int fwnode_property_read_u64_array(const struct fwnode_handle *fwnode,
344 const char *propname, u64 *val, size_t nval)
345 {
346 return fwnode_property_read_int_array(fwnode, propname, sizeof(u64),
347 val, nval);
348 }
349 EXPORT_SYMBOL_GPL(fwnode_property_read_u64_array);
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369 int fwnode_property_read_string_array(const struct fwnode_handle *fwnode,
370 const char *propname, const char **val,
371 size_t nval)
372 {
373 int ret;
374
375 ret = fwnode_call_int_op(fwnode, property_read_string_array, propname,
376 val, nval);
377 if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) &&
378 !IS_ERR_OR_NULL(fwnode->secondary))
379 ret = fwnode_call_int_op(fwnode->secondary,
380 property_read_string_array, propname,
381 val, nval);
382 return ret;
383 }
384 EXPORT_SYMBOL_GPL(fwnode_property_read_string_array);
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 int fwnode_property_read_string(const struct fwnode_handle *fwnode,
402 const char *propname, const char **val)
403 {
404 int ret = fwnode_property_read_string_array(fwnode, propname, val, 1);
405
406 return ret < 0 ? ret : 0;
407 }
408 EXPORT_SYMBOL_GPL(fwnode_property_read_string);
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425 int fwnode_property_match_string(const struct fwnode_handle *fwnode,
426 const char *propname, const char *string)
427 {
428 const char **values;
429 int nval, ret;
430
431 nval = fwnode_property_read_string_array(fwnode, propname, NULL, 0);
432 if (nval < 0)
433 return nval;
434
435 if (nval == 0)
436 return -ENODATA;
437
438 values = kcalloc(nval, sizeof(*values), GFP_KERNEL);
439 if (!values)
440 return -ENOMEM;
441
442 ret = fwnode_property_read_string_array(fwnode, propname, values, nval);
443 if (ret < 0)
444 goto out;
445
446 ret = match_string(values, nval, string);
447 if (ret < 0)
448 ret = -ENODATA;
449 out:
450 kfree(values);
451 return ret;
452 }
453 EXPORT_SYMBOL_GPL(fwnode_property_match_string);
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477 int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
478 const char *prop, const char *nargs_prop,
479 unsigned int nargs, unsigned int index,
480 struct fwnode_reference_args *args)
481 {
482 return fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop,
483 nargs, index, args);
484 }
485 EXPORT_SYMBOL_GPL(fwnode_property_get_reference_args);
486
487
488
489
490
491
492
493
494
495
496
497
498 struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode,
499 const char *name,
500 unsigned int index)
501 {
502 struct fwnode_reference_args args;
503 int ret;
504
505 ret = fwnode_property_get_reference_args(fwnode, name, NULL, 0, index,
506 &args);
507 return ret ? ERR_PTR(ret) : args.fwnode;
508 }
509 EXPORT_SYMBOL_GPL(fwnode_find_reference);
510
511
512
513
514
515
516
517
518
519 void device_remove_properties(struct device *dev)
520 {
521 struct fwnode_handle *fwnode = dev_fwnode(dev);
522
523 if (!fwnode)
524 return;
525
526 if (is_software_node(fwnode->secondary)) {
527 fwnode_remove_software_node(fwnode->secondary);
528 set_secondary_fwnode(dev, NULL);
529 }
530 }
531 EXPORT_SYMBOL_GPL(device_remove_properties);
532
533
534
535
536
537
538
539
540
541
542
543
544
545 int device_add_properties(struct device *dev,
546 const struct property_entry *properties)
547 {
548 struct fwnode_handle *fwnode;
549
550 fwnode = fwnode_create_software_node(properties, NULL);
551 if (IS_ERR(fwnode))
552 return PTR_ERR(fwnode);
553
554 set_secondary_fwnode(dev, fwnode);
555 return 0;
556 }
557 EXPORT_SYMBOL_GPL(device_add_properties);
558
559
560
561
562
563
564
565
566
567
568
569
570 struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode)
571 {
572 struct fwnode_handle *parent = fwnode_get_parent(fwnode);
573
574 fwnode_handle_put(fwnode);
575
576 return parent;
577 }
578 EXPORT_SYMBOL_GPL(fwnode_get_next_parent);
579
580
581
582
583
584
585
586
587 struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode)
588 {
589 return fwnode_call_ptr_op(fwnode, get_parent);
590 }
591 EXPORT_SYMBOL_GPL(fwnode_get_parent);
592
593
594
595
596
597
598 struct fwnode_handle *
599 fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
600 struct fwnode_handle *child)
601 {
602 return fwnode_call_ptr_op(fwnode, get_next_child_node, child);
603 }
604 EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
605
606
607
608
609
610
611
612 struct fwnode_handle *
613 fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
614 struct fwnode_handle *child)
615 {
616 struct fwnode_handle *next_child = child;
617
618 if (!fwnode)
619 return NULL;
620
621 do {
622 next_child = fwnode_get_next_child_node(fwnode, next_child);
623
624 if (!next_child || fwnode_device_is_available(next_child))
625 break;
626 } while (next_child);
627
628 return next_child;
629 }
630 EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
631
632
633
634
635
636
637 struct fwnode_handle *device_get_next_child_node(struct device *dev,
638 struct fwnode_handle *child)
639 {
640 struct acpi_device *adev = ACPI_COMPANION(dev);
641 struct fwnode_handle *fwnode = NULL;
642
643 if (dev->of_node)
644 fwnode = &dev->of_node->fwnode;
645 else if (adev)
646 fwnode = acpi_fwnode_handle(adev);
647
648 return fwnode_get_next_child_node(fwnode, child);
649 }
650 EXPORT_SYMBOL_GPL(device_get_next_child_node);
651
652
653
654
655
656
657 struct fwnode_handle *
658 fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
659 const char *childname)
660 {
661 return fwnode_call_ptr_op(fwnode, get_named_child_node, childname);
662 }
663 EXPORT_SYMBOL_GPL(fwnode_get_named_child_node);
664
665
666
667
668
669
670 struct fwnode_handle *device_get_named_child_node(struct device *dev,
671 const char *childname)
672 {
673 return fwnode_get_named_child_node(dev_fwnode(dev), childname);
674 }
675 EXPORT_SYMBOL_GPL(device_get_named_child_node);
676
677
678
679
680
681
682
683 struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode)
684 {
685 if (!fwnode_has_op(fwnode, get))
686 return fwnode;
687
688 return fwnode_call_ptr_op(fwnode, get);
689 }
690 EXPORT_SYMBOL_GPL(fwnode_handle_get);
691
692
693
694
695
696
697
698
699
700 void fwnode_handle_put(struct fwnode_handle *fwnode)
701 {
702 fwnode_call_void_op(fwnode, put);
703 }
704 EXPORT_SYMBOL_GPL(fwnode_handle_put);
705
706
707
708
709
710 bool fwnode_device_is_available(const struct fwnode_handle *fwnode)
711 {
712 return fwnode_call_bool_op(fwnode, device_is_available);
713 }
714 EXPORT_SYMBOL_GPL(fwnode_device_is_available);
715
716
717
718
719
720 unsigned int device_get_child_node_count(struct device *dev)
721 {
722 struct fwnode_handle *child;
723 unsigned int count = 0;
724
725 device_for_each_child_node(dev, child)
726 count++;
727
728 return count;
729 }
730 EXPORT_SYMBOL_GPL(device_get_child_node_count);
731
732 bool device_dma_supported(struct device *dev)
733 {
734
735
736
737
738 if (IS_ENABLED(CONFIG_OF) && dev->of_node)
739 return true;
740
741 return acpi_dma_supported(ACPI_COMPANION(dev));
742 }
743 EXPORT_SYMBOL_GPL(device_dma_supported);
744
745 enum dev_dma_attr device_get_dma_attr(struct device *dev)
746 {
747 enum dev_dma_attr attr = DEV_DMA_NOT_SUPPORTED;
748
749 if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
750 if (of_dma_is_coherent(dev->of_node))
751 attr = DEV_DMA_COHERENT;
752 else
753 attr = DEV_DMA_NON_COHERENT;
754 } else
755 attr = acpi_get_dma_attr(ACPI_COMPANION(dev));
756
757 return attr;
758 }
759 EXPORT_SYMBOL_GPL(device_get_dma_attr);
760
761
762
763
764
765
766
767
768
769 int fwnode_get_phy_mode(struct fwnode_handle *fwnode)
770 {
771 const char *pm;
772 int err, i;
773
774 err = fwnode_property_read_string(fwnode, "phy-mode", &pm);
775 if (err < 0)
776 err = fwnode_property_read_string(fwnode,
777 "phy-connection-type", &pm);
778 if (err < 0)
779 return err;
780
781 for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++)
782 if (!strcasecmp(pm, phy_modes(i)))
783 return i;
784
785 return -ENODEV;
786 }
787 EXPORT_SYMBOL_GPL(fwnode_get_phy_mode);
788
789
790
791
792
793
794
795
796
797 int device_get_phy_mode(struct device *dev)
798 {
799 return fwnode_get_phy_mode(dev_fwnode(dev));
800 }
801 EXPORT_SYMBOL_GPL(device_get_phy_mode);
802
803 static void *fwnode_get_mac_addr(struct fwnode_handle *fwnode,
804 const char *name, char *addr,
805 int alen)
806 {
807 int ret = fwnode_property_read_u8_array(fwnode, name, addr, alen);
808
809 if (ret == 0 && alen == ETH_ALEN && is_valid_ether_addr(addr))
810 return addr;
811 return NULL;
812 }
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837 void *fwnode_get_mac_address(struct fwnode_handle *fwnode, char *addr, int alen)
838 {
839 char *res;
840
841 res = fwnode_get_mac_addr(fwnode, "mac-address", addr, alen);
842 if (res)
843 return res;
844
845 res = fwnode_get_mac_addr(fwnode, "local-mac-address", addr, alen);
846 if (res)
847 return res;
848
849 return fwnode_get_mac_addr(fwnode, "address", addr, alen);
850 }
851 EXPORT_SYMBOL(fwnode_get_mac_address);
852
853
854
855
856
857
858
859 void *device_get_mac_address(struct device *dev, char *addr, int alen)
860 {
861 return fwnode_get_mac_address(dev_fwnode(dev), addr, alen);
862 }
863 EXPORT_SYMBOL(device_get_mac_address);
864
865
866
867
868
869
870
871
872
873 int fwnode_irq_get(struct fwnode_handle *fwnode, unsigned int index)
874 {
875 struct device_node *of_node = to_of_node(fwnode);
876 struct resource res;
877 int ret;
878
879 if (IS_ENABLED(CONFIG_OF) && of_node)
880 return of_irq_get(of_node, index);
881
882 ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res);
883 if (ret)
884 return ret;
885
886 return res.start;
887 }
888 EXPORT_SYMBOL(fwnode_irq_get);
889
890
891
892
893
894
895
896
897
898 struct fwnode_handle *
899 fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
900 struct fwnode_handle *prev)
901 {
902 return fwnode_call_ptr_op(fwnode, graph_get_next_endpoint, prev);
903 }
904 EXPORT_SYMBOL_GPL(fwnode_graph_get_next_endpoint);
905
906
907
908
909
910
911
912 struct fwnode_handle *
913 fwnode_graph_get_port_parent(const struct fwnode_handle *endpoint)
914 {
915 struct fwnode_handle *port, *parent;
916
917 port = fwnode_get_parent(endpoint);
918 parent = fwnode_call_ptr_op(port, graph_get_port_parent);
919
920 fwnode_handle_put(port);
921
922 return parent;
923 }
924 EXPORT_SYMBOL_GPL(fwnode_graph_get_port_parent);
925
926
927
928
929
930
931
932 struct fwnode_handle *
933 fwnode_graph_get_remote_port_parent(const struct fwnode_handle *fwnode)
934 {
935 struct fwnode_handle *endpoint, *parent;
936
937 endpoint = fwnode_graph_get_remote_endpoint(fwnode);
938 parent = fwnode_graph_get_port_parent(endpoint);
939
940 fwnode_handle_put(endpoint);
941
942 return parent;
943 }
944 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_port_parent);
945
946
947
948
949
950
951
952 struct fwnode_handle *
953 fwnode_graph_get_remote_port(const struct fwnode_handle *fwnode)
954 {
955 return fwnode_get_next_parent(fwnode_graph_get_remote_endpoint(fwnode));
956 }
957 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_port);
958
959
960
961
962
963
964
965 struct fwnode_handle *
966 fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode)
967 {
968 return fwnode_call_ptr_op(fwnode, graph_get_remote_endpoint);
969 }
970 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_endpoint);
971
972
973
974
975
976
977
978
979
980
981 struct fwnode_handle *
982 fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id,
983 u32 endpoint_id)
984 {
985 struct fwnode_handle *endpoint = NULL;
986
987 while ((endpoint = fwnode_graph_get_next_endpoint(fwnode, endpoint))) {
988 struct fwnode_endpoint fwnode_ep;
989 struct fwnode_handle *remote;
990 int ret;
991
992 ret = fwnode_graph_parse_endpoint(endpoint, &fwnode_ep);
993 if (ret < 0)
994 continue;
995
996 if (fwnode_ep.port != port_id || fwnode_ep.id != endpoint_id)
997 continue;
998
999 remote = fwnode_graph_get_remote_port_parent(endpoint);
1000 if (!remote)
1001 return NULL;
1002
1003 return fwnode_device_is_available(remote) ? remote : NULL;
1004 }
1005
1006 return NULL;
1007 }
1008 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_node);
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030 struct fwnode_handle *
1031 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
1032 u32 port, u32 endpoint, unsigned long flags)
1033 {
1034 struct fwnode_handle *ep = NULL, *best_ep = NULL;
1035 unsigned int best_ep_id = 0;
1036 bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
1037 bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
1038
1039 while ((ep = fwnode_graph_get_next_endpoint(fwnode, ep))) {
1040 struct fwnode_endpoint fwnode_ep = { 0 };
1041 int ret;
1042
1043 if (enabled_only) {
1044 struct fwnode_handle *dev_node;
1045 bool available;
1046
1047 dev_node = fwnode_graph_get_remote_port_parent(ep);
1048 available = fwnode_device_is_available(dev_node);
1049 fwnode_handle_put(dev_node);
1050 if (!available)
1051 continue;
1052 }
1053
1054 ret = fwnode_graph_parse_endpoint(ep, &fwnode_ep);
1055 if (ret < 0)
1056 continue;
1057
1058 if (fwnode_ep.port != port)
1059 continue;
1060
1061 if (fwnode_ep.id == endpoint)
1062 return ep;
1063
1064 if (!endpoint_next)
1065 continue;
1066
1067
1068
1069
1070
1071
1072 if (fwnode_ep.id < endpoint ||
1073 (best_ep && best_ep_id < fwnode_ep.id))
1074 continue;
1075
1076 fwnode_handle_put(best_ep);
1077 best_ep = fwnode_handle_get(ep);
1078 best_ep_id = fwnode_ep.id;
1079 }
1080
1081 return best_ep;
1082 }
1083 EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094 int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
1095 struct fwnode_endpoint *endpoint)
1096 {
1097 memset(endpoint, 0, sizeof(*endpoint));
1098
1099 return fwnode_call_int_op(fwnode, graph_parse_endpoint, endpoint);
1100 }
1101 EXPORT_SYMBOL(fwnode_graph_parse_endpoint);
1102
1103 const void *device_get_match_data(struct device *dev)
1104 {
1105 return fwnode_call_ptr_op(dev_fwnode(dev), device_get_match_data, dev);
1106 }
1107 EXPORT_SYMBOL_GPL(device_get_match_data);