.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2013 - 2014 Texas Instruments, Inc. |
---|
3 | 4 | * |
---|
4 | 5 | * Benoit Parrot <bparrot@ti.com> |
---|
5 | 6 | * Lad, Prabhakar <prabhakar.csengg@gmail.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you may redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License as published by |
---|
9 | | - * the Free Software Foundation; version 2 of the License. |
---|
10 | | - * |
---|
11 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
---|
12 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
---|
13 | | - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
---|
14 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
---|
15 | | - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
---|
16 | | - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
---|
17 | | - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
---|
18 | | - * SOFTWARE. |
---|
19 | 7 | */ |
---|
20 | 8 | |
---|
21 | 9 | #ifndef AM437X_VPFE_H |
---|
.. | .. |
---|
23 | 11 | |
---|
24 | 12 | #include <linux/am437x-vpfe.h> |
---|
25 | 13 | #include <linux/clk.h> |
---|
| 14 | +#include <linux/completion.h> |
---|
26 | 15 | #include <linux/device.h> |
---|
27 | 16 | #include <linux/io.h> |
---|
28 | 17 | #include <linux/i2c.h> |
---|
.. | .. |
---|
64 | 53 | |
---|
65 | 54 | #define VPFE_MAX_SUBDEV 1 |
---|
66 | 55 | #define VPFE_MAX_INPUTS 1 |
---|
67 | | - |
---|
68 | | -struct vpfe_pixel_format { |
---|
69 | | - struct v4l2_fmtdesc fmtdesc; |
---|
70 | | - /* bytes per pixel */ |
---|
71 | | - int bpp; |
---|
72 | | -}; |
---|
73 | 56 | |
---|
74 | 57 | struct vpfe_std_info { |
---|
75 | 58 | int active_pixels; |
---|
.. | .. |
---|
220 | 203 | u32 ccdc_ctx[VPFE_REG_END / sizeof(u32)]; |
---|
221 | 204 | }; |
---|
222 | 205 | |
---|
| 206 | +/* |
---|
| 207 | + * struct vpfe_fmt - VPFE media bus format information |
---|
| 208 | + * fourcc: V4L2 pixel format code |
---|
| 209 | + * code: V4L2 media bus format code |
---|
| 210 | + * bitsperpixel: Bits per pixel over the bus |
---|
| 211 | + */ |
---|
| 212 | +struct vpfe_fmt { |
---|
| 213 | + u32 fourcc; |
---|
| 214 | + u32 code; |
---|
| 215 | + u32 bitsperpixel; |
---|
| 216 | +}; |
---|
| 217 | + |
---|
| 218 | +/* |
---|
| 219 | + * When formats[] is modified make sure to adjust this value also. |
---|
| 220 | + * Expect compile time warnings if VPFE_NUM_FORMATS is smaller then |
---|
| 221 | + * the number of elements in formats[]. |
---|
| 222 | + */ |
---|
| 223 | +#define VPFE_NUM_FORMATS 10 |
---|
| 224 | + |
---|
223 | 225 | struct vpfe_device { |
---|
224 | 226 | /* V4l2 specific parameters */ |
---|
225 | 227 | /* Identifies video device for this channel */ |
---|
.. | .. |
---|
255 | 257 | struct vpfe_cap_buffer *next_frm; |
---|
256 | 258 | /* Used to store pixel format */ |
---|
257 | 259 | struct v4l2_format fmt; |
---|
258 | | - /* Used to store current bytes per pixel based on current format */ |
---|
259 | | - unsigned int bpp; |
---|
| 260 | + /* Used to keep a reference to the current vpfe_fmt */ |
---|
| 261 | + struct vpfe_fmt *current_vpfe_fmt; |
---|
| 262 | + struct vpfe_fmt *active_fmt[VPFE_NUM_FORMATS]; |
---|
| 263 | + unsigned int num_active_fmt; |
---|
| 264 | + |
---|
260 | 265 | /* |
---|
261 | 266 | * used when IMP is chained to store the crop window which |
---|
262 | 267 | * is different from the image window |
---|
.. | .. |
---|
276 | 281 | */ |
---|
277 | 282 | u32 field_off; |
---|
278 | 283 | struct vpfe_ccdc ccdc; |
---|
| 284 | + int stopping; |
---|
| 285 | + struct completion capture_stop; |
---|
279 | 286 | }; |
---|
280 | 287 | |
---|
281 | 288 | #endif /* AM437X_VPFE_H */ |
---|