Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 *  arch/arm/include/asm/mach/dma.h
 4 *
 5 *  Copyright (C) 1998-2000 Russell King
 
 
 
 
 6 *
 7 *  This header file describes the interface between the generic DMA handler
 8 *  (dma.c) and the architecture-specific DMA backends (dma-*.c)
 9 */
10
11struct dma_struct;
12typedef struct dma_struct dma_t;
13
14struct dma_ops {
15	int	(*request)(unsigned int, dma_t *);		/* optional */
16	void	(*free)(unsigned int, dma_t *);			/* optional */
17	void	(*enable)(unsigned int, dma_t *);		/* mandatory */
18	void 	(*disable)(unsigned int, dma_t *);		/* mandatory */
19	int	(*residue)(unsigned int, dma_t *);		/* optional */
20	int	(*setspeed)(unsigned int, dma_t *, int);	/* optional */
21	const char *type;
22};
23
24struct dma_struct {
25	void		*addr;		/* single DMA address		*/
26	unsigned long	count;		/* single DMA size		*/
27	struct scatterlist buf;		/* single DMA			*/
28	int		sgcount;	/* number of DMA SG		*/
29	struct scatterlist *sg;		/* DMA Scatter-Gather List	*/
30
31	unsigned int	active:1;	/* Transfer active		*/
32	unsigned int	invalid:1;	/* Address/Count changed	*/
33
34	unsigned int	dma_mode;	/* DMA mode			*/
35	int		speed;		/* DMA speed			*/
36
37	unsigned int	lock;		/* Device is allocated		*/
38	const char	*device_id;	/* Device name			*/
39
40	const struct dma_ops *d_ops;
41};
42
43/*
44 * isa_dma_add - add an ISA-style DMA channel
45 */
46extern int isa_dma_add(unsigned int, dma_t *dma);
47
48/*
49 * Add the ISA DMA controller.  Always takes channels 0-7.
50 */
51extern void isa_init_dma(void);
v3.1
 
 1/*
 2 *  arch/arm/include/asm/mach/dma.h
 3 *
 4 *  Copyright (C) 1998-2000 Russell King
 5 *
 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.
 9 *
10 *  This header file describes the interface between the generic DMA handler
11 *  (dma.c) and the architecture-specific DMA backends (dma-*.c)
12 */
13
14struct dma_struct;
15typedef struct dma_struct dma_t;
16
17struct dma_ops {
18	int	(*request)(unsigned int, dma_t *);		/* optional */
19	void	(*free)(unsigned int, dma_t *);			/* optional */
20	void	(*enable)(unsigned int, dma_t *);		/* mandatory */
21	void 	(*disable)(unsigned int, dma_t *);		/* mandatory */
22	int	(*residue)(unsigned int, dma_t *);		/* optional */
23	int	(*setspeed)(unsigned int, dma_t *, int);	/* optional */
24	const char *type;
25};
26
27struct dma_struct {
28	void		*addr;		/* single DMA address		*/
29	unsigned long	count;		/* single DMA size		*/
30	struct scatterlist buf;		/* single DMA			*/
31	int		sgcount;	/* number of DMA SG		*/
32	struct scatterlist *sg;		/* DMA Scatter-Gather List	*/
33
34	unsigned int	active:1;	/* Transfer active		*/
35	unsigned int	invalid:1;	/* Address/Count changed	*/
36
37	unsigned int	dma_mode;	/* DMA mode			*/
38	int		speed;		/* DMA speed			*/
39
40	unsigned int	lock;		/* Device is allocated		*/
41	const char	*device_id;	/* Device name			*/
42
43	const struct dma_ops *d_ops;
44};
45
46/*
47 * isa_dma_add - add an ISA-style DMA channel
48 */
49extern int isa_dma_add(unsigned int, dma_t *dma);
50
51/*
52 * Add the ISA DMA controller.  Always takes channels 0-7.
53 */
54extern void isa_init_dma(void);