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()
782 struct cx231xx_fh *fh = vq->priv_data; in buffer_prepare() local
785 struct cx231xx *dev = fh->dev; in buffer_prepare()
789 buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth in buffer_prepare()
843 struct cx231xx_fh *fh = vq->priv_data; in buffer_queue() local
844 struct cx231xx *dev = fh->dev; in buffer_queue()
857 struct cx231xx_fh *fh = vq->priv_data; in buffer_release() local
858 struct cx231xx *dev = (struct cx231xx *)fh->dev; in buffer_release()
892 static int res_get(struct cx231xx_fh *fh) in res_get() argument
894 struct cx231xx *dev = fh->dev; in res_get()
898 if (fh->stream_on) in res_get()
901 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in res_get()
905 } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in res_get()
912 fh->stream_on = 1; in res_get()
917 static int res_check(struct cx231xx_fh *fh) in res_check() argument
919 return fh->stream_on; in res_check()
922 static void res_free(struct cx231xx_fh *fh) in res_free() argument
924 struct cx231xx *dev = fh->dev; in res_free()
926 fh->stream_on = 0; in res_free()
928 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in res_free()
930 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) in res_free()
950 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
951 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vid_cap()
979 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vid_cap() local
980 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vid_cap()
1012 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
1013 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vid_cap()
1028 if (videobuf_queue_is_busy(&fh->vb_vidq)) { in vidioc_s_fmt_vid_cap()
1033 if (dev->stream_on && !fh->stream_on) { in vidioc_s_fmt_vid_cap()
1053 struct cx231xx_fh *fh = priv; in vidioc_g_std() local
1054 struct cx231xx *dev = fh->dev; in vidioc_g_std()
1062 struct cx231xx_fh *fh = priv; in vidioc_s_std() local
1063 struct cx231xx *dev = fh->dev; in vidioc_s_std()
1074 if (videobuf_queue_is_busy(&fh->vb_vidq)) in vidioc_s_std()
1112 struct cx231xx_fh *fh = priv; in cx231xx_enum_input() local
1113 struct cx231xx *dev = fh->dev; in cx231xx_enum_input()
1151 struct cx231xx_fh *fh = priv; in cx231xx_g_input() local
1152 struct cx231xx *dev = fh->dev; in cx231xx_g_input()
1161 struct cx231xx_fh *fh = priv; in cx231xx_s_input() local
1162 struct cx231xx *dev = fh->dev; in cx231xx_s_input()
1190 struct cx231xx_fh *fh = priv; in cx231xx_g_tuner() local
1191 struct cx231xx *dev = fh->dev; in cx231xx_g_tuner()
1214 struct cx231xx_fh *fh = priv; in cx231xx_s_tuner() local
1215 struct cx231xx *dev = fh->dev; in cx231xx_s_tuner()
1233 struct cx231xx_fh *fh = priv; in cx231xx_g_frequency() local
1234 struct cx231xx *dev = fh->dev; in cx231xx_g_frequency()
1247 struct cx231xx_fh *fh = priv; in cx231xx_s_frequency() local
1248 struct cx231xx *dev = fh->dev; in cx231xx_s_frequency()
1304 int cx231xx_g_chip_info(struct file *file, void *fh, in cx231xx_g_chip_info() argument
1335 struct cx231xx_fh *fh = priv; in cx231xx_g_register() local
1336 struct cx231xx *dev = fh->dev; in cx231xx_g_register()
1394 struct cx231xx_fh *fh = priv; in cx231xx_s_register() local
1395 struct cx231xx *dev = fh->dev; in cx231xx_s_register()
1442 struct cx231xx_fh *fh = priv; in vidioc_cropcap() local
1443 struct cx231xx *dev = fh->dev; in vidioc_cropcap()
1462 struct cx231xx_fh *fh = priv; in vidioc_streamon() local
1463 struct cx231xx *dev = fh->dev; in vidioc_streamon()
1470 rc = res_get(fh); in vidioc_streamon()
1473 rc = videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1483 struct cx231xx_fh *fh = priv; in vidioc_streamoff() local
1484 struct cx231xx *dev = fh->dev; in vidioc_streamoff()
1491 if (type != fh->type) in vidioc_streamoff()
1496 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1497 res_free(fh); in vidioc_streamoff()
1506 struct cx231xx_fh *fh = priv; in cx231xx_querycap() local
1507 struct cx231xx *dev = fh->dev; in cx231xx_querycap()
1550 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vbi_cap() local
1551 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vbi_cap()
1573 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vbi_cap() local
1574 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vbi_cap()
1597 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vbi_cap() local
1598 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vbi_cap()
1600 if (dev->vbi_stream_on && !fh->stream_on) { in vidioc_s_fmt_vbi_cap()
1611 struct cx231xx_fh *fh = priv; in vidioc_reqbufs() local
1612 struct cx231xx *dev = fh->dev; in vidioc_reqbufs()
1619 return videobuf_reqbufs(&fh->vb_vidq, rb); in vidioc_reqbufs()
1624 struct cx231xx_fh *fh = priv; in vidioc_querybuf() local
1625 struct cx231xx *dev = fh->dev; in vidioc_querybuf()
1632 return videobuf_querybuf(&fh->vb_vidq, b); in vidioc_querybuf()
1637 struct cx231xx_fh *fh = priv; in vidioc_qbuf() local
1638 struct cx231xx *dev = fh->dev; in vidioc_qbuf()
1645 return videobuf_qbuf(&fh->vb_vidq, b); in vidioc_qbuf()
1650 struct cx231xx_fh *fh = priv; in vidioc_dqbuf() local
1651 struct cx231xx *dev = fh->dev; in vidioc_dqbuf()
1658 return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1699 struct cx231xx_fh *fh; in cx231xx_v4l2_open() local
1727 fh = kzalloc(sizeof(struct cx231xx_fh), GFP_KERNEL); in cx231xx_v4l2_open()
1728 if (!fh) in cx231xx_v4l2_open()
1731 kfree(fh); in cx231xx_v4l2_open()
1734 fh->dev = dev; in cx231xx_v4l2_open()
1735 fh->type = fh_type; in cx231xx_v4l2_open()
1736 filp->private_data = fh; in cx231xx_v4l2_open()
1737 v4l2_fh_init(&fh->fh, vdev); in cx231xx_v4l2_open()
1739 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { in cx231xx_v4l2_open()
1772 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in cx231xx_v4l2_open()
1773 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_video_qops, in cx231xx_v4l2_open()
1775 fh->type, V4L2_FIELD_INTERLACED, in cx231xx_v4l2_open()
1777 fh, &dev->lock); in cx231xx_v4l2_open()
1778 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_v4l2_open()
1783 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_vbi_qops, in cx231xx_v4l2_open()
1785 fh->type, V4L2_FIELD_SEQ_TB, in cx231xx_v4l2_open()
1787 fh, &dev->lock); in cx231xx_v4l2_open()
1790 v4l2_fh_add(&fh->fh); in cx231xx_v4l2_open()
1832 struct cx231xx_fh *fh = filp->private_data; in cx231xx_close() local
1833 struct cx231xx *dev = fh->dev; in cx231xx_close()
1838 if (res_check(fh)) in cx231xx_close()
1839 res_free(fh); in cx231xx_close()
1848 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_close()
1849 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
1850 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
1857 fh->dev = NULL; in cx231xx_close()
1872 v4l2_fh_del(&fh->fh); in cx231xx_close()
1873 v4l2_fh_exit(&fh->fh); in cx231xx_close()
1874 kfree(fh); in cx231xx_close()
1880 v4l2_fh_del(&fh->fh); in cx231xx_close()
1883 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
1884 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
1890 fh->dev = NULL; in cx231xx_close()
1907 v4l2_fh_exit(&fh->fh); in cx231xx_close()
1908 kfree(fh); in cx231xx_close()
1915 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_close() local
1916 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_close()
1933 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_read() local
1934 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_read()
1941 if ((fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) || in cx231xx_v4l2_read()
1942 (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)) { in cx231xx_v4l2_read()
1943 rc = res_get(fh); in cx231xx_v4l2_read()
1950 rc = videobuf_read_stream(&fh->vb_vidq, buf, count, pos, 0, in cx231xx_v4l2_read()
1965 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_poll() local
1966 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_poll()
1974 rc = res_get(fh); in cx231xx_v4l2_poll()
1979 if (v4l2_event_pending(&fh->fh)) in cx231xx_v4l2_poll()
1982 poll_wait(filp, &fh->fh.wait, wait); in cx231xx_v4l2_poll()
1987 if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) || in cx231xx_v4l2_poll()
1988 (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)) { in cx231xx_v4l2_poll()
1990 res |= videobuf_poll_stream(filp, &fh->vb_vidq, wait); in cx231xx_v4l2_poll()
2002 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_mmap() local
2003 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_mmap()
2010 rc = res_get(fh); in cx231xx_v4l2_mmap()
2017 rc = videobuf_mmap_mapper(&fh->vb_vidq, vma); in cx231xx_v4l2_mmap()