Lines Matching refs:dpio_dev

56 static int dpaa2_dpio_get_cluster_sdest(struct fsl_mc_device *dpio_dev, int cpu)
69 dev_err(&dpio_dev->dev, "unknown SoC version\n");
84 static void unregister_dpio_irq_handlers(struct fsl_mc_device *dpio_dev)
88 irq = dpio_dev->irqs[0];
94 static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)
99 irq = dpio_dev->irqs[0];
100 error = devm_request_irq(&dpio_dev->dev,
104 dev_name(&dpio_dev->dev),
105 &dpio_dev->dev);
107 dev_err(&dpio_dev->dev,
115 dev_err(&dpio_dev->dev,
122 static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
128 struct device *dev = &dpio_dev->dev;
138 err = fsl_mc_portal_allocate(dpio_dev, 0, &dpio_dev->mc_io);
145 err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id,
146 &dpio_dev->mc_handle);
152 err = dpio_reset(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
158 err = dpio_get_attributes(dpio_dev->mc_io, 0, dpio_dev->mc_handle,
166 err = dpio_enable(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
175 desc.dpio_id = dpio_dev->obj_desc.id;
187 sdest = dpaa2_dpio_get_cluster_sdest(dpio_dev, desc.cpu);
189 err = dpio_set_stashing_destination(dpio_dev->mc_io, 0,
190 dpio_dev->mc_handle,
197 if (dpio_dev->obj_desc.region_count < 3) {
204 desc.regs_cena = devm_memremap(dev, dpio_dev->regions[1].start,
205 resource_size(&dpio_dev->regions[1]),
208 desc.regs_cena = devm_memremap(dev, dpio_dev->regions[2].start,
209 resource_size(&dpio_dev->regions[2]),
219 desc.regs_cinh = devm_ioremap(dev, dpio_dev->regions[1].start,
220 resource_size(&dpio_dev->regions[1]));
227 err = fsl_mc_allocate_irqs(dpio_dev);
240 err = register_dpio_irq_handlers(dpio_dev, desc.cpu);
247 dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
252 unregister_dpio_irq_handlers(dpio_dev);
254 fsl_mc_free_irqs(dpio_dev);
256 dpio_disable(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
259 dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
261 fsl_mc_portal_free(dpio_dev->mc_io);
267 static void dpio_teardown_irqs(struct fsl_mc_device *dpio_dev)
269 unregister_dpio_irq_handlers(dpio_dev);
270 fsl_mc_free_irqs(dpio_dev);
273 static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev)
279 dev = &dpio_dev->dev;
285 dpio_teardown_irqs(dpio_dev);
289 err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id,
290 &dpio_dev->mc_handle);
296 dpio_disable(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
298 dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle);
300 fsl_mc_portal_free(dpio_dev->mc_io);
305 fsl_mc_portal_free(dpio_dev->mc_io);