Lines Matching refs:dn

33 static void pnv_php_register(struct device_node *dn);
34 static void pnv_php_unregister_one(struct device_node *dn);
35 static void pnv_php_unregister(struct device_node *dn);
90 static struct pnv_php_slot *pnv_php_match(struct device_node *dn, in pnv_php_match() argument
95 if (php_slot->dn == dn) { in pnv_php_match()
101 target = pnv_php_match(dn, tmp); in pnv_php_match()
109 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) in pnv_php_find_slot() argument
116 php_slot = pnv_php_match(dn, tmp); in pnv_php_find_slot()
132 static void pnv_php_rmv_pdns(struct device_node *dn) in pnv_php_rmv_pdns() argument
136 for_each_child_of_node(dn, child) { in pnv_php_rmv_pdns()
156 struct device_node *dn; in pnv_php_detach_device_nodes() local
158 for_each_child_of_node(parent, dn) { in pnv_php_detach_device_nodes()
159 pnv_php_detach_device_nodes(dn); in pnv_php_detach_device_nodes()
161 of_node_put(dn); in pnv_php_detach_device_nodes()
162 of_detach_node(dn); in pnv_php_detach_device_nodes()
168 pnv_php_rmv_pdns(php_slot->dn); in pnv_php_rmv_devtree()
176 pnv_php_detach_device_nodes(php_slot->dn); in pnv_php_rmv_devtree()
182 php_slot->dn->child = NULL; in pnv_php_rmv_devtree()
213 struct device_node *dn) in pnv_php_populate_changeset() argument
218 for_each_child_of_node(dn, child) { in pnv_php_populate_changeset()
235 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data) in pnv_php_add_one_pdn() argument
240 pdn = pci_add_device_node_info(hose, dn); in pnv_php_add_one_pdn()
251 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose); in pnv_php_add_pdns()
269 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000); in pnv_php_add_devtree()
282 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); in pnv_php_add_devtree()
291 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
292 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn); in pnv_php_add_devtree()
294 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
300 php_slot->dn->child = NULL; in pnv_php_add_devtree()
318 php_slot->dn->child = NULL; in pnv_php_add_devtree()
341 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle || in pnv_php_set_slot_power_state()
521 pnv_php_register(php_slot->dn); in pnv_php_enable()
587 pnv_php_unregister(php_slot->dn); in pnv_php_disable_slot()
620 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) in pnv_php_alloc_slot() argument
628 ret = of_property_read_string(dn, "ibm,slot-label", &label); in pnv_php_alloc_slot()
632 if (pnv_pci_get_slot_id(dn, &id)) in pnv_php_alloc_slot()
635 bus = pci_find_bus_by_node(dn); in pnv_php_alloc_slot()
649 if (dn->child && PCI_DN(dn->child)) in pnv_php_alloc_slot()
650 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn); in pnv_php_alloc_slot()
656 php_slot->dn = dn; in pnv_php_alloc_slot()
672 struct device_node *dn = php_slot->dn; in pnv_php_register_slot() local
677 parent = pnv_php_find_slot(php_slot->dn); in pnv_php_register_slot()
692 while ((dn = of_get_parent(dn))) { in pnv_php_register_slot()
693 if (!PCI_DN(dn)) { in pnv_php_register_slot()
694 of_node_put(dn); in pnv_php_register_slot()
698 parent = pnv_php_find_slot(dn); in pnv_php_register_slot()
700 of_node_put(dn); in pnv_php_register_slot()
704 of_node_put(dn); in pnv_php_register_slot()
854 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc", in pnv_php_init_irq()
932 static int pnv_php_register_one(struct device_node *dn) in pnv_php_register_one() argument
939 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32); in pnv_php_register_one()
943 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32); in pnv_php_register_one()
947 php_slot = pnv_php_alloc_slot(dn); in pnv_php_register_one()
960 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32); in pnv_php_register_one()
967 pnv_php_unregister_one(php_slot->dn); in pnv_php_register_one()
973 static void pnv_php_register(struct device_node *dn) in pnv_php_register() argument
981 for_each_child_of_node(dn, child) { in pnv_php_register()
987 static void pnv_php_unregister_one(struct device_node *dn) in pnv_php_unregister_one() argument
991 php_slot = pnv_php_find_slot(dn); in pnv_php_unregister_one()
1001 static void pnv_php_unregister(struct device_node *dn) in pnv_php_unregister() argument
1006 for_each_child_of_node(dn, child) { in pnv_php_unregister()
1014 struct device_node *dn; in pnv_php_init() local
1017 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_init()
1018 pnv_php_register(dn); in pnv_php_init()
1020 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_init()
1021 pnv_php_register(dn); in pnv_php_init()
1023 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_init()
1024 pnv_php_register_one(dn); /* slot directly under the PHB */ in pnv_php_init()
1030 struct device_node *dn; in pnv_php_exit() local
1032 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_exit()
1033 pnv_php_unregister(dn); in pnv_php_exit()
1035 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_exit()
1036 pnv_php_unregister(dn); in pnv_php_exit()
1038 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_exit()
1039 pnv_php_unregister_one(dn); /* slot directly under the PHB */ in pnv_php_exit()