Lines Matching refs:core

36 	struct bcma_device *core = container_of(dev, struct bcma_device, dev);  in manuf_show()  local
37 return sprintf(buf, "0x%03X\n", core->id.manuf); in manuf_show()
43 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in id_show() local
44 return sprintf(buf, "0x%03X\n", core->id.id); in id_show()
50 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in rev_show() local
51 return sprintf(buf, "0x%02X\n", core->id.rev); in rev_show()
57 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in class_show() local
58 return sprintf(buf, "0x%X\n", core->id.class); in class_show()
90 struct bcma_device *core; in bcma_find_core_unit() local
92 list_for_each_entry(core, &bus->cores, list) { in bcma_find_core_unit()
93 if (core->id.id == coreid && core->core_unit == unit) in bcma_find_core_unit()
94 return core; in bcma_find_core_unit()
100 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, in bcma_wait_value() argument
107 val = bcma_read32(core, reg); in bcma_wait_value()
114 bcma_warn(core->bus, "Timeout waiting for register 0x%04X!\n", reg); in bcma_wait_value()
121 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_release_core_dev() local
122 if (core->io_addr) in bcma_release_core_dev()
123 iounmap(core->io_addr); in bcma_release_core_dev()
124 if (core->io_wrap) in bcma_release_core_dev()
125 iounmap(core->io_wrap); in bcma_release_core_dev()
126 kfree(core); in bcma_release_core_dev()
141 struct bcma_device *core) in bcma_of_find_child_device() argument
154 if (res.start == 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()
211 of_dma_configure(&core->dev, node, false); in bcma_of_fill_device()
214 unsigned int bcma_core_irq(struct bcma_device *core, int num) in bcma_core_irq() argument
216 struct bcma_bus *bus = core->bus; in bcma_core_irq()
223 if (bus->drv_mips.core && num == 0) { in bcma_core_irq()
224 mips_irq = bcma_core_mips_irq(core); in bcma_core_irq()
228 return bcma_of_get_irq(bus->dev, core, num); in bcma_core_irq()
238 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_prepare_core() argument
240 device_initialize(&core->dev); in bcma_prepare_core()
241 core->dev.release = bcma_release_core_dev; in bcma_prepare_core()
242 core->dev.bus = &bcma_bus_type; in bcma_prepare_core()
243 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); in bcma_prepare_core()
244 core->dev.parent = bus->dev; in bcma_prepare_core()
246 bcma_of_fill_device(bus->dev, core); in bcma_prepare_core()
250 core->dma_dev = bus->dev; in bcma_prepare_core()
251 core->irq = bus->host_pci->irq; in bcma_prepare_core()
255 core->dma_dev = bus->dev; in bcma_prepare_core()
257 core->dev.dma_mask = &core->dev.coherent_dma_mask; in bcma_prepare_core()
258 core->dma_dev = &core->dev; in bcma_prepare_core()
278 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_register_core() argument
282 err = device_add(&core->dev); in bcma_register_core()
285 core->id.id); in bcma_register_core()
288 core->dev_registered = true; in bcma_register_core()
293 struct bcma_device *core; in bcma_register_devices() local
296 list_for_each_entry(core, &bus->cores, list) { in bcma_register_devices()
298 switch (core->id.id) { in bcma_register_devices()
311 if (bcma_is_core_needed_early(core->id.id)) in bcma_register_devices()
315 if (core->id.id == BCMA_CORE_4706_MAC_GBIT && in bcma_register_devices()
316 core->core_unit > 0) in bcma_register_devices()
319 bcma_register_core(bus, core); in bcma_register_devices()
364 struct bcma_device *core, *tmp; in bcma_unregister_cores() local
366 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
367 if (!core->dev_registered) in bcma_unregister_cores()
369 list_del(&core->list); in bcma_unregister_cores()
370 device_unregister(&core->dev); in bcma_unregister_cores()
376 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
377 list_del(&core->list); in bcma_unregister_cores()
378 put_device(&core->dev); in bcma_unregister_cores()
385 struct bcma_device *core; in bcma_bus_register() local
395 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
396 if (core) { in bcma_bus_register()
397 bus->drv_cc.core = core; in bcma_bus_register()
402 core = bcma_find_core(bus, BCMA_CORE_PCIE); in bcma_bus_register()
403 if (core) { in bcma_bus_register()
404 bus->drv_pci[0].core = core; in bcma_bus_register()
412 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_register()
413 if (bcma_is_core_needed_early(core->id.id)) in bcma_bus_register()
414 bcma_register_core(bus, core); in bcma_bus_register()
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_NS_CHIPCOMMON_B); in bcma_bus_register()
433 if (core) { in bcma_bus_register()
434 bus->drv_cc_b.core = core; in bcma_bus_register()
439 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_register()
440 if (core) { in bcma_bus_register()
441 bus->drv_mips.core = core; in bcma_bus_register()
446 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); in bcma_bus_register()
447 if (core) { in bcma_bus_register()
448 bus->drv_pci[0].core = core; in bcma_bus_register()
453 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); in bcma_bus_register()
454 if (core) { in bcma_bus_register()
455 bus->drv_pci[1].core = core; in bcma_bus_register()
460 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE2, 0); in bcma_bus_register()
461 if (core) { in bcma_bus_register()
462 bus->drv_pcie2.core = core; in bcma_bus_register()
467 core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); in bcma_bus_register()
468 if (core) { in bcma_bus_register()
469 bus->drv_gmac_cmn.core = core; in bcma_bus_register()
504 struct bcma_device *core; in bcma_bus_early_register() local
514 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_early_register()
515 if (core) { in bcma_bus_early_register()
516 bus->drv_cc.core = core; in bcma_bus_early_register()
521 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_early_register()
522 if (core) { in bcma_bus_early_register()
523 bus->drv_mips.core = core; in bcma_bus_early_register()
535 struct bcma_device *core; in bcma_bus_suspend() local
537 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_suspend()
538 struct device_driver *drv = core->dev.driver; in bcma_bus_suspend()
542 adrv->suspend(core); in bcma_bus_suspend()
550 struct bcma_device *core; in bcma_bus_resume() local
553 if (bus->drv_cc.core) { in bcma_bus_resume()
558 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_resume()
559 struct device_driver *drv = core->dev.driver; in bcma_bus_resume()
563 adrv->resume(core); in bcma_bus_resume()
589 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_bus_match() local
591 const struct bcma_device_id *cid = &core->id; in bcma_bus_match()
606 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()
622 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_remove() local
627 adrv->remove(core); in bcma_device_remove()
633 const struct bcma_device *core = container_of_const(dev, struct bcma_device, dev); in bcma_device_uevent() local
637 core->id.manuf, core->id.id, in bcma_device_uevent()
638 core->id.rev, core->id.class); in bcma_device_uevent()