Lines Matching refs:dn

34 static void pnv_php_register(struct device_node *dn);
35 static void pnv_php_unregister_one(struct device_node *dn);
36 static void pnv_php_unregister(struct device_node *dn);
91 static struct pnv_php_slot *pnv_php_match(struct device_node *dn, in pnv_php_match() argument
96 if (php_slot->dn == dn) { in pnv_php_match()
102 target = pnv_php_match(dn, tmp); in pnv_php_match()
110 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) in pnv_php_find_slot() argument
117 php_slot = pnv_php_match(dn, tmp); in pnv_php_find_slot()
133 static void pnv_php_rmv_pdns(struct device_node *dn) in pnv_php_rmv_pdns() argument
137 for_each_child_of_node(dn, child) { in pnv_php_rmv_pdns()
157 struct device_node *dn; in pnv_php_detach_device_nodes() local
159 for_each_child_of_node(parent, dn) { in pnv_php_detach_device_nodes()
160 pnv_php_detach_device_nodes(dn); in pnv_php_detach_device_nodes()
162 of_node_put(dn); in pnv_php_detach_device_nodes()
163 of_detach_node(dn); in pnv_php_detach_device_nodes()
169 pnv_php_rmv_pdns(php_slot->dn); in pnv_php_rmv_devtree()
177 pnv_php_detach_device_nodes(php_slot->dn); in pnv_php_rmv_devtree()
183 php_slot->dn->child = NULL; in pnv_php_rmv_devtree()
214 struct device_node *dn) in pnv_php_populate_changeset() argument
219 for_each_child_of_node(dn, child) { in pnv_php_populate_changeset()
236 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data) in pnv_php_add_one_pdn() argument
241 pdn = pci_add_device_node_info(hose, dn); in pnv_php_add_one_pdn()
252 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose); in pnv_php_add_pdns()
270 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000); in pnv_php_add_devtree()
283 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); in pnv_php_add_devtree()
292 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
293 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn); in pnv_php_add_devtree()
295 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
301 php_slot->dn->child = NULL; in pnv_php_add_devtree()
319 php_slot->dn->child = NULL; in pnv_php_add_devtree()
342 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle || in pnv_php_set_slot_power_state()
522 pnv_php_register(php_slot->dn); in pnv_php_enable()
588 pnv_php_unregister(php_slot->dn); in pnv_php_disable_slot()
621 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) in pnv_php_alloc_slot() argument
629 ret = of_property_read_string(dn, "ibm,slot-label", &label); in pnv_php_alloc_slot()
633 if (pnv_pci_get_slot_id(dn, &id)) in pnv_php_alloc_slot()
636 bus = pci_find_bus_by_node(dn); in pnv_php_alloc_slot()
650 if (dn->child && PCI_DN(dn->child)) in pnv_php_alloc_slot()
651 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn); in pnv_php_alloc_slot()
657 php_slot->dn = dn; in pnv_php_alloc_slot()
673 struct device_node *dn = php_slot->dn; in pnv_php_register_slot() local
678 parent = pnv_php_find_slot(php_slot->dn); in pnv_php_register_slot()
693 while ((dn = of_get_parent(dn))) { in pnv_php_register_slot()
694 if (!PCI_DN(dn)) { in pnv_php_register_slot()
695 of_node_put(dn); in pnv_php_register_slot()
699 parent = pnv_php_find_slot(dn); in pnv_php_register_slot()
701 of_node_put(dn); in pnv_php_register_slot()
705 of_node_put(dn); in pnv_php_register_slot()
855 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc", in pnv_php_init_irq()
933 static int pnv_php_register_one(struct device_node *dn) in pnv_php_register_one() argument
940 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32); in pnv_php_register_one()
944 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32); in pnv_php_register_one()
948 php_slot = pnv_php_alloc_slot(dn); in pnv_php_register_one()
961 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32); in pnv_php_register_one()
968 pnv_php_unregister_one(php_slot->dn); in pnv_php_register_one()
974 static void pnv_php_register(struct device_node *dn) in pnv_php_register() argument
982 for_each_child_of_node(dn, child) { in pnv_php_register()
988 static void pnv_php_unregister_one(struct device_node *dn) in pnv_php_unregister_one() argument
992 php_slot = pnv_php_find_slot(dn); in pnv_php_unregister_one()
1002 static void pnv_php_unregister(struct device_node *dn) in pnv_php_unregister() argument
1007 for_each_child_of_node(dn, child) { in pnv_php_unregister()
1015 struct device_node *dn; in pnv_php_init() local
1018 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_init()
1019 pnv_php_register(dn); in pnv_php_init()
1021 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_init()
1022 pnv_php_register(dn); in pnv_php_init()
1024 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_init()
1025 pnv_php_register_one(dn); /* slot directly under the PHB */ in pnv_php_init()
1031 struct device_node *dn; in pnv_php_exit() local
1033 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_exit()
1034 pnv_php_unregister(dn); in pnv_php_exit()
1036 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_exit()
1037 pnv_php_unregister(dn); in pnv_php_exit()
1039 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_exit()
1040 pnv_php_unregister_one(dn); /* slot directly under the PHB */ in pnv_php_exit()