Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ipu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008
3  * Guennadi Liakhovetski, DENX Software Engineering, <[email protected]>
4  *
5  * Copyright (C) 2005-2007 Freescale Semiconductor, Inc.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef _IPU_H_
13 #define _IPU_H_
14 
15 #include <linux/types.h>
16 #include <linux/dmaengine.h>
17 
18 /* IPU DMA Controller channel definitions. */
20  IDMAC_IC_0 = 0, /* IC (encoding task) to memory */
21  IDMAC_IC_1 = 1, /* IC (viewfinder task) to memory */
29  IDMAC_IC_7 = 7, /* IC (sensor data) to memory */
36  IDMAC_SDC_0 = 14, /* Background synchronous display data */
37  IDMAC_SDC_1 = 15, /* Foreground data (overlay) */
46  IDMAC_PF_0 = 24,
47  IDMAC_PF_1 = 25,
48  IDMAC_PF_2 = 26,
49  IDMAC_PF_3 = 27,
50  IDMAC_PF_4 = 28,
51  IDMAC_PF_5 = 29,
52  IDMAC_PF_6 = 30,
53  IDMAC_PF_7 = 31,
54 };
55 
56 /* Order significant! */
62 };
63 
64 #define IPU_CHANNELS_NUM 32
65 
66 enum pixel_fmt {
67  /* 1 byte */
74  /* 2 bytes */
80  /* 3 bytes */
83  /* 4 bytes */
90 };
91 
96 };
97 
98 /*
99  * Enumeration of IPU rotation modes
100  */
102  /* Note the enum values correspond to BAM value */
111 };
112 
113 /*
114  * Enumeration of DI ports for ADC.
115  */
121 };
122 
124  unsigned short in_width;
125  unsigned short in_height;
127  unsigned short out_width;
128  unsigned short out_height;
130  unsigned short out_stride;
135  unsigned short out_left;
136  unsigned short out_top;
137 };
138 
139 /*
140  * Union of initialization parameters for a logical channel. So far only video
141  * parameters are used.
142  */
145 };
146 
149  struct scatterlist *sg; /* scatterlist for this */
150  unsigned int sg_len; /* tx-descriptor. */
151  struct list_head list;
152 };
153 
156  dma_cookie_t completed; /* last completed cookie */
158  enum ipu_channel link; /* input channel, linked to the output */
160  void *client; /* Only one client per channel */
161  unsigned int n_tx_desc;
162  struct idmac_tx_desc *desc; /* allocated tx-descriptors */
163  struct scatterlist *sg[2]; /* scatterlist elements in buffer-0 and -1 */
164  struct list_head free_list; /* free tx-descriptors */
165  struct list_head queue; /* queued tx-descriptors */
166  spinlock_t lock; /* protects sg[0,1], queue */
167  struct mutex chan_mutex; /* protects status, cookie, free_list */
170  unsigned int eof_irq;
171  char eof_name[16]; /* EOF IRQ name for request_irq() */
172 };
173 
174 #define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
175 #define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
176 
177 #endif