• Home
  • Raw
  • Download

Lines Matching refs:mc_dev

80 	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);  in fsl_mc_bus_match()  local
85 if (mc_dev->driver_override) { in fsl_mc_bus_match()
86 found = !strcmp(mc_dev->driver_override, mc_drv->driver.name); in fsl_mc_bus_match()
97 if ((mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED) == 0 && in fsl_mc_bus_match()
98 !fsl_mc_is_root_dprc(&mc_dev->dev)) in fsl_mc_bus_match()
106 if (id->vendor == mc_dev->obj_desc.vendor && in fsl_mc_bus_match()
107 strcmp(id->obj_type, mc_dev->obj_desc.type) == 0) { in fsl_mc_bus_match()
124 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_bus_uevent() local
127 mc_dev->obj_desc.vendor, in fsl_mc_bus_uevent()
128 mc_dev->obj_desc.type)) in fsl_mc_bus_uevent()
137 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_dma_configure() local
138 u32 input_id = mc_dev->icid; in fsl_mc_dma_configure()
152 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in modalias_show() local
154 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
155 mc_dev->obj_desc.type); in modalias_show()
163 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in driver_override_store() local
164 char *driver_override, *old = mc_dev->driver_override; in driver_override_store()
182 mc_dev->driver_override = driver_override; in driver_override_store()
185 mc_dev->driver_override = NULL; in driver_override_store()
196 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in driver_override_show() local
198 return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override); in driver_override_show()
329 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_probe() local
334 error = mc_drv->probe(mc_dev); in fsl_mc_driver_probe()
347 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_remove() local
350 error = mc_drv->remove(mc_dev); in fsl_mc_driver_remove()
362 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_driver_shutdown() local
364 mc_drv->shutdown(mc_dev); in fsl_mc_driver_shutdown()
520 static int translate_mc_addr(struct fsl_mc_device *mc_dev, in translate_mc_addr() argument
528 fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev); in translate_mc_addr()
555 static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, in fsl_mc_device_get_mmio_regions() argument
561 struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc; in fsl_mc_device_get_mmio_regions()
562 struct device *parent_dev = mc_dev->dev.parent; in fsl_mc_device_get_mmio_regions()
565 if (is_fsl_mc_bus_dprc(mc_dev) || in fsl_mc_device_get_mmio_regions()
566 is_fsl_mc_bus_dpmcp(mc_dev)) { in fsl_mc_device_get_mmio_regions()
568 } else if (is_fsl_mc_bus_dpio(mc_dev)) { in fsl_mc_device_get_mmio_regions()
606 error = translate_mc_addr(mc_dev, mc_region_type, in fsl_mc_device_get_mmio_regions()
621 if (is_fsl_mc_bus_dprc(mc_dev) && in fsl_mc_device_get_mmio_regions()
640 mc_dev->regions = regions; in fsl_mc_device_get_mmio_regions()
663 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); in fsl_mc_device_release() local
665 kfree(mc_dev->regions); in fsl_mc_device_release()
667 if (is_fsl_mc_bus_dprc(mc_dev)) in fsl_mc_device_release()
668 kfree(to_fsl_mc_bus(mc_dev)); in fsl_mc_device_release()
670 kfree(mc_dev); in fsl_mc_device_release()
682 struct fsl_mc_device *mc_dev = NULL; in fsl_mc_device_add() local
700 mc_dev = &mc_bus->mc_dev; in fsl_mc_device_add()
705 mc_dev = kzalloc(sizeof(*mc_dev), GFP_KERNEL); in fsl_mc_device_add()
706 if (!mc_dev) in fsl_mc_device_add()
710 mc_dev->obj_desc = *obj_desc; in fsl_mc_device_add()
711 mc_dev->mc_io = mc_io; in fsl_mc_device_add()
712 device_initialize(&mc_dev->dev); in fsl_mc_device_add()
713 mc_dev->dev.parent = parent_dev; in fsl_mc_device_add()
714 mc_dev->dev.bus = &fsl_mc_bus_type; in fsl_mc_device_add()
715 mc_dev->dev.release = fsl_mc_device_release; in fsl_mc_device_add()
716 mc_dev->dev.type = fsl_mc_get_device_type(obj_desc->type); in fsl_mc_device_add()
717 if (!mc_dev->dev.type) { in fsl_mc_device_add()
722 dev_set_name(&mc_dev->dev, "%s.%d", obj_desc->type, obj_desc->id); in fsl_mc_device_add()
727 mc_dev->flags |= FSL_MC_IS_DPRC; in fsl_mc_device_add()
756 error = get_dprc_icid(mc_io2, obj_desc->id, &mc_dev->icid); in fsl_mc_device_add()
764 mc_dev->icid = parent_mc_dev->icid; in fsl_mc_device_add()
765 mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK; in fsl_mc_device_add()
766 mc_dev->dev.dma_mask = &mc_dev->dma_mask; in fsl_mc_device_add()
767 mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask; in fsl_mc_device_add()
768 dev_set_msi_domain(&mc_dev->dev, in fsl_mc_device_add()
779 error = fsl_mc_device_get_mmio_regions(mc_dev, in fsl_mc_device_add()
788 error = device_add(&mc_dev->dev); in fsl_mc_device_add()
792 dev_name(&mc_dev->dev), error); in fsl_mc_device_add()
796 dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev)); in fsl_mc_device_add()
798 *new_mc_dev = mc_dev; in fsl_mc_device_add()
802 kfree(mc_dev->regions); in fsl_mc_device_add()
804 kfree(mc_dev); in fsl_mc_device_add()
816 void fsl_mc_device_remove(struct fsl_mc_device *mc_dev) in fsl_mc_device_remove() argument
818 kfree(mc_dev->driver_override); in fsl_mc_device_remove()
819 mc_dev->driver_override = NULL; in fsl_mc_device_remove()
824 device_del(&mc_dev->dev); in fsl_mc_device_remove()
825 put_device(&mc_dev->dev); in fsl_mc_device_remove()
829 struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev) in fsl_mc_get_endpoint() argument
837 mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); in fsl_mc_get_endpoint()
838 strcpy(endpoint1.type, mc_dev->obj_desc.type); in fsl_mc_get_endpoint()
839 endpoint1.id = mc_dev->obj_desc.id; in fsl_mc_get_endpoint()