vidcom(av7110, VIDEO_CMD_FFWD, arg); av7110->trickmode = TRICK_FAST; av7110->videostate.play_state = VIDEO_PLAYING; 
ret = vidcom(av7110, VIDEO_CMD_FFWD, arg); if (!ret) { av7110->trickmode = TRICK_FAST; av7110->videostate.play_state = VIDEO_PLAYING; } 
static int dvb_video_ioctl(struct inode *inode, struct file *file,			   unsigned int cmd, void *parg){	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;	struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;	unsigned long arg = (unsigned long) parg;	int ret = 0;	dprintk(2, "av7110:%p, \n", av7110);	if ((file->f_flags & O_ACCMODE) == O_RDONLY) {		if ( cmd != VIDEO_GET_STATUS && cmd != VIDEO_GET_EVENT &&		     cmd != VIDEO_GET_SIZE ) {			return -EPERM;		}	}	switch (cmd) {	case VIDEO_STOP:		av7110->videostate.play_state = VIDEO_STOPPED;		if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)			av7110_av_stop(av7110, RP_VIDEO);		else			vidcom(av7110, VIDEO_CMD_STOP,			       av7110->videostate.video_blank ? 0 : 1);		av7110->trickmode = TRICK_NONE;		break;	case VIDEO_PLAY:		av7110->trickmode = TRICK_NONE;		if (av7110->videostate.play_state == VIDEO_FREEZED) {			av7110->videostate.play_state = VIDEO_PLAYING;			vidcom(av7110, VIDEO_CMD_PLAY, 0);		}		if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) {			if (av7110->playing == RP_AV) {				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);				av7110->playing &= ~RP_VIDEO;			}			av7110_av_start_play(av7110, RP_VIDEO);			vidcom(av7110, VIDEO_CMD_PLAY, 0);		} else {			//av7110_av_stop(av7110, RP_VIDEO);			vidcom(av7110, VIDEO_CMD_PLAY, 0);		}		av7110->videostate.play_state = VIDEO_PLAYING;		break;	case VIDEO_FREEZE:		av7110->videostate.play_state = VIDEO_FREEZED;		if (av7110->playing & RP_VIDEO)			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0);		else			vidcom(av7110, VIDEO_CMD_FREEZE, 1);		av7110->trickmode = TRICK_FREEZE;		break;	case VIDEO_CONTINUE:		if (av7110->playing & RP_VIDEO)			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0);		vidcom(av7110, VIDEO_CMD_PLAY, 0);		av7110->videostate.play_state = VIDEO_PLAYING;		av7110->trickmode = TRICK_NONE;		break;	case VIDEO_SELECT_SOURCE:		av7110->videostate.stream_source = (video_stream_source_t) arg;		break;	case VIDEO_SET_BLANK:		av7110->videostate.video_blank = (int) arg;		break;	case VIDEO_GET_STATUS:		memcpy(parg, &av7110->videostate, sizeof(struct video_status));		break;	case VIDEO_GET_EVENT:		ret=dvb_video_get_event(av7110, parg, file->f_flags);		break;	case VIDEO_GET_SIZE:		memcpy(parg, &av7110->video_size, sizeof(video_size_t));		break;	case VIDEO_SET_DISPLAY_FORMAT:	{		video_displayformat_t format = (video_displayformat_t) arg;		u16 val = 0;		switch (format) {		case VIDEO_PAN_SCAN:			val = VID_PAN_SCAN_PREF;			break;		case VIDEO_LETTER_BOX:			val = VID_VC_AND_PS_PREF;			break;		case VIDEO_CENTER_CUT_OUT:			val = VID_CENTRE_CUT_PREF;			break;		default:			ret = -EINVAL;		}		if (ret < 0)			break;		av7110->videostate.display_format = format;		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType,				    1, (u16) val);		break;	}	case VIDEO_SET_FORMAT:		if (arg > 1) {			ret = -EINVAL;			break;		}		av7110->display_ar = arg;		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetMonitorType,				    1, (u16) arg);		break;	case VIDEO_STILLPICTURE:	{		struct video_still_picture *pic =			(struct video_still_picture *) parg;		av7110->videostate.stream_source = VIDEO_SOURCE_MEMORY;		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);		ret = play_iframe(av7110, pic->iFrame, pic->size,				  file->f_flags & O_NONBLOCK);		break;	}	case VIDEO_FAST_FORWARD:		//note: arg is ignored by firmware		if (av7110->playing & RP_VIDEO)			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,				      __Scan_I, 2, AV_PES, 0);		else			vidcom(av7110, VIDEO_CMD_FFWD, arg);		av7110->trickmode = TRICK_FAST;		av7110->videostate.play_state = VIDEO_PLAYING;		break;	case VIDEO_SLOWMOTION:		if (av7110->playing&RP_VIDEO) {			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);			vidcom(av7110, VIDEO_CMD_SLOW, arg);		} else {			vidcom(av7110, VIDEO_CMD_PLAY, 0);			vidcom(av7110, VIDEO_CMD_STOP, 0);			vidcom(av7110, VIDEO_CMD_SLOW, arg);		}		av7110->trickmode = TRICK_SLOW;		av7110->videostate.play_state = VIDEO_PLAYING;		break;	case VIDEO_GET_CAPABILITIES:		*(int *)parg = VIDEO_CAP_MPEG1 | VIDEO_CAP_MPEG2 |			VIDEO_CAP_SYS | VIDEO_CAP_PROG;		break;	case VIDEO_CLEAR_BUFFER:		dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);		av7110_ipack_reset(&av7110->ipack[1]);		if (av7110->playing == RP_AV) {			av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,				      __Play, 2, AV_PES, 0);			if (av7110->trickmode == TRICK_FAST)				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,					      __Scan_I, 2, AV_PES, 0);			if (av7110->trickmode == TRICK_SLOW) {				av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,					      __Slow, 2, 0, 0);				vidcom(av7110, VIDEO_CMD_SLOW, arg);			}			if (av7110->trickmode == TRICK_FREEZE)				vidcom(av7110, VIDEO_CMD_STOP, 1);		}		break;	case VIDEO_SET_STREAMTYPE:		break;	default:		ret = -ENOIOCTLCMD;		break;	}	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ce18a223607b0e8cc9a8375abc64281a13ac423c/av7110_av.c/clean/drivers/media/dvb/ttpci/av7110_av.c