2 * Header for the new SH dmaengine driver
4 * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #ifndef ASM_DMAENGINE_H
11 #define ASM_DMAENGINE_H
13 #include <linux/dmaengine.h>
14 #include <linux/list.h>
16 #include <asm/dma-register.h>
18 #define SH_DMAC_MAX_CHANNELS 6
20 enum sh_dmae_slave_chan_id {
37 SHDMA_SLAVE_NUMBER, /* Must stay last */
40 struct sh_dmae_slave_config {
41 enum sh_dmae_slave_chan_id slave_id;
47 struct sh_dmae_channel {
50 unsigned int dmars_bit;
53 struct sh_dmae_pdata {
54 struct sh_dmae_slave_config *slave;
56 struct sh_dmae_channel *channel;
58 unsigned int ts_low_shift;
59 unsigned int ts_low_mask;
60 unsigned int ts_high_shift;
61 unsigned int ts_high_mask;
62 unsigned int *ts_shift;
69 /* Used by slave DMA clients to request DMA to/from a specific peripheral */
70 struct sh_dmae_slave {
71 enum sh_dmae_slave_chan_id slave_id; /* Set by the platform */
72 struct device *dma_dev; /* Set by the platform */
73 struct sh_dmae_slave_config *config; /* Set by the driver */
77 u32 sar; /* SAR / source address */
78 u32 dar; /* DAR / destination address */
79 u32 tcr; /* TCR / transfer count */
83 struct sh_dmae_regs hw;
84 struct list_head node;
85 struct dma_async_tx_descriptor async_tx;
86 enum dma_data_direction direction;