blob: 22eafc310bd7858a8fb10b39087fc6064e78e04c [file] [log] [blame]
Boojin Kimc4e16622011-09-02 09:44:35 +09001/* arch/arm/plat-samsung/include/plat/dma-ops.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung DMA support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __SAMSUNG_DMA_OPS_H_
14#define __SAMSUNG_DMA_OPS_H_ __FILE__
15
16#include <linux/dmaengine.h>
17
18struct samsung_dma_prep_info {
19 enum dma_transaction_type cap;
20 enum dma_data_direction direction;
21 dma_addr_t buf;
22 unsigned long period;
23 unsigned long len;
24 void (*fp)(void *data);
25 void *fp_param;
26};
27
28struct samsung_dma_info {
29 enum dma_transaction_type cap;
30 enum dma_data_direction direction;
31 enum dma_slave_buswidth width;
32 dma_addr_t fifo;
33 struct s3c2410_dma_client *client;
Thomas Abraham4972a802011-10-24 11:43:38 +020034 struct property *dt_dmach_prop;
Boojin Kimc4e16622011-09-02 09:44:35 +090035};
36
37struct samsung_dma_ops {
38 unsigned (*request)(enum dma_ch ch, struct samsung_dma_info *info);
39 int (*release)(unsigned ch, struct s3c2410_dma_client *client);
40 int (*prepare)(unsigned ch, struct samsung_dma_prep_info *info);
41 int (*trigger)(unsigned ch);
42 int (*started)(unsigned ch);
43 int (*flush)(unsigned ch);
44 int (*stop)(unsigned ch);
45};
46
47extern void *samsung_dmadev_get_ops(void);
48extern void *s3c_dma_get_ops(void);
49
50static inline void *__samsung_dma_get_ops(void)
51{
52 if (samsung_dma_is_dmadev())
53 return samsung_dmadev_get_ops();
54 else
55 return s3c_dma_get_ops();
56}
57
58/*
59 * samsung_dma_get_ops
60 * get the set of samsung dma operations
61 */
62#define samsung_dma_get_ops() __samsung_dma_get_ops()
63
64#endif /* __SAMSUNG_DMA_OPS_H_ */