]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: davinci: vpif: move code to driver core header from platform
authorManjunath Hadli <manjunath.hadli@ti.com>
Sat, 12 Nov 2011 15:06:02 +0000 (20:36 +0530)
committerSekhar Nori <nsekhar@ti.com>
Fri, 2 Dec 2011 19:03:50 +0000 (00:33 +0530)
Move vpif related definitions for capture and display drivers
from dm646x platform header file to vpif_types.h inside
the driver as these definitions are related to driver code
rather than the platform or board.

This enables reusing this IP across platforms.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/include/mach/dm646x.h
drivers/media/video/davinci/vpif.h
drivers/media/video/davinci/vpif_capture.h
drivers/media/video/davinci/vpif_display.h
include/media/davinci/vpif_types.h [new file with mode: 0644]

index 2a00fe5ac253dc7a3f810cbeb4d58553bb51ad21..a8ee6c9f0bb01d15c0a5c8b32e16246522475fc9 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/i2c.h>
 #include <linux/videodev2.h>
 #include <linux/davinci_emac.h>
+#include <media/davinci/vpif_types.h>
 
 #define DM646X_EMAC_BASE               (0x01C80000)
 #define DM646X_EMAC_MDIO_BASE          (DM646X_EMAC_BASE + 0x4000)
@@ -34,58 +35,6 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv);
 
 void dm646x_video_init(void);
 
-enum vpif_if_type {
-       VPIF_IF_BT656,
-       VPIF_IF_BT1120,
-       VPIF_IF_RAW_BAYER
-};
-
-struct vpif_interface {
-       enum vpif_if_type if_type;
-       unsigned hd_pol:1;
-       unsigned vd_pol:1;
-       unsigned fid_pol:1;
-};
-
-struct vpif_subdev_info {
-       const char *name;
-       struct i2c_board_info board_info;
-       u32 input;
-       u32 output;
-       unsigned can_route:1;
-       struct vpif_interface vpif_if;
-};
-
-struct vpif_display_config {
-       int (*set_clock)(int, int);
-       struct vpif_subdev_info *subdevinfo;
-       int subdev_count;
-       const char **output;
-       int output_count;
-       const char *card_name;
-};
-
-struct vpif_input {
-       struct v4l2_input input;
-       const char *subdev_name;
-};
-
-#define VPIF_CAPTURE_MAX_CHANNELS      2
-
-struct vpif_capture_chan_config {
-       const struct vpif_input *inputs;
-       int input_count;
-};
-
-struct vpif_capture_config {
-       int (*setup_input_channel_mode)(int);
-       int (*setup_input_path)(int, const char *);
-       struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
-       struct vpif_subdev_info *subdev_info;
-       int subdev_count;
-       const char *card_name;
-};
-
 void dm646x_setup_vpif(struct vpif_display_config *,
                       struct vpif_capture_config *);
 
index 10550bd93b062851cd8154e9f5f541a0dc849178..25036cb11bea36e41963dac9181cbf701a12ab46 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/videodev2.h>
 #include <mach/hardware.h>
 #include <mach/dm646x.h>
+#include <media/davinci/vpif_types.h>
 
 /* Maximum channel allowed */
 #define VPIF_NUM_CHANNELS              (4)
index 064550f5ce4adcdf638d943e6d2a7bdfbdf39451..a693d4ebda557ea0ee972813f8a5877d40e79efb 100644 (file)
@@ -27,7 +27,7 @@
 #include <media/v4l2-device.h>
 #include <media/videobuf-core.h>
 #include <media/videobuf-dma-contig.h>
-#include <mach/dm646x.h>
+#include <media/davinci/vpif_types.h>
 
 #include "vpif.h"
 
index 5d1936dafed25af340cb1ef91c261fd8fb76caa4..56879d1a0684b3c6452b9f34c17b5f7261a5e99e 100644 (file)
@@ -22,6 +22,7 @@
 #include <media/v4l2-device.h>
 #include <media/videobuf-core.h>
 #include <media/videobuf-dma-contig.h>
+#include <media/davinci/vpif_types.h>
 
 #include "vpif.h"
 
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
new file mode 100644 (file)
index 0000000..9929b05
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef _VPIF_TYPES_H
+#define _VPIF_TYPES_H
+
+#define VPIF_CAPTURE_MAX_CHANNELS      2
+
+enum vpif_if_type {
+       VPIF_IF_BT656,
+       VPIF_IF_BT1120,
+       VPIF_IF_RAW_BAYER
+};
+
+struct vpif_interface {
+       enum vpif_if_type if_type;
+       unsigned hd_pol:1;
+       unsigned vd_pol:1;
+       unsigned fid_pol:1;
+};
+
+struct vpif_subdev_info {
+       const char *name;
+       struct i2c_board_info board_info;
+       u32 input;
+       u32 output;
+       unsigned can_route:1;
+       struct vpif_interface vpif_if;
+};
+
+struct vpif_display_config {
+       int (*set_clock)(int, int);
+       struct vpif_subdev_info *subdevinfo;
+       int subdev_count;
+       const char **output;
+       int output_count;
+       const char *card_name;
+};
+
+struct vpif_input {
+       struct v4l2_input input;
+       const char *subdev_name;
+};
+
+struct vpif_capture_chan_config {
+       const struct vpif_input *inputs;
+       int input_count;
+};
+
+struct vpif_capture_config {
+       int (*setup_input_channel_mode)(int);
+       int (*setup_input_path)(int, const char *);
+       struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
+       struct vpif_subdev_info *subdev_info;
+       int subdev_count;
+       const char *card_name;
+};
+#endif /* _VPIF_TYPES_H */