18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __ASM_SPARC_EBUS_DMA_H
38c2ecf20Sopenharmony_ci#define __ASM_SPARC_EBUS_DMA_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cistruct ebus_dma_info {
68c2ecf20Sopenharmony_ci	spinlock_t	lock;
78c2ecf20Sopenharmony_ci	void __iomem	*regs;
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci	unsigned int	flags;
108c2ecf20Sopenharmony_ci#define EBUS_DMA_FLAG_USE_EBDMA_HANDLER		0x00000001
118c2ecf20Sopenharmony_ci#define EBUS_DMA_FLAG_TCI_DISABLE		0x00000002
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci	/* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
148c2ecf20Sopenharmony_ci	 * set.
158c2ecf20Sopenharmony_ci	 */
168c2ecf20Sopenharmony_ci	void (*callback)(struct ebus_dma_info *p, int event, void *cookie);
178c2ecf20Sopenharmony_ci	void *client_cookie;
188c2ecf20Sopenharmony_ci	unsigned int	irq;
198c2ecf20Sopenharmony_ci#define EBUS_DMA_EVENT_ERROR	1
208c2ecf20Sopenharmony_ci#define EBUS_DMA_EVENT_DMA	2
218c2ecf20Sopenharmony_ci#define EBUS_DMA_EVENT_DEVICE	4
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	unsigned char	name[64];
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciint ebus_dma_register(struct ebus_dma_info *p);
278c2ecf20Sopenharmony_ciint ebus_dma_irq_enable(struct ebus_dma_info *p, int on);
288c2ecf20Sopenharmony_civoid ebus_dma_unregister(struct ebus_dma_info *p);
298c2ecf20Sopenharmony_ciint ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr,
308c2ecf20Sopenharmony_ci			    size_t len);
318c2ecf20Sopenharmony_civoid ebus_dma_prepare(struct ebus_dma_info *p, int write);
328c2ecf20Sopenharmony_ciunsigned int ebus_dma_residue(struct ebus_dma_info *p);
338c2ecf20Sopenharmony_ciunsigned int ebus_dma_addr(struct ebus_dma_info *p);
348c2ecf20Sopenharmony_civoid ebus_dma_enable(struct ebus_dma_info *p, int on);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#endif /* __ASM_SPARC_EBUS_DMA_H */
37