Lines Matching refs:mc_dev

86 	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);  in fsl_mc_bus_match()  local
91 if (mc_dev->driver_override) { in fsl_mc_bus_match()
92 found = !strcmp(mc_dev->driver_override, mc_drv->driver.name); in fsl_mc_bus_match()
103 if ((mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED) == 0 && in fsl_mc_bus_match()
104 !fsl_mc_is_root_dprc(&mc_dev->dev)) in fsl_mc_bus_match()
112 if (id->vendor == mc_dev->obj_desc.vendor && in fsl_mc_bus_match()
113 strcmp(id->obj_type, mc_dev->obj_desc.type) == 0) { in fsl_mc_bus_match()
130 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_bus_uevent() local
133 mc_dev->obj_desc.vendor, in fsl_mc_bus_uevent()
134 mc_dev->obj_desc.type)) in fsl_mc_bus_uevent()
143 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_dma_configure() local
145 u32 input_id = mc_dev->icid; in fsl_mc_dma_configure()
176 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in modalias_show() local
178 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
179 mc_dev->obj_desc.type); in modalias_show()
187 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in driver_override_store() local
193 ret = driver_set_override(dev, &mc_dev->driver_override, buf, count); in driver_override_store()
203 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in driver_override_show() local
205 return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override); in driver_override_show()
439 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_probe() local
444 error = mc_drv->probe(mc_dev); in fsl_mc_driver_probe()
457 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_remove() local
460 error = mc_drv->remove(mc_dev); in fsl_mc_driver_remove()
472 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_shutdown() local
474 mc_drv->shutdown(mc_dev); in fsl_mc_driver_shutdown()
630 static int translate_mc_addr(struct fsl_mc_device *mc_dev, in translate_mc_addr() argument
638 fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev); in translate_mc_addr()
665 static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, in fsl_mc_device_get_mmio_regions() argument
671 struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc; in fsl_mc_device_get_mmio_regions()
672 struct device *parent_dev = mc_dev->dev.parent; in fsl_mc_device_get_mmio_regions()
675 if (is_fsl_mc_bus_dprc(mc_dev) || in fsl_mc_device_get_mmio_regions()
676 is_fsl_mc_bus_dpmcp(mc_dev)) { in fsl_mc_device_get_mmio_regions()
678 } else if (is_fsl_mc_bus_dpio(mc_dev)) { in fsl_mc_device_get_mmio_regions()
716 error = translate_mc_addr(mc_dev, mc_region_type, in fsl_mc_device_get_mmio_regions()
731 if (is_fsl_mc_bus_dprc(mc_dev) && in fsl_mc_device_get_mmio_regions()
750 mc_dev->regions = regions; in fsl_mc_device_get_mmio_regions()
773 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_device_release() local
775 kfree(mc_dev->regions); in fsl_mc_device_release()
777 if (is_fsl_mc_bus_dprc(mc_dev)) in fsl_mc_device_release()
778 kfree(to_fsl_mc_bus(mc_dev)); in fsl_mc_device_release()
780 kfree(mc_dev); in fsl_mc_device_release()
792 struct fsl_mc_device *mc_dev = NULL; in fsl_mc_device_add() local
810 mc_dev = &mc_bus->mc_dev; in fsl_mc_device_add()
815 mc_dev = kzalloc(sizeof(*mc_dev), GFP_KERNEL); in fsl_mc_device_add()
816 if (!mc_dev) in fsl_mc_device_add()
820 mc_dev->obj_desc = *obj_desc; in fsl_mc_device_add()
821 mc_dev->mc_io = mc_io; in fsl_mc_device_add()
822 device_initialize(&mc_dev->dev); in fsl_mc_device_add()
823 mc_dev->dev.parent = parent_dev; in fsl_mc_device_add()
824 mc_dev->dev.bus = &fsl_mc_bus_type; in fsl_mc_device_add()
825 mc_dev->dev.release = fsl_mc_device_release; in fsl_mc_device_add()
826 mc_dev->dev.type = fsl_mc_get_device_type(obj_desc->type); in fsl_mc_device_add()
827 if (!mc_dev->dev.type) { in fsl_mc_device_add()
832 dev_set_name(&mc_dev->dev, "%s.%d", obj_desc->type, obj_desc->id); in fsl_mc_device_add()
837 mc_dev->flags |= FSL_MC_IS_DPRC; in fsl_mc_device_add()
866 error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid); in fsl_mc_device_add()
874 mc_dev->icid = parent_mc_dev->icid; in fsl_mc_device_add()
875 mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK; in fsl_mc_device_add()
876 mc_dev->dev.dma_mask = &mc_dev->dma_mask; in fsl_mc_device_add()
877 mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask; in fsl_mc_device_add()
878 dev_set_msi_domain(&mc_dev->dev, in fsl_mc_device_add()
889 error = fsl_mc_device_get_mmio_regions(mc_dev, in fsl_mc_device_add()
898 error = device_add(&mc_dev->dev); in fsl_mc_device_add()
902 dev_name(&mc_dev->dev), error); in fsl_mc_device_add()
906 dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev)); in fsl_mc_device_add()
908 *new_mc_dev = mc_dev; in fsl_mc_device_add()
912 kfree(mc_dev->regions); in fsl_mc_device_add()
914 kfree(mc_dev); in fsl_mc_device_add()
928 void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) in fsl_mc_device_remove() argument
930 kfree(mc_dev->driver_override); in fsl_mc_device_remove()
931 mc_dev->driver_override = NULL; in fsl_mc_device_remove()
936 device_del(&mc_dev->dev); in fsl_mc_device_remove()
937 put_device(&mc_dev->dev); in fsl_mc_device_remove()
941 struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev, in fsl_mc_get_endpoint() argument
950 mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); in fsl_mc_get_endpoint()
951 strcpy(endpoint1.type, mc_dev->obj_desc.type); in fsl_mc_get_endpoint()
952 endpoint1.id = mc_dev->obj_desc.id; in fsl_mc_get_endpoint()