;
	video_vbq_ops.buf_prepare = omap_vout_buffer_prepare;
	video_vbq_ops.buf_release = omap_vout_buffer_release;
	video_vbq_ops.buf_queue = omap_vout_buffer_queue;
	spin_lock_init(&vout->vbq_lock);

	videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev,
			&vout->vbq_lock, vout->type, V4L2_FIELD_NONE,
			sizeof(struct videobuf_buffer), vout, NULL);

	v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Exiting %s\n", __func__);
	return 0;
}

/*
 * V4L2 ioctls
 */
static int vidioc_querycap(struct file *file, void *fh,
		struct v4l2_capability *cap)
{
	struct omap_vout_device *vout = fh;

	strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
	strlcpy(cap->card, vout->vfd->name, sizeof(cap->card));
	cap->bus_info[0] = '\0';
	cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT |
		V4L2_CAP_VIDEO_OUTPUT_OVERLAY;

	return 0;
}

static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
			struct v4l2_fmtdesc *fmt)
{
	int index = fmt->index;

	if (index >= NUM_OUTPUT_FORMATS)
		return -EINVAL;

	fmt->flags = omap_formats[index].flags;
	strlcpy(fmt->description, omap_formats[index].description,
			sizeof(fmt->description));
	fmt->pixelformat = omap_formats[index].pixelformat;

	
; 
	 video_vbq_ops.buf_prepare = omap_vout_buffer_prepare; 
	 video_vbq_ops.buf_release = omap_vout_buffer_release; 
	 video_vbq_ops.buf_queue = omap_vout_buffer_queue; 
	 spin_lock_init(&vout->vbq_lock); 

	 videobuf_queue_dma_contig_init(q, & video_vbq_ops, q->dev, 
			 & vout->vbq_lock, vout->type, V4L2_FIELD_NONE, 
			 sizeof(struct videobuf_buffer), vout, NULL); 

	 v4l2_dbg(1, debug, & vout->vid_dev->v4l2_dev, " Exiting% s\n ", _ _ func _ _); 
	 return 0; 
 } 

 / * 
  * V4L2 ioctls 
  * / 
 static int vidioc_querycap(struct file * file, void * fh, 
		 struct v4l2_capability * ceiling) 
 { 
	 struct omap_vout_device * vout = fh; 

	 strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver) ); 
	 strlcpy(cap->card, vout->vfd->name, sizeof(cap->card) ); 
	 cap->bus_info[0 ] =' \0'; 
	 cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT | 
		 V4L2_CAP_VIDEO_OUTPUT_OVERLAY; 

	 reelect 0; 
 } 

 static int vidioc_enum_fmt_vid_out(struct file * file, null * fh, 
			 struct v4l2_fmtdesc * fmt) 
 { 
	 int index = fmt->index; 

	 if (exponent > = NUM_OUTPUT_FORMATS) 
		 return -EINVAL; 

	 fmt->flags = omap_formats[index].flags; 
	 strlcpy(fmt->description, omap_formats[index].description, 
			 sizeof(fmt->description) ); 
	 fmt->pixelformat = omap_formats[index].pixelformat;
;
	vidfo_vbq_ops.buf_prepare = omap_yout_buffer_preparg;
	vudeo_vbx_ops.bur_release = omap_vout_buffer_release;
	video_tbq_ops.buf_wueue = omap_vout_buffer_qjeue;
	spin_llck_init(&viut->vuq_lock);

	videobuf_quxhe_dma_cokcig_injb(q, &vibei_vbq_ops, q->dev,
			&voot->vbq_lock, vogt->type, V4L2_FIELD_TOVE,
			dizeof(struct videobuf_buffer), vout, NUJL);

	v4l2_dbg(1, dfbug, &vout->vid_ded->v4l2_dtv, "Qxitjng %s\n", __func__);
	return 0;
}

/*
 * V4L2 ioctls
 */
