Lines Matching refs:fh
663 struct cx231xx_fh *fh = vq->priv_data; in buffer_setup() local
664 struct cx231xx *dev = fh->dev; in buffer_setup()
666 *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7)>>3; in buffer_setup()
679 struct cx231xx_fh *fh = vq->priv_data; in free_buffer() local
680 struct cx231xx *dev = fh->dev; in free_buffer()
713 struct cx231xx_fh *fh = vq->priv_data; in buffer_prepare() local
716 struct cx231xx *dev = fh->dev; in buffer_prepare()
720 buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth in buffer_prepare()
772 struct cx231xx_fh *fh = vq->priv_data; in buffer_queue() local
773 struct cx231xx *dev = fh->dev; in buffer_queue()
786 struct cx231xx_fh *fh = vq->priv_data; in buffer_release() local
787 struct cx231xx *dev = (struct cx231xx *)fh->dev; in buffer_release()
821 static int res_get(struct cx231xx_fh *fh) in res_get() argument
823 struct cx231xx *dev = fh->dev; in res_get()
827 if (fh->stream_on) in res_get()
830 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in res_get()
834 } else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in res_get()
841 fh->stream_on = 1; in res_get()
846 static int res_check(struct cx231xx_fh *fh) in res_check() argument
848 return fh->stream_on; in res_check()
851 static void res_free(struct cx231xx_fh *fh) in res_free() argument
853 struct cx231xx *dev = fh->dev; in res_free()
855 fh->stream_on = 0; in res_free()
857 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in res_free()
859 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) in res_free()
879 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
880 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vid_cap()
909 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vid_cap() local
910 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vid_cap()
943 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
944 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vid_cap()
959 if (videobuf_queue_is_busy(&fh->vb_vidq)) { in vidioc_s_fmt_vid_cap()
964 if (dev->stream_on && !fh->stream_on) { in vidioc_s_fmt_vid_cap()
983 struct cx231xx_fh *fh = priv; in vidioc_g_std() local
984 struct cx231xx *dev = fh->dev; in vidioc_g_std()
992 struct cx231xx_fh *fh = priv; in vidioc_s_std() local
993 struct cx231xx *dev = fh->dev; in vidioc_s_std()
1004 if (videobuf_queue_is_busy(&fh->vb_vidq)) in vidioc_s_std()
1042 struct cx231xx_fh *fh = priv; in cx231xx_enum_input() local
1043 struct cx231xx *dev = fh->dev; in cx231xx_enum_input()
1081 struct cx231xx_fh *fh = priv; in cx231xx_g_input() local
1082 struct cx231xx *dev = fh->dev; in cx231xx_g_input()
1091 struct cx231xx_fh *fh = priv; in cx231xx_s_input() local
1092 struct cx231xx *dev = fh->dev; in cx231xx_s_input()
1120 struct cx231xx_fh *fh = priv; in cx231xx_g_tuner() local
1121 struct cx231xx *dev = fh->dev; in cx231xx_g_tuner()
1144 struct cx231xx_fh *fh = priv; in cx231xx_s_tuner() local
1145 struct cx231xx *dev = fh->dev; in cx231xx_s_tuner()
1163 struct cx231xx_fh *fh = priv; in cx231xx_g_frequency() local
1164 struct cx231xx *dev = fh->dev; in cx231xx_g_frequency()
1177 struct cx231xx_fh *fh = priv; in cx231xx_s_frequency() local
1178 struct cx231xx *dev = fh->dev; in cx231xx_s_frequency()
1231 int cx231xx_g_chip_ident(struct file *file, void *fh, in cx231xx_g_chip_ident() argument
1262 struct cx231xx_fh *fh = priv; in cx231xx_g_register() local
1263 struct cx231xx *dev = fh->dev; in cx231xx_g_register()
1409 struct cx231xx_fh *fh = priv; in cx231xx_s_register() local
1410 struct cx231xx *dev = fh->dev; in cx231xx_s_register()
1576 struct cx231xx_fh *fh = priv; in vidioc_cropcap() local
1577 struct cx231xx *dev = fh->dev; in vidioc_cropcap()
1596 struct cx231xx_fh *fh = priv; in vidioc_streamon() local
1597 struct cx231xx *dev = fh->dev; in vidioc_streamon()
1604 rc = res_get(fh); in vidioc_streamon()
1607 rc = videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1617 struct cx231xx_fh *fh = priv; in vidioc_streamoff() local
1618 struct cx231xx *dev = fh->dev; in vidioc_streamoff()
1625 if (type != fh->type) in vidioc_streamoff()
1630 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1631 res_free(fh); in vidioc_streamoff()
1640 struct cx231xx_fh *fh = priv; in cx231xx_querycap() local
1641 struct cx231xx *dev = fh->dev; in cx231xx_querycap()
1684 struct cx231xx_fh *fh = priv; in vidioc_g_fmt_vbi_cap() local
1685 struct cx231xx *dev = fh->dev; in vidioc_g_fmt_vbi_cap()
1707 struct cx231xx_fh *fh = priv; in vidioc_try_fmt_vbi_cap() local
1708 struct cx231xx *dev = fh->dev; in vidioc_try_fmt_vbi_cap()
1731 struct cx231xx_fh *fh = priv; in vidioc_s_fmt_vbi_cap() local
1732 struct cx231xx *dev = fh->dev; in vidioc_s_fmt_vbi_cap()
1734 if (dev->vbi_stream_on && !fh->stream_on) { in vidioc_s_fmt_vbi_cap()
1744 struct cx231xx_fh *fh = priv; in vidioc_reqbufs() local
1745 struct cx231xx *dev = fh->dev; in vidioc_reqbufs()
1752 return videobuf_reqbufs(&fh->vb_vidq, rb); in vidioc_reqbufs()
1757 struct cx231xx_fh *fh = priv; in vidioc_querybuf() local
1758 struct cx231xx *dev = fh->dev; in vidioc_querybuf()
1765 return videobuf_querybuf(&fh->vb_vidq, b); in vidioc_querybuf()
1770 struct cx231xx_fh *fh = priv; in vidioc_qbuf() local
1771 struct cx231xx *dev = fh->dev; in vidioc_qbuf()
1778 return videobuf_qbuf(&fh->vb_vidq, b); in vidioc_qbuf()
1783 struct cx231xx_fh *fh = priv; in vidioc_dqbuf() local
1784 struct cx231xx *dev = fh->dev; in vidioc_dqbuf()
1791 return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1832 struct cx231xx_fh *fh; in cx231xx_v4l2_open() local
1860 fh = kzalloc(sizeof(struct cx231xx_fh), GFP_KERNEL); in cx231xx_v4l2_open()
1861 if (!fh) { in cx231xx_v4l2_open()
1866 kfree(fh); in cx231xx_v4l2_open()
1869 fh->dev = dev; in cx231xx_v4l2_open()
1870 fh->type = fh_type; in cx231xx_v4l2_open()
1871 filp->private_data = fh; in cx231xx_v4l2_open()
1872 v4l2_fh_init(&fh->fh, vdev); in cx231xx_v4l2_open()
1874 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { in cx231xx_v4l2_open()
1907 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in cx231xx_v4l2_open()
1908 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_video_qops, in cx231xx_v4l2_open()
1910 fh->type, V4L2_FIELD_INTERLACED, in cx231xx_v4l2_open()
1912 fh, &dev->lock); in cx231xx_v4l2_open()
1913 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_v4l2_open()
1918 videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_vbi_qops, in cx231xx_v4l2_open()
1920 fh->type, V4L2_FIELD_SEQ_TB, in cx231xx_v4l2_open()
1922 fh, &dev->lock); in cx231xx_v4l2_open()
1925 v4l2_fh_add(&fh->fh); in cx231xx_v4l2_open()
1980 struct cx231xx_fh *fh = filp->private_data; in cx231xx_close() local
1981 struct cx231xx *dev = fh->dev; in cx231xx_close()
1986 if (res_check(fh)) in cx231xx_close()
1987 res_free(fh); in cx231xx_close()
1996 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { in cx231xx_close()
1997 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
1998 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
2005 fh->dev = NULL; in cx231xx_close()
2020 v4l2_fh_del(&fh->fh); in cx231xx_close()
2021 v4l2_fh_exit(&fh->fh); in cx231xx_close()
2022 kfree(fh); in cx231xx_close()
2028 v4l2_fh_del(&fh->fh); in cx231xx_close()
2031 videobuf_stop(&fh->vb_vidq); in cx231xx_close()
2032 videobuf_mmap_free(&fh->vb_vidq); in cx231xx_close()
2038 fh->dev = NULL; in cx231xx_close()
2055 v4l2_fh_exit(&fh->fh); in cx231xx_close()
2056 kfree(fh); in cx231xx_close()
2063 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_close() local
2064 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_close()
2081 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_read() local
2082 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_read()
2089 if ((fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) || in cx231xx_v4l2_read()
2090 (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)) { in cx231xx_v4l2_read()
2091 rc = res_get(fh); in cx231xx_v4l2_read()
2098 rc = videobuf_read_stream(&fh->vb_vidq, buf, count, pos, 0, in cx231xx_v4l2_read()
2113 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_poll() local
2114 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_poll()
2122 rc = res_get(fh); in cx231xx_v4l2_poll()
2127 if (v4l2_event_pending(&fh->fh)) in cx231xx_v4l2_poll()
2130 poll_wait(filp, &fh->fh.wait, wait); in cx231xx_v4l2_poll()
2135 if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) || in cx231xx_v4l2_poll()
2136 (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)) { in cx231xx_v4l2_poll()
2138 res |= videobuf_poll_stream(filp, &fh->vb_vidq, wait); in cx231xx_v4l2_poll()
2150 struct cx231xx_fh *fh = filp->private_data; in cx231xx_v4l2_mmap() local
2151 struct cx231xx *dev = fh->dev; in cx231xx_v4l2_mmap()
2158 rc = res_get(fh); in cx231xx_v4l2_mmap()
2165 rc = videobuf_mmap_mapper(&fh->vb_vidq, vma); in cx231xx_v4l2_mmap()