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()
133 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in modalias_show() local
135 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
136 mc_dev->obj_desc.type); in modalias_show()
220 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_probe() local
225 error = mc_drv->probe(mc_dev); in fsl_mc_driver_probe()
238 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_remove() local
241 error = mc_drv->remove(mc_dev); in fsl_mc_driver_remove()
253 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_shutdown() local
255 mc_drv->shutdown(mc_dev); in fsl_mc_driver_shutdown()
397 static int translate_mc_addr(struct fsl_mc_device *mc_dev, in translate_mc_addr() argument
405 fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev); in translate_mc_addr()
432 static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, in fsl_mc_device_get_mmio_regions() argument
438 struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc; in fsl_mc_device_get_mmio_regions()
439 struct device *parent_dev = mc_dev->dev.parent; in fsl_mc_device_get_mmio_regions()
442 if (is_fsl_mc_bus_dprc(mc_dev) || in fsl_mc_device_get_mmio_regions()
443 is_fsl_mc_bus_dpmcp(mc_dev)) { in fsl_mc_device_get_mmio_regions()
445 } else if (is_fsl_mc_bus_dpio(mc_dev)) { in fsl_mc_device_get_mmio_regions()
475 error = translate_mc_addr(mc_dev, mc_region_type, in fsl_mc_device_get_mmio_regions()
493 mc_dev->regions = regions; in fsl_mc_device_get_mmio_regions()
516 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_device_release() local
518 kfree(mc_dev->regions); in fsl_mc_device_release()
520 if (is_fsl_mc_bus_dprc(mc_dev)) in fsl_mc_device_release()
521 kfree(to_fsl_mc_bus(mc_dev)); in fsl_mc_device_release()
523 kfree(mc_dev); in fsl_mc_device_release()
535 struct fsl_mc_device *mc_dev = NULL; in fsl_mc_device_add() local
552 mc_dev = &mc_bus->mc_dev; in fsl_mc_device_add()
557 mc_dev = kzalloc(sizeof(*mc_dev), GFP_KERNEL); in fsl_mc_device_add()
558 if (!mc_dev) in fsl_mc_device_add()
562 mc_dev->obj_desc = *obj_desc; in fsl_mc_device_add()
563 mc_dev->mc_io = mc_io; in fsl_mc_device_add()
564 device_initialize(&mc_dev->dev); in fsl_mc_device_add()
565 mc_dev->dev.parent = parent_dev; in fsl_mc_device_add()
566 mc_dev->dev.bus = &fsl_mc_bus_type; in fsl_mc_device_add()
567 mc_dev->dev.release = fsl_mc_device_release; in fsl_mc_device_add()
568 mc_dev->dev.type = fsl_mc_get_device_type(obj_desc->type); in fsl_mc_device_add()
569 if (!mc_dev->dev.type) { in fsl_mc_device_add()
574 dev_set_name(&mc_dev->dev, "%s.%d", obj_desc->type, obj_desc->id); in fsl_mc_device_add()
579 mc_dev->flags |= FSL_MC_IS_DPRC; in fsl_mc_device_add()
608 error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid); in fsl_mc_device_add()
616 mc_dev->icid = parent_mc_dev->icid; in fsl_mc_device_add()
617 mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK; in fsl_mc_device_add()
618 mc_dev->dev.dma_mask = &mc_dev->dma_mask; in fsl_mc_device_add()
619 dev_set_msi_domain(&mc_dev->dev, in fsl_mc_device_add()
630 error = fsl_mc_device_get_mmio_regions(mc_dev, in fsl_mc_device_add()
638 arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true); in fsl_mc_device_add()
643 error = device_add(&mc_dev->dev); in fsl_mc_device_add()
647 dev_name(&mc_dev->dev), error); in fsl_mc_device_add()
651 dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev)); in fsl_mc_device_add()
653 *new_mc_dev = mc_dev; in fsl_mc_device_add()
657 kfree(mc_dev->regions); in fsl_mc_device_add()
659 kfree(mc_dev); in fsl_mc_device_add()
671 void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) in fsl_mc_device_remove() argument
676 device_del(&mc_dev->dev); in fsl_mc_device_remove()
677 put_device(&mc_dev->dev); in fsl_mc_device_remove()