]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/linux/pxp_dma.h
ARM: dts: tx6: add enet_out clock for FEC
[karo-tx-linux.git] / include / linux / pxp_dma.h
1 /*
2  * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17  *
18  */
19 #ifndef _PXP_DMA
20 #define _PXP_DMA
21
22 #include <uapi/linux/pxp_dma.h>
23
24 struct pxp_tx_desc {
25         struct dma_async_tx_descriptor txd;
26         struct list_head tx_list;
27         struct list_head list;
28         int len;
29         union {
30                 struct pxp_layer_param s0_param;
31                 struct pxp_layer_param out_param;
32                 struct pxp_layer_param ol_param;
33         } layer_param;
34         struct pxp_proc_data proc_data;
35
36         u32 hist_status;        /* Histogram output status */
37
38         struct pxp_tx_desc *next;
39 };
40
41 struct pxp_channel {
42         struct dma_chan dma_chan;
43         dma_cookie_t completed; /* last completed cookie */
44         enum pxp_channel_status status;
45         void *client;           /* Only one client per channel */
46         unsigned int n_tx_desc;
47         struct pxp_tx_desc *desc;       /* allocated tx-descriptors */
48         struct list_head queue; /* queued tx-descriptors */
49         struct list_head list;  /* track queued channel number */
50         spinlock_t lock;        /* protects sg[0,1], queue,
51                                  * status, cookie, free_list
52                                  */
53         int active_buffer;
54         unsigned int eof_irq;
55         char eof_name[16];      /* EOF IRQ name for request_irq()  */
56 };
57
58 #define to_tx_desc(tx) container_of(tx, struct pxp_tx_desc, txd)
59 #define to_pxp_channel(d) container_of(d, struct pxp_channel, dma_chan)
60
61 void pxp_txd_ack(struct dma_async_tx_descriptor *txd,
62                  struct pxp_channel *pxp_chan);
63
64 #ifdef CONFIG_MXC_PXP_CLIENT_DEVICE
65 int register_pxp_device(void);
66 void unregister_pxp_device(void);
67 #else
68 int register_pxp_device(void) { return 0; }
69 void unregister_pxp_device(void) {}
70 #endif
71
72 #endif