Lines Matching refs:core
32 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in manuf_show() local
33 return sprintf(buf, "0x%03X\n", core->id.manuf); in manuf_show()
39 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in id_show() local
40 return sprintf(buf, "0x%03X\n", core->id.id); in id_show()
46 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in rev_show() local
47 return sprintf(buf, "0x%02X\n", core->id.rev); in rev_show()
53 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in class_show() local
54 return sprintf(buf, "0x%X\n", core->id.class); in class_show()
86 struct bcma_device *core; in bcma_find_core_unit() local
88 list_for_each_entry(core, &bus->cores, list) { in bcma_find_core_unit()
89 if (core->id.id == coreid && core->core_unit == unit) in bcma_find_core_unit()
90 return core; in bcma_find_core_unit()
96 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, in bcma_wait_value() argument
103 val = bcma_read32(core, reg); in bcma_wait_value()
110 bcma_warn(core->bus, "Timeout waiting for register 0x%04X!\n", reg); in bcma_wait_value()
117 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_release_core_dev() local
118 if (core->io_addr) in bcma_release_core_dev()
119 iounmap(core->io_addr); in bcma_release_core_dev()
120 if (core->io_wrap) in bcma_release_core_dev()
121 iounmap(core->io_wrap); in bcma_release_core_dev()
122 kfree(core); in bcma_release_core_dev()
138 struct bcma_device *core) in bcma_of_find_child_device() argument
151 if (of_translate_address(node, reg) == core->addr) in bcma_of_find_child_device()
158 struct bcma_device *core, in bcma_of_irq_parse() argument
164 if (core->dev.of_node) { in bcma_of_irq_parse()
165 rc = of_irq_parse_one(core->dev.of_node, num, out_irq); in bcma_of_irq_parse()
174 laddr[0] = cpu_to_be32(core->addr); in bcma_of_irq_parse()
179 struct bcma_device *core, int num) in bcma_of_get_irq() argument
187 ret = bcma_of_irq_parse(parent, core, &out_irq, num); in bcma_of_get_irq()
189 bcma_debug(core->bus, "bcma_of_get_irq() failed with rc=%d\n", in bcma_of_get_irq()
198 struct bcma_device *core) in bcma_of_fill_device() argument
202 node = bcma_of_find_child_device(parent, core); in bcma_of_fill_device()
204 core->dev.of_node = node; in bcma_of_fill_device()
206 core->irq = bcma_of_get_irq(parent, core, 0); in bcma_of_fill_device()
210 struct bcma_device *core) in bcma_of_fill_device() argument
214 struct bcma_device *core, int num) in bcma_of_get_irq() argument
220 unsigned int bcma_core_irq(struct bcma_device *core, int num) in bcma_core_irq() argument
222 struct bcma_bus *bus = core->bus; in bcma_core_irq()
229 if (bus->drv_mips.core && num == 0) { in bcma_core_irq()
230 mips_irq = bcma_core_mips_irq(core); in bcma_core_irq()
234 return bcma_of_get_irq(bus->host_pdev, core, num); in bcma_core_irq()
244 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_prepare_core() argument
246 core->dev.release = bcma_release_core_dev; in bcma_prepare_core()
247 core->dev.bus = &bcma_bus_type; in bcma_prepare_core()
248 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); in bcma_prepare_core()
252 core->dev.parent = &bus->host_pci->dev; in bcma_prepare_core()
253 core->dma_dev = &bus->host_pci->dev; in bcma_prepare_core()
254 core->irq = bus->host_pci->irq; in bcma_prepare_core()
257 core->dev.dma_mask = &core->dev.coherent_dma_mask; in bcma_prepare_core()
259 core->dma_dev = &bus->host_pdev->dev; in bcma_prepare_core()
260 core->dev.parent = &bus->host_pdev->dev; in bcma_prepare_core()
261 bcma_of_fill_device(bus->host_pdev, core); in bcma_prepare_core()
263 core->dma_dev = &core->dev; in bcma_prepare_core()
283 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_register_core() argument
287 err = device_register(&core->dev); in bcma_register_core()
290 core->id.id); in bcma_register_core()
291 put_device(&core->dev); in bcma_register_core()
294 core->dev_registered = true; in bcma_register_core()
299 struct bcma_device *core; in bcma_register_devices() local
302 list_for_each_entry(core, &bus->cores, list) { in bcma_register_devices()
304 switch (core->id.id) { in bcma_register_devices()
317 if (bcma_is_core_needed_early(core->id.id)) in bcma_register_devices()
321 if (core->id.id == BCMA_CORE_4706_MAC_GBIT && in bcma_register_devices()
322 core->core_unit > 0) in bcma_register_devices()
325 bcma_register_core(bus, core); in bcma_register_devices()
368 struct bcma_device *core, *tmp; in bcma_unregister_cores() local
370 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
371 if (!core->dev_registered) in bcma_unregister_cores()
373 list_del(&core->list); in bcma_unregister_cores()
374 device_unregister(&core->dev); in bcma_unregister_cores()
380 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
381 list_del(&core->list); in bcma_unregister_cores()
382 kfree(core); in bcma_unregister_cores()
389 struct bcma_device *core; in bcma_bus_register() local
399 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
400 if (core) { in bcma_bus_register()
401 bus->drv_cc.core = core; in bcma_bus_register()
406 core = bcma_find_core(bus, BCMA_CORE_PCIE); in bcma_bus_register()
407 if (core) { in bcma_bus_register()
408 bus->drv_pci[0].core = core; in bcma_bus_register()
413 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_register()
414 if (bcma_is_core_needed_early(core->id.id)) in bcma_bus_register()
415 bcma_register_core(bus, core); in bcma_bus_register()
426 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
427 if (core) { in bcma_bus_register()
428 bus->drv_cc.core = core; in bcma_bus_register()
433 core = bcma_find_core(bus, BCMA_CORE_NS_CHIPCOMMON_B); in bcma_bus_register()
434 if (core) { in bcma_bus_register()
435 bus->drv_cc_b.core = core; in bcma_bus_register()
440 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_register()
441 if (core) { in bcma_bus_register()
442 bus->drv_mips.core = core; in bcma_bus_register()
447 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); in bcma_bus_register()
448 if (core) { in bcma_bus_register()
449 bus->drv_pci[0].core = core; in bcma_bus_register()
454 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); in bcma_bus_register()
455 if (core) { in bcma_bus_register()
456 bus->drv_pci[1].core = core; in bcma_bus_register()
461 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE2, 0); in bcma_bus_register()
462 if (core) { in bcma_bus_register()
463 bus->drv_pcie2.core = core; in bcma_bus_register()
468 core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); in bcma_bus_register()
469 if (core) { in bcma_bus_register()
470 bus->drv_gmac_cmn.core = core; in bcma_bus_register()
505 struct bcma_device *core; in bcma_bus_early_register() local
515 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_early_register()
516 if (core) { in bcma_bus_early_register()
517 bus->drv_cc.core = core; in bcma_bus_early_register()
522 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_early_register()
523 if (core) { in bcma_bus_early_register()
524 bus->drv_mips.core = core; in bcma_bus_early_register()
536 struct bcma_device *core; in bcma_bus_suspend() local
538 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_suspend()
539 struct device_driver *drv = core->dev.driver; in bcma_bus_suspend()
543 adrv->suspend(core); in bcma_bus_suspend()
551 struct bcma_device *core; in bcma_bus_resume() local
554 if (bus->drv_cc.core) { in bcma_bus_resume()
559 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_resume()
560 struct device_driver *drv = core->dev.driver; in bcma_bus_resume()
564 adrv->resume(core); in bcma_bus_resume()
590 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_bus_match() local
592 const struct bcma_device_id *cid = &core->id; in bcma_bus_match()
607 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_probe() local
613 err = adrv->probe(core); in bcma_device_probe()
620 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_remove() local
625 adrv->remove(core); in bcma_device_remove()
632 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_uevent() local
636 core->id.manuf, core->id.id, in bcma_device_uevent()
637 core->id.rev, core->id.class); in bcma_device_uevent()