Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_SPARC_EBUS_DMA_H
0003 #define __ASM_SPARC_EBUS_DMA_H
0004 
0005 struct ebus_dma_info {
0006     spinlock_t  lock;
0007     void __iomem    *regs;
0008 
0009     unsigned int    flags;
0010 #define EBUS_DMA_FLAG_USE_EBDMA_HANDLER     0x00000001
0011 #define EBUS_DMA_FLAG_TCI_DISABLE       0x00000002
0012 
0013     /* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
0014      * set.
0015      */
0016     void (*callback)(struct ebus_dma_info *p, int event, void *cookie);
0017     void *client_cookie;
0018     unsigned int    irq;
0019 #define EBUS_DMA_EVENT_ERROR    1
0020 #define EBUS_DMA_EVENT_DMA  2
0021 #define EBUS_DMA_EVENT_DEVICE   4
0022 
0023     unsigned char   name[64];
0024 };
0025 
0026 int ebus_dma_register(struct ebus_dma_info *p);
0027 int ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
0028 void ebus_dma_unregister(struct ebus_dma_info *p);
0029 int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
0030                 size_t len);
0031 void ebus_dma_prepare(struct ebus_dma_info *p, int write);
0032 unsigned int ebus_dma_residue(struct ebus_dma_info *p);
0033 unsigned int ebus_dma_addr(struct ebus_dma_info *p);
0034 void ebus_dma_enable(struct ebus_dma_info *p, int on);
0035 
0036 #endif /* __ASM_SPARC_EBUS_DMA_H */