ARM: Davinci: VPFE multiple capture device support

parent 936a3f2e
......@@ -372,18 +372,10 @@ config VIDEO_VIVI
Say Y here if you want to test video apps or debug V4L devices.
In doubt, say N.
config VIDEO_TVP5146
tristate "TVP5146 video decoder"
depends on I2C && ARCH_DAVINCI
help
Support for I2C bus based TVP5146 configuration.
To compile this driver as a module, choose M here: the
module will be called tvp5146.
config VIDEO_DAVINCI
tristate "Davinci Video Capture"
depends on VIDEO_DEV && VIDEO_TVP5146 && ARCH_DAVINCI
depends on VIDEO_DEV && ARCH_DAVINCI
select VIDEO_BUF
help
Support for Davinci based frame grabber through CCDC.
......@@ -391,6 +383,30 @@ config VIDEO_DAVINCI
To compile this driver as a module, choose M here: the
module will be called vpfe.
choice
prompt "Video Capture Decoder"
optional
depends on VIDEO_DAVINCI
config VIDEO_TVP5146
tristate "TVP5146 video decoder"
depends on I2C && ARCH_DAVINCI
help
Support for I2C bus based TVP5146 configuration.
To compile this driver as a module, choose M here: the
module will be called tvp5146.
config VIDEO_TVP5150
tristate "TVP5150 video decoder"
depends on I2C && ARCH_DAVINCI
help
Support for I2C bus based TVP5150 configuration.
To compile this driver as a module, choose M here: the
module will be called tvp5150.
endchoice
source "drivers/media/video/bt8xx/Kconfig"
config VIDEO_SAA6588
......
......@@ -20,6 +20,7 @@ ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)
obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o
endif
obj-$(CONFIG_VIDEO_DAVINCI) += davinci-vpfe.o
obj-$(CONFIG_VIDEO_BT848) += bt8xx/
obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o
obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o
......@@ -69,7 +70,6 @@ obj-$(CONFIG_VIDEO_CX88) += cx88/
obj-$(CONFIG_VIDEO_IVTV) += ivtv/
obj-$(CONFIG_VIDEO_EM28XX) += em28xx/
obj-$(CONFIG_VIDEO_USBVISION) += usbvision/
obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
obj-$(CONFIG_VIDEO_PVRUSB2) += pvrusb2/
obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o
obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
......@@ -122,8 +122,8 @@ obj-$(CONFIG_USB_KONICAWC) += usbvideo/
obj-$(CONFIG_USB_VICAM) += usbvideo/
obj-$(CONFIG_USB_QUICKCAM_MESSENGER) += usbvideo/
obj-$(CONFIG_VIDEO_DAVINCI) += davinci-vpfe.o
obj-$(CONFIG_VIDEO_TVP5146) += tvp5146.o
obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
obj-$(CONFIG_VIDEO_VIVI) += vivi.o
......
This diff is collapsed.
......@@ -24,7 +24,6 @@
#endif
#include <media/ccdc_davinci.h>
#include <media/tvp5146.h>
#define TRUE 1
#define FALSE 0
......@@ -37,7 +36,12 @@
#define VPFE_CMD_CONFIG_CCDC _IOW('V',BASE_VIDIOC_PRIVATE + 1,ccdc_params_ycbcr)
#define VPFE_CMD_LATEST_FRM_ONLY _IOW('V',BASE_VIDIOC_PRIVATE + 2,int)
#define VPFE_CMD_CONFIG_TVP5146 _IOW('V',BASE_VIDIOC_PRIVATE + 3,tvp5146_params)
#define VPFE_CMD_CONFIG_CAPTURE _IOW('V', BASE_VIDIOC_PRIVATE + 3,\
struct vpfe_capture_params)
#define VPFE_CMD_CAPTURE_ACTIVE _IOW('V', BASE_VIDIOC_PRIVATE + 4, long int)
#define VPFE_AMUX_COMPOSITE 0
#define VPFE_AMUX_SVIDEO 1
/* settings for commonly used video formats */
#define VPFE_WIN_NTSC {0,0,720,480}
......@@ -49,6 +53,9 @@
#define VPFE_WIN_QVGA {0,0,320,240}
#define VPFE_WIN_SIF {0,0,352,240}
#define VPFE_CAPTURE_ID_TVP5146 0
#define VPFE_CAPTURE_ID_TVP5150 1
#ifdef __KERNEL__
......@@ -80,6 +87,26 @@
#define VPFE_MAX_FBUF_ORDER \
get_order(roundup_pow_of_two(VPFE_MAX_FBUF_SIZE))
struct vpfe_capture_params{
v4l2_std_id mode;
int amuxmode;
int enablebt656sync;
int squarepixel;
};
struct vpfe_capture_device
{
const char *name;
int id;
struct list_head device_list;
int (*capture_device_init)(struct vpfe_capture_params *param);
int (*capture_device_active)(void);
int (*capture_device_deactive)(void);
int (*capture_device_cmd)(u32 cmd, void *arg);
int (*capture_device_cleanup)(void);
};
/* device object */
typedef struct vpfe_obj {
struct video_device *video_dev;
......@@ -106,7 +133,10 @@ typedef struct vpfe_obj {
int mode_changed;
int started;
int field_offset;
tvp5146_params tvp5146_params;
struct semaphore device_list_lock;
struct vpfe_capture_params capture_params;
struct list_head capture_device_list;
struct vpfe_capture_device *active_device;
ccdc_params_ycbcr ccdc_params;
} vpfe_obj;
......@@ -116,6 +146,24 @@ typedef struct vpfe_fh {
int io_allowed;
enum v4l2_priority prio;
} vpfe_fh;
/**
* register the capture device
* @param device
* device that to be registered.
* @return int
* 0:sucess, otherwise, failed.
*/
int vpfe_capture_device_register(struct vpfe_capture_device *device);
/**
* unregister the capture device
* @param device
* device that to be unregistered.
* @return int
* 0:sucess, otherwise, failed.
*/
int vpfe_capture_device_unregister(struct vpfe_capture_device *device);
#endif
#endif /* DAVINCI_VPFE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment