blob: a1b35c19c5b7c60c15d3e5c5455979752ba48f1e [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef __MSM_DMA_TEST__
15#define __MSM_DMA_TEST__
16
17#include <linux/ioctl.h>
18
19#define MSM_DMA_IOC_MAGIC 0x83
20
21/* The testing driver can manage a series of buffers. These are
22 * allocated and freed using these calls. */
23struct msm_dma_alloc_req {
24 int size; /* Size of this request, in bytes. */
25 int bufnum; /* OUT: Number of buffer allocated. */
26};
27#define MSM_DMA_IOALLOC _IOWR(MSM_DMA_IOC_MAGIC, 2, struct msm_dma_alloc_req)
28
29/* Free the specified buffer. */
30#define MSM_DMA_IOFREE _IOW(MSM_DMA_IOC_MAGIC, 3, int)
31
32/* Free all used buffers. */
33#define MSM_DMA_IOFREEALL _IO(MSM_DMA_IOC_MAGIC, 7)
34
35/* Read/write data into kernel buffer. */
36struct msm_dma_bufxfer {
37 void *data;
38 int size;
39 int bufnum;
40};
41#define MSM_DMA_IOWBUF _IOW(MSM_DMA_IOC_MAGIC, 4, struct msm_dma_bufxfer)
42#define MSM_DMA_IORBUF _IOW(MSM_DMA_IOC_MAGIC, 5, struct msm_dma_bufxfer)
43
44/* Use the data mover to copy from one buffer to another. */
45struct msm_dma_scopy {
46 int srcbuf;
47 int destbuf;
48 int size;
49};
50#define MSM_DMA_IOSCOPY _IOW(MSM_DMA_IOC_MAGIC, 6, struct msm_dma_scopy)
51
52#endif /* __MSM_DMA_TEST__ */