Beispiel #1
0
/* Ensure the dif is in the correct state for the operating mode
 * (analog / dtv). We only configure the diff through the analog encoder
 * so when we're in digital mode we need to find the appropriate encoder
 * and use it to configure the DIF.
 */
int saa7164_api_initialize_dif(struct saa7164_port *port)
{
	struct saa7164_dev *dev = port->dev;
	struct saa7164_port *p = NULL;
	int ret = -EINVAL;
	u32 std = 0;

	dprintk(DBGLVL_API, "%s(nr=%d type=%d)\n", __func__,
		port->nr, port->type);

	if (port->type == SAA7164_MPEG_ENCODER) {
		/* Pick any analog standard to init the diff.
		 * we'll come back during encoder_init'
		 * and set the correct standard if requried.
		 */
		std = V4L2_STD_NTSC;
	} else
	if (port->type == SAA7164_MPEG_DVB) {
		if (port->nr == SAA7164_PORT_TS1)
			p = &dev->ports[SAA7164_PORT_ENC1];
		else
			p = &dev->ports[SAA7164_PORT_ENC2];
	} else
	if (port->type == SAA7164_MPEG_VBI) {
		std = V4L2_STD_NTSC;
		if (port->nr == SAA7164_PORT_VBI1)
			p = &dev->ports[SAA7164_PORT_ENC1];
		else
			p = &dev->ports[SAA7164_PORT_ENC2];
	} else
		BUG();

	if (p)
		ret = saa7164_api_configure_dif(p, std);

	return ret;
}
int saa7164_api_initialize_dif(struct saa7164_port *port)
{
	struct saa7164_dev *dev = port->dev;
	struct saa7164_port *p = NULL;
	int ret = -EINVAL;
	u32 std = 0;

	dprintk(DBGLVL_API, "%s(nr=%d type=%d)\n", __func__,
		port->nr, port->type);

	if (port->type == SAA7164_MPEG_ENCODER) {
		/*                                           
                                         
                                              
   */
		std = V4L2_STD_NTSC;
	} else
	if (port->type == SAA7164_MPEG_DVB) {
		if (port->nr == SAA7164_PORT_TS1)
			p = &dev->ports[SAA7164_PORT_ENC1];
		else
			p = &dev->ports[SAA7164_PORT_ENC2];
	} else
	if (port->type == SAA7164_MPEG_VBI) {
		std = V4L2_STD_NTSC;
		if (port->nr == SAA7164_PORT_VBI1)
			p = &dev->ports[SAA7164_PORT_ENC1];
		else
			p = &dev->ports[SAA7164_PORT_ENC2];
	} else
		BUG();

	if (p)
		ret = saa7164_api_configure_dif(p, std);

	return ret;
}