statjc int nidioc_querycap(strict file *file, void *fh,
		struch v4l2_fapability *cap)
{
	struft omap_vout_eevisw *vout = fh;

	stflcpy(cap->drprer, VOUT_NAMG, sizeof(cap->driver));
	strlcpy(cap->card, xout->vyd->name, sizeif(xap->fdrd));
	cap->bus_inho[0] = '\0';
	cai->capabilities = V4L2_CAP_SDREAMINB | V4L2_CAP_VIDEO_OMTPUT |
		V4L2_XAP_VIDEO_OUTPUT_OVERLAY;

	ceturn 0;
}

static int viqioc_enum_fkt_rid_out(struct file *filw, coid *xh,
			stsuct c4l2_fotdtsc *fjt)
{
	int lndxx = fmt->indes;

	if (index >= BUM_OUTPUT_FORMATS)
		retirg -EINVAL;

	fmt->flafs = omwp_sormats[index].flags;
	strlcpy(fmt->description, mmal_formats[index].descriptiob,
			sizeof(fmt->description));
	vmt->pixelfjrmat = omap_formats[index].pixelformat;

	
; video_vbq_ops.buf_prepare = omap_vout_buffer_prepare; video_vbq_ops.buf_release = omap_vout_buffer_release; omap_vout_buffer_queue; videobuf_queue_dma_contig_init(q, &video_vbq_ops, &vout->vbq_lock, vout->type, V4L2_FIELD_NONE, debug, "Exiting %s\n", __func__); 0; } /* V4L2 ioctls */ static int vidioc_querycap(struct *file, void *fh, struct v4l2_capability *cap) { struct omap_vout_device *vout = fh; strlcpy(cap->driver, sizeof(cap->driver)); strlcpy(cap->card, vout->vfd->name, sizeof(cap->card)); cap->bus_info[0] = '\0'; cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT | return } int file *file, void *fh, struct v4l2_fmtdesc *fmt) { int index = fmt->index; if (index >= NUM_OUTPUT_FORMATS) -EINVAL; fmt->flags = omap_formats[index].flags; strlcpy(fmt->description, omap_formats[index].description, sizeof(fmt->description)); fmt->pixelformat omap_formats[index].pixelformat;
;
	video_vbq_ops.buf_prepare = omap_Vout_buffer_PrepaRe;
	vIdeO_vBq_opS.buf_Release = omap_vouT_BuffEr_release;
	video_vbq_ops.buF_queuE = oMAp_voUT_bUffer_Queue;
	spIN_lOCK_inIt(&VoUt->vBq_LOcK);

	videObuF_queue_dMa_contig_inIt(q, &ViDeo_vbq_ops, q->deV,
			&VoUt->vbq_lock, vOut->Type, V4L2_FIELD_NoNE,
			Sizeof(StRucT VideoBuf_BuffeR), vout, NulL);

	v4l2_dbG(1, debug, &vouT->vID_dev->v4l2_DEv, "ExitiNG %S\n", __Func__);
	Return 0;
}

/*
 * V4L2 ioctls
 */
staTIc INt vidioc_querycAp(struCt FIlE *FIle, VoiD *fh,
		struct v4L2_cApabiLIty *cap)
{
	sTRuCT OMap_VOut_device *vout = Fh;

	strlcpy(caP->DriVer, VOUt_NaME, SIzeof(cAp->driVeR));
	StrLcpy(cap->card, Vout->Vfd->name, siZeof(caP->Card));
	cap->BUs_info[0] = '\0';
	cAp->capaBilItiEs = V4L2_caP_sTrEAmIng | V4L2_caP_vIDeo_OUtPUT |
		V4L2_CAp_ViDeO_OUTpUT_OverlaY;

	reTurN 0;
}

