Ejemplo n.º 1
0
static int dvb_ca_open(struct inode *inode, struct file *file)
{
	struct dvb_device *dvbdev = file->private_data;
	struct av7110 *av7110 = dvbdev->priv;
	int err = dvb_generic_open(inode, file);

	dprintk(8, "av7110:%p\n",av7110);

	if (err < 0)
		return err;
	ci_ll_flush(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
	return 0;
}
Ejemplo n.º 2
0
static int audio_open(struct inode *inode, struct file *file)
{
	struct dvb_device *dvbdev = file->private_data;
	struct ngene_channel *chan = dvbdev->priv;
	struct ngene *dev = chan->dev;
	struct ngene_channel *chan2 = &chan->dev->channel[2];
	int ret;

	ret = dvb_generic_open(inode, file);
	if (ret < 0)
		return ret;
	dvb_ringbuffer_flush(&dev->ain_rbuf);

	chan2->Capture1Length = MAX_AUDIO_BUFFER_SIZE;
	chan2->pBufferExchange = ain_exchange;
	ngene_command_stream_control(chan2->dev, chan2->number, 0x80,
				     SMODE_AUDIO_CAPTURE, 0);
	return ret;
}
Ejemplo n.º 3
0
/*{{{  AudioOpen*/
static int AudioOpen (struct inode*     Inode,
                      struct file*      File)
{
    struct dvb_device*          DvbDevice       = (struct dvb_device*)File->private_data;
    struct DeviceContext_s*     Context         = (struct DeviceContext_s*)DvbDevice->priv;
    int                         Error;

    Error       = dvb_generic_open (Inode, File);
    if (Error < 0)
        return Error;

    if ((File->f_flags & O_ACCMODE) != O_RDONLY)
    {
        Context->AudioState.play_state  = AUDIO_STOPPED;
        Context->AudioOpenWrite         = 1;
    }

    return 0;

}
Ejemplo n.º 4
0
static int dvb_frontend_open (struct inode *inode, struct file *file)
{
	struct dvb_device *dvbdev = file->private_data;
	struct dvb_frontend *fe = dvbdev->priv;
	int ret;

	dprintk ("%s\n", __FUNCTION__);

	if ((ret = dvb_generic_open (inode, file)) < 0)
		return ret;

	if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
		ret = dvb_frontend_start (fe);
		if (ret)
			dvb_generic_release (inode, file);

		/*  empty event queue */
		fe->events.eventr = fe->events.eventw = 0;
	}
	
	return ret;
}
Ejemplo n.º 5
0
static int video_open(struct inode *inode, struct file *file)
{
	struct dvb_device *dvbdev = file->private_data;
	struct ngene_channel *chan = dvbdev->priv;
	struct ngene *dev = chan->dev;
	struct ngene_channel *chan0 = &chan->dev->channel[0];
	int ret;

	ret = dvb_generic_open(inode, file);
	if (ret < 0)
		return ret;
	if ((file->f_flags & O_ACCMODE) != O_RDONLY)
		return ret;
	dvb_ringbuffer_flush(&dev->vin_rbuf);

	chan0->nBytesPerLine = 1920 * 2;
	chan0->nLines = 540;
	chan0->Capture1Length = 1920 * 2 * 540;
	chan0->pBufferExchange = vcap_exchange;
	chan0->itumode = 2;
	ngene_command_stream_control(chan0->dev, chan0->number,
				     0x80, SMODE_VIDEO_CAPTURE, 0);
	return ret;
}