Lines Matching refs:dn

38 static void pnv_php_register(struct device_node *dn);
39 static void pnv_php_unregister_one(struct device_node *dn);
40 static void pnv_php_unregister(struct device_node *dn);
93 static struct pnv_php_slot *pnv_php_match(struct device_node *dn, in pnv_php_match() argument
98 if (php_slot->dn == dn) { in pnv_php_match()
104 target = pnv_php_match(dn, tmp); in pnv_php_match()
112 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) in pnv_php_find_slot() argument
119 php_slot = pnv_php_match(dn, tmp); in pnv_php_find_slot()
135 static void pnv_php_rmv_pdns(struct device_node *dn) in pnv_php_rmv_pdns() argument
139 for_each_child_of_node(dn, child) { in pnv_php_rmv_pdns()
159 struct device_node *dn; in pnv_php_detach_device_nodes() local
161 for_each_child_of_node(parent, dn) { in pnv_php_detach_device_nodes()
162 pnv_php_detach_device_nodes(dn); in pnv_php_detach_device_nodes()
164 of_node_put(dn); in pnv_php_detach_device_nodes()
165 of_detach_node(dn); in pnv_php_detach_device_nodes()
171 pnv_php_rmv_pdns(php_slot->dn); in pnv_php_rmv_devtree()
179 pnv_php_detach_device_nodes(php_slot->dn); in pnv_php_rmv_devtree()
185 php_slot->dn->child = NULL; in pnv_php_rmv_devtree()
216 struct device_node *dn) in pnv_php_populate_changeset() argument
221 for_each_child_of_node(dn, child) { in pnv_php_populate_changeset()
238 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data) in pnv_php_add_one_pdn() argument
243 pdn = pci_add_device_node_info(hose, dn); in pnv_php_add_one_pdn()
254 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose); in pnv_php_add_pdns()
272 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000); in pnv_php_add_devtree()
285 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); in pnv_php_add_devtree()
294 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
295 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn); in pnv_php_add_devtree()
297 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
303 php_slot->dn->child = NULL; in pnv_php_add_devtree()
321 php_slot->dn->child = NULL; in pnv_php_add_devtree()
344 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle || in pnv_php_set_slot_power_state()
619 pnv_php_register(php_slot->dn); in pnv_php_enable()
669 ret = of_property_read_u32(php_slot->dn, "ibm,slot-surprise-pluggable", in pnv_php_enable_slot()
742 pnv_php_unregister(php_slot->dn); in pnv_php_disable_slot()
775 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) in pnv_php_alloc_slot() argument
783 ret = of_property_read_string(dn, "ibm,slot-label", &label); in pnv_php_alloc_slot()
787 if (pnv_pci_get_slot_id(dn, &id)) in pnv_php_alloc_slot()
790 bus = pci_find_bus_by_node(dn); in pnv_php_alloc_slot()
813 if (dn->child && PCI_DN(dn->child)) in pnv_php_alloc_slot()
814 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn); in pnv_php_alloc_slot()
820 php_slot->dn = dn; in pnv_php_alloc_slot()
836 struct device_node *dn = php_slot->dn; in pnv_php_register_slot() local
841 parent = pnv_php_find_slot(php_slot->dn); in pnv_php_register_slot()
856 while ((dn = of_get_parent(dn))) { in pnv_php_register_slot()
857 if (!PCI_DN(dn)) { in pnv_php_register_slot()
858 of_node_put(dn); in pnv_php_register_slot()
862 parent = pnv_php_find_slot(dn); in pnv_php_register_slot()
864 of_node_put(dn); in pnv_php_register_slot()
868 of_node_put(dn); in pnv_php_register_slot()
1057 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc", in pnv_php_init_irq()
1135 static int pnv_php_register_one(struct device_node *dn) in pnv_php_register_one() argument
1142 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32); in pnv_php_register_one()
1146 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32); in pnv_php_register_one()
1150 php_slot = pnv_php_alloc_slot(dn); in pnv_php_register_one()
1163 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32); in pnv_php_register_one()
1170 pnv_php_unregister_one(php_slot->dn); in pnv_php_register_one()
1176 static void pnv_php_register(struct device_node *dn) in pnv_php_register() argument
1184 for_each_child_of_node(dn, child) { in pnv_php_register()
1190 static void pnv_php_unregister_one(struct device_node *dn) in pnv_php_unregister_one() argument
1194 php_slot = pnv_php_find_slot(dn); in pnv_php_unregister_one()
1204 static void pnv_php_unregister(struct device_node *dn) in pnv_php_unregister() argument
1209 for_each_child_of_node(dn, child) { in pnv_php_unregister()
1217 struct device_node *dn; in pnv_php_init() local
1220 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_init()
1221 pnv_php_register(dn); in pnv_php_init()
1223 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_init()
1224 pnv_php_register(dn); in pnv_php_init()
1226 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_init()
1227 pnv_php_register_one(dn); /* slot directly under the PHB */ in pnv_php_init()
1233 struct device_node *dn; in pnv_php_exit() local
1235 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_exit()
1236 pnv_php_unregister(dn); in pnv_php_exit()
1238 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb") in pnv_php_exit()
1239 pnv_php_unregister(dn); in pnv_php_exit()
1241 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb") in pnv_php_exit()
1242 pnv_php_unregister_one(dn); /* slot directly under the PHB */ in pnv_php_exit()