forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/media/platform/am437x/am437x-vpfe.h
....@@ -1,21 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2013 - 2014 Texas Instruments, Inc.
34 *
45 * Benoit Parrot <bparrot@ti.com>
56 * 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.
197 */
208
219 #ifndef AM437X_VPFE_H
....@@ -23,6 +11,7 @@
2311
2412 #include <linux/am437x-vpfe.h>
2513 #include <linux/clk.h>
14
+#include <linux/completion.h>
2615 #include <linux/device.h>
2716 #include <linux/io.h>
2817 #include <linux/i2c.h>
....@@ -64,12 +53,6 @@
6453
6554 #define VPFE_MAX_SUBDEV 1
6655 #define VPFE_MAX_INPUTS 1
67
-
68
-struct vpfe_pixel_format {
69
- struct v4l2_fmtdesc fmtdesc;
70
- /* bytes per pixel */
71
- int bpp;
72
-};
7356
7457 struct vpfe_std_info {
7558 int active_pixels;
....@@ -220,6 +203,25 @@
220203 u32 ccdc_ctx[VPFE_REG_END / sizeof(u32)];
221204 };
222205
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
+
223225 struct vpfe_device {
224226 /* V4l2 specific parameters */
225227 /* Identifies video device for this channel */
....@@ -255,8 +257,11 @@
255257 struct vpfe_cap_buffer *next_frm;
256258 /* Used to store pixel format */
257259 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
+
260265 /*
261266 * used when IMP is chained to store the crop window which
262267 * is different from the image window
....@@ -276,6 +281,8 @@
276281 */
277282 u32 field_off;
278283 struct vpfe_ccdc ccdc;
284
+ int stopping;
285
+ struct completion capture_stop;
279286 };
280287
281288 #endif /* AM437X_VPFE_H */