Commit 4714bf5c authored by 邱宗炽's avatar 邱宗炽

auto detect the signal input

remove the ioctl of active device.
Auto detect the sinal input when open the device. tvp5150 work.
tvp7000 need be added after it's driver be implemented.
Signed-off-by: default avatar邱宗炽 <tqiu@neuros.com.cn>
parent d4fa0c9e
...@@ -907,12 +907,6 @@ static int vpfe_doioctl(struct inode *inode, struct file *file, ...@@ -907,12 +907,6 @@ static int vpfe_doioctl(struct inode *inode, struct file *file,
up(&vpfe->lock); up(&vpfe->lock);
break; break;
} }
case VPFE_CMD_CAPTURE_ACTIVE:
{
int device_id = *((int *)arg);
ret = vpfe_select_capture_device(device_id);
break;
}
default: default:
ret = -ENOIOCTLCMD; ret = -ENOIOCTLCMD;
break; break;
...@@ -963,6 +957,30 @@ static int vpfe_open(struct inode *inode, struct file *filep) ...@@ -963,6 +957,30 @@ static int vpfe_open(struct inode *inode, struct file *filep)
v4l2_prio_open(&vpfe->prio, &fh->prio); v4l2_prio_open(&vpfe->prio, &fh->prio);
vpfe->usrs++; vpfe->usrs++;
/* active the tvp5150 */
vpfe_select_capture_device(VPFE_CAPTURE_ID_TVP5150);
/* detect if there is valid signal input */
{
v4l2_std_id *id;
*id = 0;
down_interruptible(&vpfe->lock);
DEVICE_CMD(ACTIVE_DEVICE(), VIDIOC_QUERYSTD, id);
up(&vpfe->lock);
if (*id == V4L2_STD_UNKNOWN)
{
/* no valid input for tvp5150 then try tvp7000
* activate the tvp7000, and detect if there is valid input
* Todo after tvp7000 driver available.
*/
debug_print(KERN_INFO "no valid signal input\n");
/* 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;
}
}
return 0; return 0;
} }
......
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