Lines Matching refs:mc_dev
82 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_bus_match() local
93 if ((mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED) == 0 && in fsl_mc_bus_match()
94 !fsl_mc_is_root_dprc(&mc_dev->dev)) in fsl_mc_bus_match()
102 if (id->vendor == mc_dev->obj_desc.vendor && in fsl_mc_bus_match()
103 strcmp(id->obj_type, mc_dev->obj_desc.type) == 0) { in fsl_mc_bus_match()
120 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_bus_uevent() local
123 mc_dev->obj_desc.vendor, in fsl_mc_bus_uevent()
124 mc_dev->obj_desc.type)) in fsl_mc_bus_uevent()
143 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in modalias_show() local
145 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
146 mc_dev->obj_desc.type); in modalias_show()
236 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_probe() local
241 error = mc_drv->probe(mc_dev); in fsl_mc_driver_probe()
254 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_remove() local
257 error = mc_drv->remove(mc_dev); in fsl_mc_driver_remove()
269 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_shutdown() local
271 mc_drv->shutdown(mc_dev); in fsl_mc_driver_shutdown()
413 static int translate_mc_addr(struct fsl_mc_device *mc_dev, in translate_mc_addr() argument
421 fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev); in translate_mc_addr()
448 static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, in fsl_mc_device_get_mmio_regions() argument
454 struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc; in fsl_mc_device_get_mmio_regions()
455 struct device *parent_dev = mc_dev->dev.parent; in fsl_mc_device_get_mmio_regions()
458 if (is_fsl_mc_bus_dprc(mc_dev) || in fsl_mc_device_get_mmio_regions()
459 is_fsl_mc_bus_dpmcp(mc_dev)) { in fsl_mc_device_get_mmio_regions()
461 } else if (is_fsl_mc_bus_dpio(mc_dev)) { in fsl_mc_device_get_mmio_regions()
499 error = translate_mc_addr(mc_dev, mc_region_type, in fsl_mc_device_get_mmio_regions()
520 mc_dev->regions = regions; in fsl_mc_device_get_mmio_regions()
543 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_device_release() local
545 kfree(mc_dev->regions); in fsl_mc_device_release()
547 if (is_fsl_mc_bus_dprc(mc_dev)) in fsl_mc_device_release()
548 kfree(to_fsl_mc_bus(mc_dev)); in fsl_mc_device_release()
550 kfree(mc_dev); in fsl_mc_device_release()
562 struct fsl_mc_device *mc_dev = NULL; in fsl_mc_device_add() local
579 mc_dev = &mc_bus->mc_dev; in fsl_mc_device_add()
584 mc_dev = kzalloc(sizeof(*mc_dev), GFP_KERNEL); in fsl_mc_device_add()
585 if (!mc_dev) in fsl_mc_device_add()
589 mc_dev->obj_desc = *obj_desc; in fsl_mc_device_add()
590 mc_dev->mc_io = mc_io; in fsl_mc_device_add()
591 device_initialize(&mc_dev->dev); in fsl_mc_device_add()
592 mc_dev->dev.parent = parent_dev; in fsl_mc_device_add()
593 mc_dev->dev.bus = &fsl_mc_bus_type; in fsl_mc_device_add()
594 mc_dev->dev.release = fsl_mc_device_release; in fsl_mc_device_add()
595 mc_dev->dev.type = fsl_mc_get_device_type(obj_desc->type); in fsl_mc_device_add()
596 if (!mc_dev->dev.type) { in fsl_mc_device_add()
601 dev_set_name(&mc_dev->dev, "%s.%d", obj_desc->type, obj_desc->id); in fsl_mc_device_add()
606 mc_dev->flags |= FSL_MC_IS_DPRC; in fsl_mc_device_add()
635 error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid); in fsl_mc_device_add()
643 mc_dev->icid = parent_mc_dev->icid; in fsl_mc_device_add()
644 mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK; in fsl_mc_device_add()
645 mc_dev->dev.dma_mask = &mc_dev->dma_mask; in fsl_mc_device_add()
646 mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask; in fsl_mc_device_add()
647 dev_set_msi_domain(&mc_dev->dev, in fsl_mc_device_add()
658 error = fsl_mc_device_get_mmio_regions(mc_dev, in fsl_mc_device_add()
667 error = device_add(&mc_dev->dev); in fsl_mc_device_add()
671 dev_name(&mc_dev->dev), error); in fsl_mc_device_add()
675 dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev)); in fsl_mc_device_add()
677 *new_mc_dev = mc_dev; in fsl_mc_device_add()
681 kfree(mc_dev->regions); in fsl_mc_device_add()
683 kfree(mc_dev); in fsl_mc_device_add()
695 void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) in fsl_mc_device_remove() argument
700 device_del(&mc_dev->dev); in fsl_mc_device_remove()
701 put_device(&mc_dev->dev); in fsl_mc_device_remove()