Commit f4f06deb authored by 邱宗炽's avatar 邱宗炽

support two-way composite input

There are two port of composite input, can select which one input.
Signed-off-by: default avatar邱宗炽 <tqiu@neuros.com.cn>
parent 06656fc1
......@@ -120,7 +120,7 @@ static vpfe_obj vpfe_device = { /* the default format is NTSC */
},
.capture_params = {
.mode = VPFE_STD_AUTO,
.amuxmode = VPFE_AMUX_COMPOSITE,
.amuxmode = VPFE_AMUX_COMPOSITE0,
.enablebt656sync = TRUE,
.squarepixel = FALSE,
},
......@@ -609,7 +609,7 @@ static int vpfe_doioctl(struct inode *inode, struct file *file,
{
int *index = (int *)arg;
if (*index == VPFE_AMUX_COMPOSITE)
if (*index == VPFE_AMUX_COMPOSITE0 || *index == VPFE_AMUX_COMPOSITE1)
vpfe_select_capture_device(VPFE_CAPTURE_ID_TVP5150);
else if (*index == VPFE_AMUX_COMPONENT)
vpfe_select_capture_device(VPFE_CAPTURE_ID_TVP7000);
......@@ -974,7 +974,7 @@ static int vpfe_open(struct inode *inode, struct file *filep)
DEVICE_CMD(ACTIVE_DEVICE(), VIDIOC_QUERYSTD, &id);
up(&vpfe->lock);
if (id != V4L2_STD_UNKNOWN)
vpfe->capture_params.amuxmode = VPFE_AMUX_COMPOSITE;
vpfe->capture_params.amuxmode = VPFE_AMUX_COMPOSITE0;
else
{
/* no valid input for tvp5150 then try tvp7000
......@@ -985,7 +985,7 @@ static int vpfe_open(struct inode *inode, struct file *filep)
/* the device can be opened even without valid input
* so if no valid input, use a default one
*/
vpfe->capture_params.amuxmode = VPFE_AMUX_COMPOSITE;
vpfe->capture_params.amuxmode = VPFE_AMUX_COMPOSITE0;
}
}
......
......@@ -298,12 +298,15 @@ static inline void tvp5150_selmux(struct i2c_client *c)
if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable)
input = 8;
switch (decoder->route.input) {
case TVP5150_COMPOSITE1:
input |= 0;
/* fall through */
switch (decoder->route.input)
{
case TVP5150_COMPOSITE0:
opmode=0x30; /* TV Mode */
input |= 0;
opmode = 0x30; /* TV Mode */
break;
case TVP5150_COMPOSITE1:
input |= 0x02;
opmode = 0x30; /* TV Mode */
break;
case TVP5150_SVIDEO:
default:
......@@ -916,6 +919,8 @@ static int tvp5150_command(struct i2c_client *c,
{
int input = *(int *)arg;
if (input == 0)
decoder->route.input = TVP5150_COMPOSITE0;
else if (input == 1)
decoder->route.input = TVP5150_COMPOSITE1;
else
decoder->route.input = TVP5150_SVIDEO;
......@@ -1076,7 +1081,9 @@ static int tvp5150_command(struct i2c_client *c,
struct vpfe_capture_params *params =
(struct vpfe_capture_params *)arg;
if (params->amuxmode == VPFE_AMUX_COMPOSITE) {
if (params->amuxmode == VPFE_AMUX_COMPOSITE0) {
decoder->route.input = TVP5150_COMPOSITE0;
} else if (params->amuxmode == VPFE_AMUX_COMPOSITE1) {
decoder->route.input = TVP5150_COMPOSITE1;
} else {
decoder->route.input = TVP5150_SVIDEO;
......@@ -1139,7 +1146,7 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
rv = i2c_attach_client(tvp5150_client);
core->norm = V4L2_STD_ALL; /* Default is autodetect */
core->route.input = TVP5150_COMPOSITE1;
core->route.input = TVP5150_COMPOSITE0;
core->enable = 1;
core->bright = 32768;
core->contrast = 32768;
......
......@@ -40,8 +40,9 @@
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_COMPONENT 1
#define VPFE_AMUX_COMPOSITE0 0
#define VPFE_AMUX_COMPOSITE1 1
#define VPFE_AMUX_COMPONENT 2
/* settings for commonly used video formats */
#define VPFE_WIN_NTSC {0,0,720,480}
......
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