Lines Matching refs:core
35 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in manuf_show() local
36 return sprintf(buf, "0x%03X\n", core->id.manuf); in manuf_show()
42 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in id_show() local
43 return sprintf(buf, "0x%03X\n", core->id.id); in id_show()
49 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in rev_show() local
50 return sprintf(buf, "0x%02X\n", core->id.rev); in rev_show()
56 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in class_show() local
57 return sprintf(buf, "0x%X\n", core->id.class); in class_show()
89 struct bcma_device *core; in bcma_find_core_unit() local
91 list_for_each_entry(core, &bus->cores, list) { in bcma_find_core_unit()
92 if (core->id.id == coreid && core->core_unit == unit) in bcma_find_core_unit()
93 return core; in bcma_find_core_unit()
99 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, in bcma_wait_value() argument
106 val = bcma_read32(core, reg); in bcma_wait_value()
113 bcma_warn(core->bus, "Timeout waiting for register 0x%04X!\n", reg); in bcma_wait_value()
120 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_release_core_dev() local
121 if (core->io_addr) in bcma_release_core_dev()
122 iounmap(core->io_addr); in bcma_release_core_dev()
123 if (core->io_wrap) in bcma_release_core_dev()
124 iounmap(core->io_wrap); in bcma_release_core_dev()
125 kfree(core); in bcma_release_core_dev()
141 struct bcma_device *core) in bcma_of_find_child_device() argument
154 if (of_translate_address(node, reg) == core->addr) in bcma_of_find_child_device()
161 struct bcma_device *core, in bcma_of_irq_parse() argument
167 if (core->dev.of_node) { in bcma_of_irq_parse()
168 rc = of_irq_parse_one(core->dev.of_node, num, out_irq); in bcma_of_irq_parse()
177 laddr[0] = cpu_to_be32(core->addr); in bcma_of_irq_parse()
182 struct bcma_device *core, int num) in bcma_of_get_irq() argument
190 ret = bcma_of_irq_parse(parent, core, &out_irq, num); in bcma_of_get_irq()
192 bcma_debug(core->bus, "bcma_of_get_irq() failed with rc=%d\n", in bcma_of_get_irq()
201 struct bcma_device *core) in bcma_of_fill_device() argument
205 node = bcma_of_find_child_device(parent, core); in bcma_of_fill_device()
207 core->dev.of_node = node; in bcma_of_fill_device()
209 core->irq = bcma_of_get_irq(parent, core, 0); in bcma_of_fill_device()
213 struct bcma_device *core) in bcma_of_fill_device() argument
217 struct bcma_device *core, int num) in bcma_of_get_irq() argument
223 unsigned int bcma_core_irq(struct bcma_device *core, int num) in bcma_core_irq() argument
225 struct bcma_bus *bus = core->bus; in bcma_core_irq()
232 if (bus->drv_mips.core && num == 0) { in bcma_core_irq()
233 mips_irq = bcma_core_mips_irq(core); in bcma_core_irq()
237 return bcma_of_get_irq(bus->host_pdev, core, num); in bcma_core_irq()
247 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_prepare_core() argument
249 core->dev.release = bcma_release_core_dev; in bcma_prepare_core()
250 core->dev.bus = &bcma_bus_type; in bcma_prepare_core()
251 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); in bcma_prepare_core()
255 core->dev.parent = &bus->host_pci->dev; in bcma_prepare_core()
256 core->dma_dev = &bus->host_pci->dev; in bcma_prepare_core()
257 core->irq = bus->host_pci->irq; in bcma_prepare_core()
260 core->dev.dma_mask = &core->dev.coherent_dma_mask; in bcma_prepare_core()
262 core->dma_dev = &bus->host_pdev->dev; in bcma_prepare_core()
263 core->dev.parent = &bus->host_pdev->dev; in bcma_prepare_core()
264 bcma_of_fill_device(bus->host_pdev, core); in bcma_prepare_core()
266 core->dma_dev = &core->dev; in bcma_prepare_core()
308 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_register_core() argument
312 err = device_register(&core->dev); in bcma_register_core()
315 core->id.id); in bcma_register_core()
316 put_device(&core->dev); in bcma_register_core()
319 core->dev_registered = true; in bcma_register_core()
324 struct bcma_device *core; in bcma_register_devices() local
327 list_for_each_entry(core, &bus->cores, list) { in bcma_register_devices()
329 switch (core->id.id) { in bcma_register_devices()
342 if (bcma_is_core_needed_early(core->id.id)) in bcma_register_devices()
346 if (core->id.id == BCMA_CORE_4706_MAC_GBIT && in bcma_register_devices()
347 core->core_unit > 0) in bcma_register_devices()
350 bcma_register_core(bus, core); in bcma_register_devices()
393 struct bcma_device *core, *tmp; in bcma_unregister_cores() local
395 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
396 if (!core->dev_registered) in bcma_unregister_cores()
398 list_del(&core->list); in bcma_unregister_cores()
399 device_unregister(&core->dev); in bcma_unregister_cores()
405 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
406 list_del(&core->list); in bcma_unregister_cores()
407 kfree(core); in bcma_unregister_cores()
414 struct bcma_device *core; in bcma_bus_register() local
425 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
426 if (core) { in bcma_bus_register()
427 bus->drv_cc.core = core; in bcma_bus_register()
432 core = bcma_find_core(bus, BCMA_CORE_PCIE); in bcma_bus_register()
433 if (core) { in bcma_bus_register()
434 bus->drv_pci[0].core = core; in bcma_bus_register()
444 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_register()
445 if (bcma_is_core_needed_early(core->id.id)) in bcma_bus_register()
446 bcma_register_core(bus, core); in bcma_bus_register()
457 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
458 if (core) { in bcma_bus_register()
459 bus->drv_cc.core = core; in bcma_bus_register()
464 core = bcma_find_core(bus, BCMA_CORE_NS_CHIPCOMMON_B); in bcma_bus_register()
465 if (core) { in bcma_bus_register()
466 bus->drv_cc_b.core = core; in bcma_bus_register()
471 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_register()
472 if (core) { in bcma_bus_register()
473 bus->drv_mips.core = core; in bcma_bus_register()
478 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); in bcma_bus_register()
479 if (core) { in bcma_bus_register()
480 bus->drv_pci[0].core = core; in bcma_bus_register()
485 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); in bcma_bus_register()
486 if (core) { in bcma_bus_register()
487 bus->drv_pci[1].core = core; in bcma_bus_register()
492 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE2, 0); in bcma_bus_register()
493 if (core) { in bcma_bus_register()
494 bus->drv_pcie2.core = core; in bcma_bus_register()
499 core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); in bcma_bus_register()
500 if (core) { in bcma_bus_register()
501 bus->drv_gmac_cmn.core = core; in bcma_bus_register()
536 struct bcma_device *core; in bcma_bus_early_register() local
546 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_early_register()
547 if (core) { in bcma_bus_early_register()
548 bus->drv_cc.core = core; in bcma_bus_early_register()
553 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_early_register()
554 if (core) { in bcma_bus_early_register()
555 bus->drv_mips.core = core; in bcma_bus_early_register()
567 struct bcma_device *core; in bcma_bus_suspend() local
569 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_suspend()
570 struct device_driver *drv = core->dev.driver; in bcma_bus_suspend()
574 adrv->suspend(core); in bcma_bus_suspend()
582 struct bcma_device *core; in bcma_bus_resume() local
585 if (bus->drv_cc.core) { in bcma_bus_resume()
590 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_resume()
591 struct device_driver *drv = core->dev.driver; in bcma_bus_resume()
595 adrv->resume(core); in bcma_bus_resume()
621 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_bus_match() local
623 const struct bcma_device_id *cid = &core->id; in bcma_bus_match()
638 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_probe() local
644 err = adrv->probe(core); in bcma_device_probe()
651 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_remove() local
656 adrv->remove(core); in bcma_device_remove()
663 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_uevent() local
667 core->id.manuf, core->id.id, in bcma_device_uevent()
668 core->id.rev, core->id.class); in bcma_device_uevent()