26 #include <linux/slab.h>
27 #include <linux/module.h>
29 #include <linux/device.h>
35 #define OMAP2_DMA_STRIDE 0x60
44 static u16 reg_map[] = {
91 static inline void dma_write(
u32 val,
int reg,
int lch)
96 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
97 offset = reg_map[
reg] + (stride * lch);
101 static inline u32 dma_read(
int reg,
int lch)
106 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
107 offset = reg_map[
reg] + (stride * lch);
112 static inline void omap2_disable_irq_lch(
int lch)
121 static void omap2_clear_dma(
int lch)
123 int i = dma_common_ch_start;
125 for (; i <= dma_common_ch_end; i += 1)
126 dma_write(0, i, lch);
129 static void omap2_show_dma_caps(
void)
133 revision >> 4, revision & 0xf);
137 static u32 configure_dma_errata(
void)
226 char *
name =
"omap_dma_system";
229 dma_common_ch_start =
CSDP;
233 pr_err(
"%s: Unable to allocate pdata for %s:%s\n",
234 __func__, name, oh->
name);
247 p->
errata = configure_dma_errata();
252 pr_err(
"%s: Can't build omap_device for %s:%s.\n",
253 __func__, name, oh->
name);
254 return PTR_ERR(pdev);
259 dev_err(&pdev->
dev,
"%s: no mem resource\n", __func__);
264 dev_err(&pdev->
dev,
"%s: ioremap fail\n", __func__);
273 dev_err(&pdev->
dev,
"%s: kzalloc fail\n", __func__);
279 dma_common_ch_end =
CCDN;
281 dma_common_ch_end =
CCFN;
286 static int __init omap2_system_dma_init(
void)
289 omap2_system_dma_init_dev,
NULL);