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()
140 struct bcma_device *core) in bcma_of_find_child_device() argument
153 if (of_translate_address(node, reg) == core->addr) in bcma_of_find_child_device()
160 struct bcma_device *core, in bcma_of_irq_parse() argument
166 if (core->dev.of_node) { in bcma_of_irq_parse()
167 rc = of_irq_parse_one(core->dev.of_node, num, out_irq); in bcma_of_irq_parse()
176 laddr[0] = cpu_to_be32(core->addr); in bcma_of_irq_parse()
181 struct bcma_device *core, int num) in bcma_of_get_irq() argument
189 ret = bcma_of_irq_parse(parent, core, &out_irq, num); in bcma_of_get_irq()
191 bcma_debug(core->bus, "bcma_of_get_irq() failed with rc=%d\n", in bcma_of_get_irq()
200 struct bcma_device *core) in bcma_of_fill_device() argument
204 node = bcma_of_find_child_device(parent, core); in bcma_of_fill_device()
206 core->dev.of_node = node; in bcma_of_fill_device()
208 core->irq = bcma_of_get_irq(parent, core, 0); in bcma_of_fill_device()
210 of_dma_configure(&core->dev, node, false); in bcma_of_fill_device()
213 unsigned int bcma_core_irq(struct bcma_device *core, int num) in bcma_core_irq() argument
215 struct bcma_bus *bus = core->bus; in bcma_core_irq()
222 if (bus->drv_mips.core && num == 0) { in bcma_core_irq()
223 mips_irq = bcma_core_mips_irq(core); in bcma_core_irq()
227 return bcma_of_get_irq(bus->dev, core, num); in bcma_core_irq()
237 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_prepare_core() argument
239 device_initialize(&core->dev); in bcma_prepare_core()
240 core->dev.release = bcma_release_core_dev; in bcma_prepare_core()
241 core->dev.bus = &bcma_bus_type; in bcma_prepare_core()
242 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); in bcma_prepare_core()
243 core->dev.parent = bus->dev; in bcma_prepare_core()
245 bcma_of_fill_device(bus->dev, core); in bcma_prepare_core()
249 core->dma_dev = bus->dev; in bcma_prepare_core()
250 core->irq = bus->host_pci->irq; in bcma_prepare_core()
254 core->dma_dev = bus->dev; in bcma_prepare_core()
256 core->dev.dma_mask = &core->dev.coherent_dma_mask; in bcma_prepare_core()
257 core->dma_dev = &core->dev; in bcma_prepare_core()
277 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_register_core() argument
281 err = device_add(&core->dev); in bcma_register_core()
284 core->id.id); in bcma_register_core()
287 core->dev_registered = true; in bcma_register_core()
292 struct bcma_device *core; in bcma_register_devices() local
295 list_for_each_entry(core, &bus->cores, list) { in bcma_register_devices()
297 switch (core->id.id) { in bcma_register_devices()
310 if (bcma_is_core_needed_early(core->id.id)) in bcma_register_devices()
314 if (core->id.id == BCMA_CORE_4706_MAC_GBIT && in bcma_register_devices()
315 core->core_unit > 0) in bcma_register_devices()
318 bcma_register_core(bus, core); in bcma_register_devices()
361 struct bcma_device *core, *tmp; in bcma_unregister_cores() local
363 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
364 if (!core->dev_registered) in bcma_unregister_cores()
366 list_del(&core->list); in bcma_unregister_cores()
367 device_unregister(&core->dev); in bcma_unregister_cores()
373 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
374 list_del(&core->list); in bcma_unregister_cores()
375 put_device(&core->dev); in bcma_unregister_cores()
382 struct bcma_device *core; in bcma_bus_register() local
392 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
393 if (core) { in bcma_bus_register()
394 bus->drv_cc.core = core; in bcma_bus_register()
399 core = bcma_find_core(bus, BCMA_CORE_PCIE); in bcma_bus_register()
400 if (core) { in bcma_bus_register()
401 bus->drv_pci[0].core = core; in bcma_bus_register()
409 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_register()
410 if (bcma_is_core_needed_early(core->id.id)) in bcma_bus_register()
411 bcma_register_core(bus, core); in bcma_bus_register()
422 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
423 if (core) { in bcma_bus_register()
424 bus->drv_cc.core = core; in bcma_bus_register()
429 core = bcma_find_core(bus, BCMA_CORE_NS_CHIPCOMMON_B); in bcma_bus_register()
430 if (core) { in bcma_bus_register()
431 bus->drv_cc_b.core = core; in bcma_bus_register()
436 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_register()
437 if (core) { in bcma_bus_register()
438 bus->drv_mips.core = core; in bcma_bus_register()
443 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); in bcma_bus_register()
444 if (core) { in bcma_bus_register()
445 bus->drv_pci[0].core = core; in bcma_bus_register()
450 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); in bcma_bus_register()
451 if (core) { in bcma_bus_register()
452 bus->drv_pci[1].core = core; in bcma_bus_register()
457 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE2, 0); in bcma_bus_register()
458 if (core) { in bcma_bus_register()
459 bus->drv_pcie2.core = core; in bcma_bus_register()
464 core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); in bcma_bus_register()
465 if (core) { in bcma_bus_register()
466 bus->drv_gmac_cmn.core = core; in bcma_bus_register()
501 struct bcma_device *core; in bcma_bus_early_register() local
511 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_early_register()
512 if (core) { in bcma_bus_early_register()
513 bus->drv_cc.core = core; in bcma_bus_early_register()
518 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_early_register()
519 if (core) { in bcma_bus_early_register()
520 bus->drv_mips.core = core; in bcma_bus_early_register()
532 struct bcma_device *core; in bcma_bus_suspend() local
534 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_suspend()
535 struct device_driver *drv = core->dev.driver; in bcma_bus_suspend()
539 adrv->suspend(core); in bcma_bus_suspend()
547 struct bcma_device *core; in bcma_bus_resume() local
550 if (bus->drv_cc.core) { in bcma_bus_resume()
555 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_resume()
556 struct device_driver *drv = core->dev.driver; in bcma_bus_resume()
560 adrv->resume(core); in bcma_bus_resume()
586 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_bus_match() local
588 const struct bcma_device_id *cid = &core->id; in bcma_bus_match()
603 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_probe() local
610 err = adrv->probe(core); in bcma_device_probe()
619 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_remove() local
624 adrv->remove(core); in bcma_device_remove()
630 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_uevent() local
634 core->id.manuf, core->id.id, in bcma_device_uevent()
635 core->id.rev, core->id.class); in bcma_device_uevent()