Lines Matching refs:fh
729 struct cx231xx_fh *fh = vq->priv_data; in buffer_setup() local
730 struct cx231xx *dev = fh->dev; in buffer_setup()
732 *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7)>>3; in buffer_setup()
748 struct cx231xx_fh *fh = vq->priv_data; in free_buffer() local
749 struct cx231xx *dev = fh->dev; in free_buffer()
781 struct cx231xx_fh *fh = vq->priv_data; in buffer_prepare() local
784 struct cx231xx *dev = fh->dev; in buffer_prepare()
788 buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth in buffer_prepare()
842 struct cx231xx_fh *fh = vq->priv_data; in buffer_queue() local
843 struct cx231xx *dev = fh->dev; in buffer_queue()
856 struct cx231xx_fh *fh = vq->priv_data; in buffer_release() local
857 struct cx231xx *dev = (struct cx231xx *)fh->dev; in buffer_release()
891 static int res_get(struct cx231xx_fh *fh) in res_get() argument
893 struct cx231xx *dev = fh->dev; in res_get()
897 if (fh->stream_on) in res_get()
900 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in res_get()
904 } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in res_get()
911 fh->stream_on = 1; in res_get()
916 static int res_check(struct cx231xx_fh *fh) in res_check() argument
918 return fh->stream_on; in res_check()
921 static void res_free(struct cx231xx_fh *fh) in res_free() argument
923 struct cx231xx *dev = fh->dev; in res_free()
925 fh->stream_on = 0; in res_free()
927 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in res_free()
929 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) in res_free()
949 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
950 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vid_cap()
978 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vid_cap() local
979 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vid_cap()
1011 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
1012 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vid_cap()
1029 if (videobuf_queue_is_busy(&fh->vb_vidq)) { in vidioc_s_fmt_vid_cap()
1034 if (dev->stream_on && !fh->stream_on) { in vidioc_s_fmt_vid_cap()
1054 struct cx231xx_fh *fh = priv; in vidioc_g_std() local
1055 struct cx231xx *dev = fh->dev; in vidioc_g_std()
1063 struct cx231xx_fh *fh = priv; in vidioc_s_std() local
1064 struct cx231xx *dev = fh->dev; in vidioc_s_std()
1077 if (videobuf_queue_is_busy(&fh->vb_vidq)) in vidioc_s_std()
1114 struct cx231xx_fh *fh = priv; in cx231xx_enum_input() local
1115 struct cx231xx *dev = fh->dev; in cx231xx_enum_input()
1154 struct cx231xx_fh *fh = priv; in cx231xx_g_input() local
1155 struct cx231xx *dev = fh->dev; in cx231xx_g_input()
1164 struct cx231xx_fh *fh = priv; in cx231xx_s_input() local
1165 struct cx231xx *dev = fh->dev; in cx231xx_s_input()
1193 struct cx231xx_fh *fh = priv; in cx231xx_g_tuner() local
1194 struct cx231xx *dev = fh->dev; in cx231xx_g_tuner()
1217 struct cx231xx_fh *fh = priv; in cx231xx_s_tuner() local
1218 struct cx231xx *dev = fh->dev; in cx231xx_s_tuner()
1236 struct cx231xx_fh *fh = priv; in cx231xx_g_frequency() local
1237 struct cx231xx *dev = fh->dev; in cx231xx_g_frequency()
1250 struct cx231xx_fh *fh = priv; in cx231xx_s_frequency() local
1251 struct cx231xx *dev = fh->dev; in cx231xx_s_frequency()
1307 int cx231xx_g_chip_info(struct file *file, void *fh, in cx231xx_g_chip_info() argument
1338 struct cx231xx_fh *fh = priv; in cx231xx_g_register() local
1339 struct cx231xx *dev = fh->dev; in cx231xx_g_register()
1397 struct cx231xx_fh *fh = priv; in cx231xx_s_register() local
1398 struct cx231xx *dev = fh->dev; in cx231xx_s_register()
1445 struct cx231xx_fh *fh = priv; in vidioc_cropcap() local
1446 struct cx231xx *dev = fh->dev; in vidioc_cropcap()
1465 struct cx231xx_fh *fh = priv; in vidioc_streamon() local
1466 struct cx231xx *dev = fh->dev; in vidioc_streamon()
1473 rc = res_get(fh); in vidioc_streamon()
1476 rc = videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1486 struct cx231xx_fh *fh = priv; in vidioc_streamoff() local
1487 struct cx231xx *dev = fh->dev; in vidioc_streamoff()
1494 if (type != fh->type) in vidioc_streamoff()
1499 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1500 res_free(fh); in vidioc_streamoff()
1509 struct cx231xx_fh *fh = priv; in cx231xx_querycap() local
1510 struct cx231xx *dev = fh->dev; in cx231xx_querycap()
1553 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vbi_cap() local
1554 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vbi_cap()
1576 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vbi_cap() local
1577 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vbi_cap()
1600 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vbi_cap() local
1601 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vbi_cap()
1603 if (dev->vbi_stream_on && !fh->stream_on) { in vidioc_s_fmt_vbi_cap()
1614 struct cx231xx_fh *fh = priv; in vidioc_reqbufs() local
1615 struct cx231xx *dev = fh->dev; in vidioc_reqbufs()
1622 return videobuf_reqbufs(&fh->vb_vidq, rb); in vidioc_reqbufs()
1627 struct cx231xx_fh *fh = priv; in vidioc_querybuf() local
1628 struct cx231xx *dev = fh->dev; in vidioc_querybuf()
1635 return videobuf_querybuf(&fh->vb_vidq, b); in vidioc_querybuf()
1640 struct cx231xx_fh *fh = priv; in vidioc_qbuf() local
1641 struct cx231xx *dev = fh->dev; in vidioc_qbuf()
1648 return videobuf_qbuf(&fh->vb_vidq, b); in vidioc_qbuf()
1653 struct cx231xx_fh *fh = priv; in vidioc_dqbuf() local
1654 struct cx231xx *dev = fh->dev; in vidioc_dqbuf()
1661 return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1702 struct cx231xx_fh *fh; in cx231xx_v4l2_open() local
1730 fh = kzalloc(sizeof(struct cx231xx_fh), GFP_KERNEL); in cx231xx_v4l2_open()
1731 if (!fh) in cx231xx_v4l2_open()
1734 kfree(fh); in cx231xx_v4l2_open()
1737 fh->dev = dev; in cx231xx_v4l2_open()
1738 fh->type = fh_type; in cx231xx_v4l2_open()
1739 filp->private_data = fh; in cx231xx_v4l2_open()
1740 v4l2_fh_init(&fh->fh, vdev); in cx231xx_v4l2_open()
1742 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { in cx231xx_v4l2_open()
1775 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in cx231xx_v4l2_open()
1776 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_video_qops, in cx231xx_v4l2_open()
1778 fh->type, V4L2_FIELD_INTERLACED, in cx231xx_v4l2_open()
1780 fh, &dev->lock); in cx231xx_v4l2_open()
1781 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_v4l2_open()
1786 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_vbi_qops, in cx231xx_v4l2_open()
1788 fh->type, V4L2_FIELD_SEQ_TB, in cx231xx_v4l2_open()
1790 fh, &dev->lock); in cx231xx_v4l2_open()
1793 v4l2_fh_add(&fh->fh); in cx231xx_v4l2_open()
1835 struct cx231xx_fh *fh = filp->private_data; in cx231xx_close() local
1836 struct cx231xx *dev = fh->dev; in cx231xx_close()
1841 if (res_check(fh)) in cx231xx_close()
1842 res_free(fh); in cx231xx_close()
1851 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_close()
1852 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
1853 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
1860 fh->dev = NULL; in cx231xx_close()
1875 v4l2_fh_del(&fh->fh); in cx231xx_close()
1876 v4l2_fh_exit(&fh->fh); in cx231xx_close()
1877 kfree(fh); in cx231xx_close()
1883 v4l2_fh_del(&fh->fh); in cx231xx_close()
1886 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
1887 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
1893 fh->dev = NULL; in cx231xx_close()
1910 v4l2_fh_exit(&fh->fh); in cx231xx_close()
1911 kfree(fh); in cx231xx_close()
1918 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_close() local
1919 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_close()
1936 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_read() local
1937 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_read()
1944 if ((fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) || in cx231xx_v4l2_read()
1945 (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)) { in cx231xx_v4l2_read()
1946 rc = res_get(fh); in cx231xx_v4l2_read()
1953 rc = videobuf_read_stream(&fh->vb_vidq, buf, count, pos, 0, in cx231xx_v4l2_read()
1968 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_poll() local
1969 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_poll()
1977 rc = res_get(fh); in cx231xx_v4l2_poll()
1982 if (v4l2_event_pending(&fh->fh)) in cx231xx_v4l2_poll()
1985 poll_wait(filp, &fh->fh.wait, wait); in cx231xx_v4l2_poll()
1990 if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) || in cx231xx_v4l2_poll()
1991 (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)) { in cx231xx_v4l2_poll()
1993 res |= videobuf_poll_stream(filp, &fh->vb_vidq, wait); in cx231xx_v4l2_poll()
2005 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_mmap() local
2006 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_mmap()
2013 rc = res_get(fh); in cx231xx_v4l2_mmap()
2020 rc = videobuf_mmap_mapper(&fh->vb_vidq, vma); in cx231xx_v4l2_mmap()