media: am437x-vpfe: Switch to SPDX Licensing
[sfrench/cifs-2.6.git] / drivers / media / platform / am437x / am437x-vpfe.h
index 4678285f34c6b4218de6e87ab941b001c0e463f8..05ee37db02732045f91a524757fd1c2f3af7744d 100644 (file)
@@ -1,21 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (C) 2013 - 2014 Texas Instruments, Inc.
  *
  * Benoit Parrot <bparrot@ti.com>
  * Lad, Prabhakar <prabhakar.csengg@gmail.com>
- *
- * This program is free software; you may redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 #ifndef AM437X_VPFE_H
@@ -23,6 +11,7 @@
 
 #include <linux/am437x-vpfe.h>
 #include <linux/clk.h>
+#include <linux/completion.h>
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/i2c.h>
@@ -214,6 +203,25 @@ struct vpfe_ccdc {
        u32 ccdc_ctx[VPFE_REG_END / sizeof(u32)];
 };
 
+/*
+ * struct vpfe_fmt - VPFE media bus format information
+ * fourcc: V4L2 pixel format code
+ * code: V4L2 media bus format code
+ * bitsperpixel: Bits per pixel over the bus
+ */
+struct vpfe_fmt {
+       u32 fourcc;
+       u32 code;
+       u32 bitsperpixel;
+};
+
+/*
+ * When formats[] is modified make sure to adjust this value also.
+ * Expect compile time warnings if VPFE_NUM_FORMATS is smaller then
+ * the number of elements in formats[].
+ */
+#define VPFE_NUM_FORMATS       10
+
 struct vpfe_device {
        /* V4l2 specific parameters */
        /* Identifies video device for this channel */
@@ -249,8 +257,11 @@ struct vpfe_device {
        struct vpfe_cap_buffer *next_frm;
        /* Used to store pixel format */
        struct v4l2_format fmt;
-       /* Used to store current bytes per pixel based on current format */
-       unsigned int bpp;
+       /* Used to keep a reference to the current vpfe_fmt */
+       struct vpfe_fmt *current_vpfe_fmt;
+       struct vpfe_fmt *active_fmt[VPFE_NUM_FORMATS];
+       unsigned int num_active_fmt;
+
        /*
         * used when IMP is chained to store the crop window which
         * is different from the image window
@@ -270,6 +281,8 @@ struct vpfe_device {
         */
        u32 field_off;
        struct vpfe_ccdc ccdc;
+       int stopping;
+       struct completion capture_stop;
 };
 
 #endif /* AM437X_VPFE_H */