• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/cx25821/

Lines Matching refs:fh

221 int cx25821_res_get(struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bit)
224 if (fh->resources & bit)
230 if (dev->channels[fh->channel_id].resources & bit) {
236 fh->resources |= bit;
237 dev->channels[fh->channel_id].resources |= bit;
243 int cx25821_res_check(struct cx25821_fh *fh, unsigned int bit)
245 return fh->resources & bit;
248 int cx25821_res_locked(struct cx25821_fh *fh, unsigned int bit)
250 return fh->dev->channels[fh->channel_id].resources & bit;
253 void cx25821_res_free(struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bits)
255 BUG_ON((fh->resources & bits) != bits);
259 fh->resources &= ~bits;
260 dev->channels[fh->channel_id].resources &= ~bits;
543 struct cx25821_fh *fh = q->priv_data;
545 *size = fh->fmt->depth * fh->width * fh->height >> 3;
559 struct cx25821_fh *fh = q->priv_data;
560 struct cx25821_dev *dev = fh->dev;
567 int channel_opened = fh->channel_id;
569 BUG_ON(NULL == fh->fmt);
570 if (fh->width < 48 || fh->width > 720 ||
571 fh->height < 32 || fh->height > 576)
574 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3;
579 if (buf->fmt != fh->fmt ||
580 buf->vb.width != fh->width ||
581 buf->vb.height != fh->height || buf->vb.field != field) {
582 buf->fmt = fh->fmt;
583 buf->vb.width = fh->width;
584 buf->vb.height = fh->height;
673 buf, buf->vb.i, fh->width, fh->height, fh->fmt->depth,
674 fh->fmt->name, (unsigned long)buf->risc.dma);
693 struct videobuf_queue *get_queue(struct cx25821_fh *fh)
695 switch (fh->type) {
697 return &fh->vidq;
704 int cx25821_get_resource(struct cx25821_fh *fh, int resource)
706 switch (fh->type) {
717 struct cx25821_fh *fh = file->private_data;
719 return videobuf_mmap_mapper(get_queue(fh), vma);
728 struct cx25821_fh *fh = vq->priv_data;
729 struct cx25821_dev *dev = fh->dev;
730 struct cx25821_dmaqueue *q = &dev->channels[fh->channel_id].vidq;
748 dev->channels[fh->channel_id].
798 struct cx25821_fh *fh;
811 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
812 if (NULL == fh)
836 file->private_data = fh;
837 fh->dev = dev;
838 fh->type = type;
839 fh->width = 720;
840 fh->channel_id = ch_id;
843 fh->height = 576;
845 fh->height = 480;
847 dev->channel_opened = fh->channel_id;
851 fh->fmt = cx25821_format_by_fourcc(pix_format);
853 v4l2_prio_open(&dev->channels[ch_id].prio, &fh->prio);
855 videobuf_queue_sg_init(&fh->vidq, &cx25821_video_qops,
859 sizeof(struct cx25821_buffer), fh);
870 struct cx25821_fh *fh = file->private_data;
872 switch (fh->type) {
874 if (cx25821_res_locked(fh, RESOURCE_VIDEO0))
877 return videobuf_read_one(&fh->vidq, data, count, ppos,
889 struct cx25821_fh *fh = file->private_data;
892 if (cx25821_res_check(fh, RESOURCE_VIDEO0)) {
894 if (list_empty(&fh->vidq.stream))
896 buf = list_entry(fh->vidq.stream.next,
900 buf = (struct cx25821_buffer *)fh->vidq.read_buf;
908 struct cx25821_dev *dev = fh->dev;
910 if (dev && dev->channels[fh->channel_id]
914 (char *)buf->vb.baddr + (fh->width * 2),
915 (fh->width * 2));
928 struct cx25821_fh *fh = file->private_data;
929 struct cx25821_dev *dev = fh->dev;
935 if (cx25821_res_check(fh, RESOURCE_VIDEO0)) {
936 videobuf_queue_cancel(&fh->vidq);
937 cx25821_res_free(dev, fh, RESOURCE_VIDEO0);
940 if (fh->vidq.read_buf) {
941 cx25821_buffer_release(&fh->vidq, fh->vidq.read_buf);
942 kfree(fh->vidq.read_buf);
945 videobuf_mmap_free(&fh->vidq);
947 v4l2_prio_close(&dev->channels[fh->channel_id].prio, fh->prio);
949 kfree(fh);
956 struct cx25821_fh *fh = priv;
957 struct cx25821_dev *dev = fh->dev;
959 if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE))
962 if (unlikely(i != fh->type))
965 if (unlikely(!cx25821_res_get(dev, fh,
966 cx25821_get_resource(fh, RESOURCE_VIDEO0))))
969 return videobuf_streamon(get_queue(fh));
974 struct cx25821_fh *fh = priv;
975 struct cx25821_dev *dev = fh->dev;
978 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
980 if (i != fh->type)
983 res = cx25821_get_resource(fh, RESOURCE_VIDEO0);
984 err = videobuf_streamoff(get_queue(fh));
987 cx25821_res_free(dev, fh, res);
994 struct cx25821_fh *fh = priv;
999 if (fh) {
1000 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1001 .prio, fh->prio);
1012 fh->fmt = cx25821_format_by_fourcc(f->fmt.pix.pixelformat);
1013 fh->vidq.field = f->fmt.pix.field;
1017 fh->width = f->fmt.pix.width;
1020 fh->height = f->fmt.pix.height;
1032 if (fh->width == 320 || fh->width == 352)
1033 dev->channels[fh->channel_id].use_cif_resolution = 1;
1035 dev->channels[fh->channel_id].use_cif_resolution = 0;
1037 dev->channels[fh->channel_id].cif_width = fh->width;
1038 medusa_set_resolution(dev, fh->width, SRAM_CH00);
1040 dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, fh->width,
1041 fh->height, fh->vidq.field);
1050 struct cx25821_fh *fh = priv;
1053 ret_val = videobuf_dqbuf(get_queue(fh), p, file->f_flags & O_NONBLOCK);
1055 p->sequence = dev->channels[fh->channel_id].vidq.count;
1063 struct cx25821_fh *fh = priv;
1066 struct sram_channel *sram_ch = dev->channels[fh->channel_id]
1085 struct cx25821_fh *fh = priv;
1089 if (fh) {
1090 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1091 .prio, fh->prio);
1096 return cx25821_set_control(dev, ctl, fh->channel_id);
1102 struct cx25821_fh *fh = priv;
1104 f->fmt.pix.width = fh->width;
1105 f->fmt.pix.height = fh->height;
1106 f->fmt.pix.field = fh->vidq.field;
1107 f->fmt.pix.pixelformat = fh->fmt->fourcc;
1108 f->fmt.pix.bytesperline = (f->fmt.pix.width * fh->fmt->depth) >> 3;
1190 struct cx25821_fh *fh = priv;
1196 q = get_queue(fh);
1217 struct cx25821_fh *fh = priv;
1218 return videobuf_reqbufs(get_queue(fh), p);
1223 struct cx25821_fh *fh = priv;
1224 return videobuf_querybuf(get_queue(fh), p);
1229 struct cx25821_fh *fh = priv;
1230 return videobuf_qbuf(get_queue(fh), p);
1236 struct cx25821_fh *fh = f;
1238 *p = v4l2_prio_max(&dev->channels[fh->channel_id].prio);
1245 struct cx25821_fh *fh = f;
1248 return v4l2_prio_change(&dev->channels[fh->channel_id]
1249 .prio, &fh->prio, prio);
1255 struct cx25821_fh *fh = priv;
1261 if (fh) {
1262 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1263 .prio, fh->prio);
1326 struct cx25821_fh *fh = priv;
1332 if (fh) {
1333 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1334 .prio, fh->prio);
1353 struct cx25821_fh *fh = priv;
1354 struct cx25821_dev *dev = fh->dev;
1380 struct cx25821_fh *fh = priv;
1384 if (fh) {
1385 dev = fh->dev;
1386 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1387 .prio, fh->prio);
1391 printk(KERN_ERR "Invalid fh pointer!\n");
1400 int cx25821_vidioc_g_register(struct file *file, void *fh,
1403 struct cx25821_dev *dev = ((struct cx25821_fh *)fh)->dev;
1413 int cx25821_vidioc_s_register(struct file *file, void *fh,
1416 struct cx25821_dev *dev = ((struct cx25821_fh *)fh)->dev;
1450 struct cx25821_fh *fh = priv;
1453 if (fh) {
1454 err = v4l2_prio_check(&dev->channels[fh->channel_id]
1455 .prio, fh->prio);
1553 struct cx25821_fh *fh = priv;
1563 ctl->value = dev->channels[fh->channel_id].ctl_bright;
1566 ctl->value = dev->channels[fh->channel_id].ctl_hue;
1569 ctl->value = dev->channels[fh->channel_id].ctl_contrast;
1572 ctl->value = dev->channels[fh->channel_id].ctl_saturation;
1660 struct cx25821_fh *fh = priv;
1663 if (fh) {
1664 err = v4l2_prio_check(&dev->channels[fh->channel_id].
1665 prio, fh->prio);
1727 struct cx25821_fh *fh = file->private_data;
1728 struct cx25821_dev *dev = fh->dev;
1770 struct cx25821_fh *fh = file->private_data;
1771 struct cx25821_dev *dev = fh->dev;
1813 struct cx25821_fh *fh = file->private_data;
1814 struct cx25821_dev *dev = fh->dev;
1856 struct cx25821_fh *fh = file->private_data;
1857 struct cx25821_dev *dev = fh->dev;
1966 struct cx25821_fh *fh = file->private_data;
1969 if (fh->channel_id == SRAM_CH09) {
1972 } else if (fh->channel_id == SRAM_CH10) {
1975 } else if (fh->channel_id == SRAM_CH11) {