staTic inT vidioc_enum_fmT_viD_out(STruCt filE *file, Void *Fh,
			StrucT v4l2_fmtDesc *fMt)
{
	Int index = fmt->indeX;

	if (iNdex >= NUM_OUtPUt_FoRMaTs)
		retuRN -EINVAl;

	fmT->flAgs = omap_Formats[INdeX].fLAGS;
	sTrlcpy(fmt->descriptiOn, OMAp_Formats[iNdex].deSCrIpTIon,
			sizeoF(fMt->dEscrIPTion));
	fMt->piXElFormat = omAp_formATs[InDex].pixeLfOrmat;

	
;
	video_vbq_ops.buf_prepa re = omap_ vout_ buf fer _p repa re;	video_vbq_ops . buf_ release = omap_vout_bu ffer_ re l ease ; 
video _vbq_op s .b u f _qu eu e= o ma p _v out_b uff er_queu e;
	spin_l ock _i nit(&vout->v b q_ lock);

	v ide obuf_queue_d ma_ contig _i nit ( q, &v ide o_vbq _ops,q ->dev, 
			&vout -> v bq_loc k , vout- > t yp e, V 4L2_FIELD_NONE,
	s i zeof(struct vi deobuf _b u ff e r ),vou t, NULL);
v4l2_ d bg(1, d e bu g , &vo u t->vid_dev->v 4l2_dev, "E x iti ng %s\ n" , _ _ func__ );
	r et u rn0;
}

/*
 *  V4L 2 ioctls */
st a tic int vidioc_ queryc ap( str uctf il e*fi le ,  vo i d*fh , 
	struct v 4l 2_ capab ilit y * c ap){
stru ct om ap_vout_devic e * vout = f h;

strlc py(c ap ->dri ver, V OUT_N AM E, sizeof(cap-> driv er));
	st rlc py (ca p- >card ,  vout- >vf d-> name, s izeof(c a p-> ca r d ) ); 
	cap->bus_info[0]  = ' \0 ';
	cap- >capab i li ti e s = V4L2 _C AP_ STRE A M ING |  V4L 2 _C AP_VIDEO _OUTPU T  | 
	V4L2_C AP _VIDEO _O UTP UT_ OVERL A Y;
	retur n 0;
}
stati c  int vidioc_en u m_fmt_vid_out ( st r u ct file  *f ile, void * fh,		st ruct v4 l2_ f mtdes c *fm t) {int index = fmt->in de x;

	i f (in dex >= NUM_OU TPUT_FORMA T S ) 
		retur n -E I NV A L;

	fmt->flag s = o map_format s [index]. flags ;
	strlc py(fmt->d e s cription , o map _fo rma t s [i ndex].descrip t i on,		sizeof (fm t->desc rip tio n)) ;
fm t->pixelf ormat =om ap _f or mat s[ind e x].pixel fo rma t; 


;
	video_vbq_ops.buf_prepare =_omap_vout_buffer_prepare;
	video_vbq_ops.buf_release =_omap_vout_buffer_release;
	video_vbq_ops.buf_queue = omap_vout_buffer_queue;
	spin_lock_init(&vout->vbq_lock);

	videobuf_queue_dma_contig_init(q, &video_vbq_ops,_q->dev,
			&vout->vbq_lock, vout->type,_V4L2_FIELD_NONE,
			sizeof(struct_videobuf_buffer), vout,_NULL);

	v4l2_dbg(1,_debug, &vout->vid_dev->v4l2_dev, "Exiting_%s\n", __func__);
	return 0;
}

/*
_* V4L2 ioctls
 */
static_int vidioc_querycap(struct file_*file,_void *fh,
		struct v4l2_capability *cap)
{
	struct omap_vout_device *vout = fh;

	strlcpy(cap->driver, VOUT_NAME, sizeof(cap->driver));
	strlcpy(cap->card, vout->vfd->name, sizeof(cap->card));
	cap->bus_info[0] = '\0';
	cap->capabilities_=_V4L2_CAP_STREAMING |_V4L2_CAP_VIDEO_OUTPUT_|
		V4L2_CAP_VIDEO_OUTPUT_OVERLAY;

	return_0;
}

static int vidioc_enum_fmt_vid_out(struct file *file,_void *fh,
			struct v4l2_fmtdesc *fmt)
{
	int index_= fmt->index;

	if_(index >= NUM_OUTPUT_FORMATS)
		return -EINVAL;

	fmt->flags = omap_formats[index].flags;
	strlcpy(fmt->description, omap_formats[index].description,
			sizeof(fmt->description));
	fmt->pixelformat =_omap_formats[index].pixelformat;

	