Merge branch 'next/dt' into next/multiplatform
[deliverable/linux.git] / arch / arm / mach-omap2 / omap_hwmod.c
index 3615e0d9ee3c84d7e45de2a958bc1583867b67a5..a5d04ba99b852597cd80c87b042b2decfc9dcc21 100644 (file)
@@ -3158,6 +3158,33 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
        return r;
 }
 
+/**
+ * omap_hwmod_fill_dma_resources - fill struct resource array with dma data
+ * @oh: struct omap_hwmod *
+ * @res: pointer to the array of struct resource to fill
+ *
+ * Fill the struct resource array @res with dma resource data from the
+ * omap_hwmod @oh.  Intended to be called by code that registers
+ * omap_devices.  See also omap_hwmod_count_resources().  Returns the
+ * number of array elements filled.
+ */
+int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res)
+{
+       int i, sdma_reqs_cnt;
+       int r = 0;
+
+       sdma_reqs_cnt = _count_sdma_reqs(oh);
+       for (i = 0; i < sdma_reqs_cnt; i++) {
+               (res + r)->name = (oh->sdma_reqs + i)->name;
+               (res + r)->start = (oh->sdma_reqs + i)->dma_req;
+               (res + r)->end = (oh->sdma_reqs + i)->dma_req;
+               (res + r)->flags = IORESOURCE_DMA;
+               r++;
+       }
+
+       return r;
+}
+
 /**
  * omap_hwmod_get_resource_byname - fetch IP block integration data by name
  * @oh: struct omap_hwmod * to operate on
This page took 0.026591 seconds and 5 git commands to generate.