Lines Matching refs:dev

117 static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)  in of_pci_parse_addrs()  argument
151 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2]; in of_pci_parse_addrs()
152 } else if (i == dev->rom_base_reg) { in of_pci_parse_addrs()
153 res = &dev->resource[PCI_ROM_RESOURCE]; in of_pci_parse_addrs()
162 res->name = pci_name(dev); in of_pci_parse_addrs()
165 pcibios_bus_to_resource(dev->bus, res, &region); in of_pci_parse_addrs()
178 struct pci_dev *dev; in of_create_pci_dev() local
180 dev = pci_alloc_dev(bus); in of_create_pci_dev()
181 if (!dev) in of_create_pci_dev()
187 dev->dev.of_node = of_node_get(node); in of_create_pci_dev()
188 dev->dev.parent = bus->bridge; in of_create_pci_dev()
189 dev->dev.bus = &pci_bus_type; in of_create_pci_dev()
190 dev->devfn = devfn; in of_create_pci_dev()
191 dev->multifunction = 0; /* maybe a lie? */ in of_create_pci_dev()
192 dev->needs_freset = 0; /* pcie fundamental reset required */ in of_create_pci_dev()
193 set_pcie_port_type(dev); in of_create_pci_dev()
195 pci_dev_assign_slot(dev); in of_create_pci_dev()
196 dev->vendor = get_int_prop(node, "vendor-id", 0xffff); in of_create_pci_dev()
197 dev->device = get_int_prop(node, "device-id", 0xffff); in of_create_pci_dev()
198 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0); in of_create_pci_dev()
199 dev->subsystem_device = get_int_prop(node, "subsystem-id", 0); in of_create_pci_dev()
201 dev->cfg_size = pci_cfg_space_size(dev); in of_create_pci_dev()
203 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus), in of_create_pci_dev()
204 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); in of_create_pci_dev()
205 dev->class = get_int_prop(node, "class-code", 0); in of_create_pci_dev()
206 dev->revision = get_int_prop(node, "revision-id", 0); in of_create_pci_dev()
208 pr_debug(" class: 0x%x\n", dev->class); in of_create_pci_dev()
209 pr_debug(" revision: 0x%x\n", dev->revision); in of_create_pci_dev()
211 dev->current_state = PCI_UNKNOWN; /* unknown power state */ in of_create_pci_dev()
212 dev->error_state = pci_channel_io_normal; in of_create_pci_dev()
213 dev->dma_mask = 0xffffffff; in of_create_pci_dev()
216 pci_fixup_device(pci_fixup_early, dev); in of_create_pci_dev()
220 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; in of_create_pci_dev()
221 dev->rom_base_reg = PCI_ROM_ADDRESS1; in of_create_pci_dev()
222 set_pcie_hotplug_bridge(dev); in of_create_pci_dev()
224 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; in of_create_pci_dev()
226 dev->hdr_type = PCI_HEADER_TYPE_NORMAL; in of_create_pci_dev()
227 dev->rom_base_reg = PCI_ROM_ADDRESS; in of_create_pci_dev()
229 dev->irq = 0; in of_create_pci_dev()
232 of_pci_parse_addrs(node, dev); in of_create_pci_dev()
236 pci_device_add(dev, bus); in of_create_pci_dev()
238 return dev; in of_create_pci_dev()
250 void of_scan_pci_bridge(struct pci_dev *dev) in of_scan_pci_bridge() argument
252 struct device_node *node = dev->dev.of_node; in of_scan_pci_bridge()
278 bus = pci_find_bus(pci_domain_nr(dev->bus), in of_scan_pci_bridge()
281 bus = pci_add_new_bus(dev->bus, dev, in of_scan_pci_bridge()
290 bus->primary = dev->bus->number; in of_scan_pci_bridge()
297 res = &dev->resource[PCI_BRIDGE_RESOURCES]; in of_scan_pci_bridge()
328 pcibios_bus_to_resource(dev->bus, res, &region); in of_scan_pci_bridge()
351 struct pci_dev *dev = NULL; in of_scan_pci_dev() local
368 dev = pci_get_slot(bus, devfn); in of_scan_pci_dev()
369 if (dev) { in of_scan_pci_dev()
370 pci_dev_put(dev); in of_scan_pci_dev()
371 return dev; in of_scan_pci_dev()
381 dev = of_create_pci_dev(dn, bus, devfn); in of_scan_pci_dev()
382 if (!dev) in of_scan_pci_dev()
385 pr_debug(" dev header type: %x\n", dev->hdr_type); in of_scan_pci_dev()
386 return dev; in of_scan_pci_dev()
399 struct pci_dev *dev; in __of_scan_bus() local
406 dev = of_scan_pci_dev(bus, child); in __of_scan_bus()
407 if (!dev) in __of_scan_bus()
409 pr_debug(" dev header type: %x\n", dev->hdr_type); in __of_scan_bus()
419 for_each_pci_bridge(dev, bus) in __of_scan_bus()
420 of_scan_pci_bridge(dev); in __of_scan_bus()