Lines Matching refs:mc_dev
15 static bool __must_check fsl_mc_is_allocatable(struct fsl_mc_device *mc_dev)
17 return is_fsl_mc_bus_dpbp(mc_dev) ||
18 is_fsl_mc_bus_dpmcp(mc_dev) ||
19 is_fsl_mc_bus_dpcon(mc_dev);
28 * @mc_dev: pointer to allocatable fsl-mc device
35 *mc_dev)
39 struct fsl_mc_device *mc_bus_dev = &mc_bus->mc_dev;
44 if (!fsl_mc_is_allocatable(mc_dev))
46 if (mc_dev->resource)
73 resource->id = mc_dev->obj_desc.id;
74 resource->data = mc_dev;
78 mc_dev->resource = resource;
92 * @mc_dev: pointer to allocatable fsl-mc device
98 *mc_dev)
106 if (!fsl_mc_is_allocatable(mc_dev))
109 resource = mc_dev->resource;
110 if (!resource || resource->data != mc_dev)
113 mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
135 dev_name(&mc_dev->dev));
144 mc_dev->resource = NULL;
181 struct fsl_mc_device *mc_bus_dev = &mc_bus->mc_dev;
254 * @mc_dev: fsl-mc device which is used in conjunction with the
268 int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
279 if (mc_dev->flags & FSL_MC_IS_DPRC)
282 if (!dev_is_fsl_mc(mc_dev->dev.parent))
288 mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
300 mc_adev->consumer_link = device_link_add(&mc_dev->dev,
442 int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
452 if (mc_dev->irqs)
455 irq_count = mc_dev->obj_desc.irq_count;
459 if (is_fsl_mc_bus_dprc(mc_dev))
460 mc_bus = to_fsl_mc_bus(mc_dev);
462 mc_bus = to_fsl_mc_bus(to_fsl_mc_device(mc_dev->dev.parent));
469 dev_err(&mc_dev->dev,
474 irqs = devm_kcalloc(&mc_dev->dev, irq_count, sizeof(irqs[0]),
490 irqs[i]->mc_dev = mc_dev;
494 mc_dev->irqs = irqs;
499 irqs[i]->mc_dev = NULL;
510 void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev)
515 struct fsl_mc_device_irq **irqs = mc_dev->irqs;
520 irq_count = mc_dev->obj_desc.irq_count;
522 if (is_fsl_mc_bus_dprc(mc_dev))
523 mc_bus = to_fsl_mc_bus(mc_dev);
525 mc_bus = to_fsl_mc_bus(to_fsl_mc_device(mc_dev->dev.parent));
531 irqs[i]->mc_dev = NULL;
535 mc_dev->irqs = NULL;
585 static int fsl_mc_allocator_probe(struct fsl_mc_device *mc_dev)
592 if (!fsl_mc_is_allocatable(mc_dev))
595 mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
600 error = object_type_to_pool_type(mc_dev->obj_desc.type, &pool_type);
604 error = fsl_mc_resource_pool_add_device(mc_bus, pool_type, mc_dev);
608 dev_dbg(&mc_dev->dev,
617 static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev)
621 if (!fsl_mc_is_allocatable(mc_dev))
624 if (mc_dev->resource) {
625 error = fsl_mc_resource_pool_remove_device(mc_dev);
630 dev_dbg(&mc_dev->dev,