• Home
  • Raw
  • Download

Lines Matching full:cx

41 	struct cx18 *cx = id->cx;  in cx18_claim_stream()  local
42 struct cx18_stream *s = &cx->streams[type]; in cx18_claim_stream()
82 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_IDX]; in cx18_claim_stream()
83 if (cx->vbi.insert_mpeg && !cx18_raw_vbi(cx)) in cx18_claim_stream()
84 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_claim_stream()
100 struct cx18 *cx = s->cx; in cx18_release_stream() local
134 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_IDX]; in cx18_release_stream()
141 s_assoc = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_release_stream()
155 static void cx18_dualwatch(struct cx18 *cx) in cx18_dualwatch() argument
161 new_stereo_mode = v4l2_ctrl_g_ctrl(cx->cxhdl.audio_mode); in cx18_dualwatch()
163 cx18_call_all(cx, tuner, g_tuner, &vt); in cx18_dualwatch()
168 if (new_stereo_mode == cx->dualwatch_stereo_mode) in cx18_dualwatch()
172 cx->dualwatch_stereo_mode, new_stereo_mode); in cx18_dualwatch()
173 if (v4l2_ctrl_s_ctrl(cx->cxhdl.audio_mode, new_stereo_mode)) in cx18_dualwatch()
181 struct cx18 *cx = s->cx; in cx18_get_mdl() local
182 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_get_mdl()
190 if (time_after(jiffies, cx->dualwatch_jiffies + msecs_to_jiffies(1000))) { in cx18_get_mdl()
191 cx->dualwatch_jiffies = jiffies; in cx18_get_mdl()
192 cx18_dualwatch(cx); in cx18_get_mdl()
199 cx18_process_vbi_data(cx, mdl, in cx18_get_mdl()
204 mdl = &cx->vbi.sliced_mpeg_mdl; in cx18_get_mdl()
220 cx18_process_vbi_data(cx, mdl, s->type); in cx18_get_mdl()
253 static void cx18_setup_sliced_vbi_mdl(struct cx18 *cx) in cx18_setup_sliced_vbi_mdl() argument
255 struct cx18_mdl *mdl = &cx->vbi.sliced_mpeg_mdl; in cx18_setup_sliced_vbi_mdl()
256 struct cx18_buffer *buf = &cx->vbi.sliced_mpeg_buf; in cx18_setup_sliced_vbi_mdl()
257 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES; in cx18_setup_sliced_vbi_mdl()
259 buf->buf = cx->vbi.sliced_mpeg_data[idx]; in cx18_setup_sliced_vbi_mdl()
260 buf->bytesused = cx->vbi.sliced_mpeg_size[idx]; in cx18_setup_sliced_vbi_mdl()
264 mdl->bytesused = cx->vbi.sliced_mpeg_size[idx]; in cx18_setup_sliced_vbi_mdl()
271 struct cx18 *cx = s->cx; in cx18_copy_buf_to_user() local
277 if (cx->vbi.insert_mpeg && s->type == CX18_ENC_STREAM_TYPE_MPG && in cx18_copy_buf_to_user()
278 !cx18_raw_vbi(cx) && buf != &cx->vbi.sliced_mpeg_buf) { in cx18_copy_buf_to_user()
301 u8 ch = cx->search_pack_header ? 0xba : 0xe0; in cx18_copy_buf_to_user()
320 if (!cx->search_pack_header) { in cx18_copy_buf_to_user()
331 cx->search_pack_header = 1; in cx18_copy_buf_to_user()
352 cx->search_pack_header = 0; /* expect vid PES */ in cx18_copy_buf_to_user()
354 cx18_setup_sliced_vbi_mdl(cx); in cx18_copy_buf_to_user()
367 buf != &cx->vbi.sliced_mpeg_buf) in cx18_copy_buf_to_user()
368 cx->mpg_data_received += len; in cx18_copy_buf_to_user()
417 struct cx18 *cx = s->cx; in cx18_read() local
421 if (atomic_read(&cx->ana_capturing) == 0 && s->id == -1) { in cx18_read()
431 if (s->type == CX18_ENC_STREAM_TYPE_VBI && !cx18_raw_vbi(cx)) in cx18_read()
457 if (mdl != &cx->vbi.sliced_mpeg_mdl) { in cx18_read()
463 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES; in cx18_read()
465 cx->vbi.sliced_mpeg_size[idx] = 0; in cx18_read()
466 cx->vbi.inserted_frame++; in cx18_read()
467 cx->vbi_data_inserted += mdl->bytesused; in cx18_read()
483 struct cx18 *cx = s->cx; in cx18_read_pos() local
493 struct cx18 *cx = id->cx; in cx18_start_capture() local
494 struct cx18_stream *s = &cx->streams[id->type]; in cx18_start_capture()
516 s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_start_capture()
517 s_idx = &cx->streams[CX18_ENC_STREAM_TYPE_IDX]; in cx18_start_capture()
549 if (test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) in cx18_start_capture()
550 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, s->handle); in cx18_start_capture()
584 struct cx18 *cx = id->cx; in cx18_v4l2_read() local
585 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_read()
590 mutex_lock(&cx->serialize_lock); in cx18_v4l2_read()
592 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_read()
609 struct cx18 *cx = id->cx; in cx18_v4l2_enc_poll() local
610 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_enc_poll()
619 mutex_lock(&cx->serialize_lock); in cx18_v4l2_enc_poll()
621 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_enc_poll()
658 struct cx18 *cx = id->cx; in cx18_v4l2_mmap() local
659 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_mmap()
669 mutex_lock(&cx->serialize_lock); in cx18_v4l2_mmap()
671 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_mmap()
709 struct cx18 *cx = id->cx; in cx18_stop_capture() local
710 struct cx18_stream *s = &cx->streams[id->type]; in cx18_stop_capture()
711 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_stop_capture()
712 struct cx18_stream *s_idx = &cx->streams[CX18_ENC_STREAM_TYPE_IDX]; in cx18_stop_capture()
751 struct cx18 *cx = id->cx; in cx18_v4l2_close() local
752 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_close()
756 mutex_lock(&cx->serialize_lock); in cx18_v4l2_close()
761 cx18_mute(cx); in cx18_v4l2_close()
763 clear_bit(CX18_F_I_RADIO_USER, &cx->i_flags); in cx18_v4l2_close()
765 cx18_call_all(cx, video, s_std, cx->std); in cx18_v4l2_close()
767 cx18_audio_set_io(cx); in cx18_v4l2_close()
768 if (atomic_read(&cx->ana_capturing) > 0) { in cx18_v4l2_close()
770 cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle, in cx18_v4l2_close()
771 (v4l2_ctrl_g_ctrl(cx->cxhdl.video_mute) | in cx18_v4l2_close()
772 (v4l2_ctrl_g_ctrl(cx->cxhdl.video_mute_yuv) << 8))); in cx18_v4l2_close()
775 cx18_unmute(cx); in cx18_v4l2_close()
785 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_close()
791 struct cx18 *cx = s->cx; in cx18_serialized_open() local
804 item->cx = cx; in cx18_serialized_open()
807 item->open_id = cx->open_id++; in cx18_serialized_open()
813 if (!test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) { in cx18_serialized_open()
814 if (atomic_read(&cx->ana_capturing) > 0) { in cx18_serialized_open()
825 set_bit(CX18_F_I_RADIO_USER, &cx->i_flags); in cx18_serialized_open()
827 cx18_mute(cx); in cx18_serialized_open()
829 cx18_call_all(cx, tuner, s_radio); in cx18_serialized_open()
831 cx18_audio_set_io(cx); in cx18_serialized_open()
833 cx18_unmute(cx); in cx18_serialized_open()
843 struct cx18 *cx = s->cx; in cx18_v4l2_open() local
845 mutex_lock(&cx->serialize_lock); in cx18_v4l2_open()
846 if (cx18_init_on_first_open(cx)) { in cx18_v4l2_open()
849 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_open()
853 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_open()
857 void cx18_mute(struct cx18 *cx) in cx18_mute() argument
860 if (atomic_read(&cx->ana_capturing)) { in cx18_mute()
861 h = cx18_find_handle(cx); in cx18_mute()
863 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 1); in cx18_mute()
870 void cx18_unmute(struct cx18 *cx) in cx18_unmute() argument
873 if (atomic_read(&cx->ana_capturing)) { in cx18_unmute()
874 h = cx18_find_handle(cx); in cx18_unmute()
877 cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 2, h, 12); in cx18_unmute()
878 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 0); in cx18_unmute()