@@ -34,6 +34,12 @@ enum chip_id {
RCAR_E1,
};
+struct rcar_vin_format {
+ const char *description;
+ u32 fourcc;
+ u8 bpp;
+};
+
struct rcar_vin {
void __iomem *base;
@@ -181,6 +187,59 @@ static irqreturn_t rcar_vin_irq(int irq, void *dev_id)
}
/* -----------------------------------------------------------------------------
+ * Video formats
+ */
+
+static const struct rcar_vin_format rcar_vin_formats[] = {
+ {
+ .description = "NV16",
+ .fourcc = V4L2_PIX_FMT_NV16,
+ .bpp = 8,
+ },
+ {
+ .description = "YUYV",
+ .fourcc = V4L2_PIX_FMT_YUYV,
+ .bpp = 16,
+ },
+ {
+ .description = "UYVY",
+ .fourcc = V4L2_PIX_FMT_UYVY,
+ .bpp = 16,
+ },
+ {
+ .description = "RGB565",
+ .fourcc = V4L2_PIX_FMT_RGB565,
+ .bpp = 16,
+ },
+ {
+ .description = "ARGB1555",
+ .fourcc = V4L2_PIX_FMT_RGB555X,
+ .bpp = 16,
+ },
+ {
+ .description = "RGB888",
+ .fourcc = V4L2_PIX_FMT_RGB32,
+ .bpp = 32,
+ },
+};
+
+
+
+const struct rcar_vin_format *rcar_vin_get_format_by_fourcc(u32 fourcc)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(rcar_vin_formats); ++i) {
+ const struct rcar_vin_format *format = &rcar_vin_formats[i];
+
+ if (format->fourcc == fourcc)
+ return format;
+ }
+
+ return ERR_PTR(-EINVAL);
+}
+
+/* -----------------------------------------------------------------------------
* Platform Device Driver
*/