Blame view

drivers/dma/shdma.h 1.96 KB
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  /*
   * Renesas SuperH DMA Engine support
   *
   * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
   * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
   *
   * This is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   *
   */
  #ifndef __DMA_SHDMA_H
  #define __DMA_SHDMA_H
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
15
  #include <linux/dmaengine.h>
3542a113a   Guennadi Liakhovetski   sh: fix DMA drive...
16
17
  #include <linux/interrupt.h>
  #include <linux/list.h>
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
18

d026e00e5   Magnus Damm   dmaengine: shdma:...
19
  #define SH_DMAC_MAX_CHANNELS 20
02ca5083f   Magnus Damm   dmaengine: shdma:...
20
  #define SH_DMA_SLAVE_NUMBER 256
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
21
  #define SH_DMA_TCR_MAX 0x00FFFFFF	/* 16MB */
3542a113a   Guennadi Liakhovetski   sh: fix DMA drive...
22
  struct device;
7a1cd9ad8   Guennadi Liakhovetski   dma: shdma: trans...
23
24
25
26
27
  enum dmae_pm_state {
  	DMAE_PM_ESTABLISHED,
  	DMAE_PM_BUSY,
  	DMAE_PM_PENDING,
  };
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
28
29
  struct sh_dmae_chan {
  	dma_cookie_t completed_cookie;	/* The maximum cookie completed */
86d61b33e   Guennadi Liakhovetski   sh: stylistic imp...
30
31
32
33
34
  	spinlock_t desc_lock;		/* Descriptor operation lock */
  	struct list_head ld_queue;	/* Link descriptors queue */
  	struct list_head ld_free;	/* Link descriptors free */
  	struct dma_chan common;		/* DMA common channel */
  	struct device *dev;		/* Channel device */
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
35
  	struct tasklet_struct tasklet;	/* Tasklet */
86d61b33e   Guennadi Liakhovetski   sh: stylistic imp...
36
  	int descs_allocated;		/* desc count */
cfefe9979   Guennadi Liakhovetski   sh: implement DMA...
37
  	int xmit_shift;			/* log_2(bytes_per_xfer) */
027811b9b   Guennadi Liakhovetski   dmaengine: shdma:...
38
  	int irq;
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
39
  	int id;				/* Raw id of this channel */
027811b9b   Guennadi Liakhovetski   dmaengine: shdma:...
40
  	u32 __iomem *base;
86d61b33e   Guennadi Liakhovetski   sh: stylistic imp...
41
  	char dev_id[16];		/* unique name per DMAC of channel */
467017b83   Guennadi Liakhovetski   dmaengine: shdma:...
42
  	int pm_error;
7a1cd9ad8   Guennadi Liakhovetski   dma: shdma: trans...
43
  	enum dmae_pm_state pm_state;
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
44
45
46
47
  };
  
  struct sh_dmae_device {
  	struct dma_device common;
8b1935e6a   Guennadi Liakhovetski   dmaengine: shdma:...
48
  	struct sh_dmae_chan *chan[SH_DMAC_MAX_CHANNELS];
027811b9b   Guennadi Liakhovetski   dmaengine: shdma:...
49
  	struct sh_dmae_pdata *pdata;
03aa18f55   Paul Mundt   dma: shdma: NMI s...
50
  	struct list_head node;
027811b9b   Guennadi Liakhovetski   dmaengine: shdma:...
51
52
  	u32 __iomem *chan_reg;
  	u16 __iomem *dmars;
5899a723b   Kuninori Morimoto   dmaengine: shdma:...
53
  	unsigned int chcr_offset;
67c6269e5   Kuninori Morimoto   dmaengine: shdma:...
54
  	u32 chcr_ie_bit;
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
55
56
57
58
59
  };
  
  #define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, common)
  #define to_sh_desc(lh) container_of(lh, struct sh_desc, node)
  #define tx_to_sh_desc(tx) container_of(tx, struct sh_desc, async_tx)
c4e0dd783   Kuninori Morimoto   dmaengine: shdma:...
60
61
  #define to_sh_dev(chan) container_of(chan->common.device,\
  				     struct sh_dmae_device, common)
d8902adcc   Nobuhiro Iwamatsu   dmaengine: sh: Ad...
62
63
  
  #endif	/* __DMA_SHDMA_H */