• Home
  • Raw
  • Download

Lines Matching refs:cx

45 	struct cx18 *cx = id->cx;  in cx18_claim_stream()  local
46 struct cx18_stream *s = &cx->streams[type]; in cx18_claim_stream()
74 cx->vbi.insert_mpeg && !cx18_raw_vbi(cx)) { in cx18_claim_stream()
79 s_vbi = &cx->streams[vbi_type]; in cx18_claim_stream()
92 struct cx18 *cx = s->cx; in cx18_release_stream() local
111 s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_release_stream()
128 static void cx18_dualwatch(struct cx18 *cx) in cx18_dualwatch() argument
137 new_stereo_mode = cx->params.audio_properties & stereo_mask; in cx18_dualwatch()
139 cx18_call_i2c_clients(cx, VIDIOC_G_TUNER, &vt); in cx18_dualwatch()
144 if (new_stereo_mode == cx->dualwatch_stereo_mode) in cx18_dualwatch()
148 | (cx->params.audio_properties & ~stereo_mask); in cx18_dualwatch()
152 cx->dualwatch_stereo_mode, new_stereo_mode, new_bitmap); in cx18_dualwatch()
154 h = cx18_find_handle(cx); in cx18_dualwatch()
160 if (cx18_vapi(cx, in cx18_dualwatch()
162 cx->dualwatch_stereo_mode = new_stereo_mode; in cx18_dualwatch()
171 struct cx18 *cx = s->cx; in cx18_get_buffer() local
172 struct cx18_stream *s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_get_buffer()
180 if (time_after(jiffies, cx->dualwatch_jiffies + msecs_to_jiffies(1000))) { in cx18_get_buffer()
181 cx->dualwatch_jiffies = jiffies; in cx18_get_buffer()
182 cx18_dualwatch(cx); in cx18_get_buffer()
188 cx18_process_vbi_data(cx, buf, in cx18_get_buffer()
194 buf = &cx->vbi.sliced_mpeg_buf; in cx18_get_buffer()
210 cx18_process_vbi_data(cx, buf, in cx18_get_buffer()
244 static void cx18_setup_sliced_vbi_buf(struct cx18 *cx) in cx18_setup_sliced_vbi_buf() argument
246 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES; in cx18_setup_sliced_vbi_buf()
248 cx->vbi.sliced_mpeg_buf.buf = cx->vbi.sliced_mpeg_data[idx]; in cx18_setup_sliced_vbi_buf()
249 cx->vbi.sliced_mpeg_buf.bytesused = cx->vbi.sliced_mpeg_size[idx]; in cx18_setup_sliced_vbi_buf()
250 cx->vbi.sliced_mpeg_buf.readpos = 0; in cx18_setup_sliced_vbi_buf()
256 struct cx18 *cx = s->cx; in cx18_copy_buf_to_user() local
261 if (cx->vbi.insert_mpeg && s->type == CX18_ENC_STREAM_TYPE_MPG && in cx18_copy_buf_to_user()
262 !cx18_raw_vbi(cx) && buf != &cx->vbi.sliced_mpeg_buf) { in cx18_copy_buf_to_user()
266 u8 ch = cx->search_pack_header ? 0xba : 0xe0; in cx18_copy_buf_to_user()
277 if (!cx->search_pack_header) { in cx18_copy_buf_to_user()
285 cx->search_pack_header = 1; in cx18_copy_buf_to_user()
301 cx->search_pack_header = 0; in cx18_copy_buf_to_user()
303 cx18_setup_sliced_vbi_buf(cx); in cx18_copy_buf_to_user()
315 buf != &cx->vbi.sliced_mpeg_buf) in cx18_copy_buf_to_user()
316 cx->mpg_data_received += len; in cx18_copy_buf_to_user()
323 struct cx18 *cx = s->cx; in cx18_read() local
327 if (atomic_read(&cx->ana_capturing) == 0 && s->id == -1) { in cx18_read()
337 if (s->type == CX18_ENC_STREAM_TYPE_VBI && !cx18_raw_vbi(cx)) in cx18_read()
363 if (buf != &cx->vbi.sliced_mpeg_buf) { in cx18_read()
369 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES; in cx18_read()
371 cx->vbi.sliced_mpeg_size[idx] = 0; in cx18_read()
372 cx->vbi.inserted_frame++; in cx18_read()
373 cx->vbi_data_inserted += buf->bytesused; in cx18_read()
389 struct cx18 *cx = s->cx; in cx18_read_pos() local
399 struct cx18 *cx = id->cx; in cx18_start_capture() local
400 struct cx18_stream *s = &cx->streams[id->type]; in cx18_start_capture()
421 s_vbi = &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_start_capture()
446 if (test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) in cx18_start_capture()
447 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, s->handle); in cx18_start_capture()
471 struct cx18 *cx = id->cx; in cx18_v4l2_read() local
472 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_read()
477 mutex_lock(&cx->serialize_lock); in cx18_v4l2_read()
479 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_read()
488 struct cx18 *cx = id->cx; in cx18_v4l2_enc_poll() local
489 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_enc_poll()
496 mutex_lock(&cx->serialize_lock); in cx18_v4l2_enc_poll()
498 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_enc_poll()
520 struct cx18 *cx = id->cx; in cx18_stop_capture() local
521 struct cx18_stream *s = &cx->streams[id->type]; in cx18_stop_capture()
530 &cx->streams[CX18_ENC_STREAM_TYPE_VBI]; in cx18_stop_capture()
558 struct cx18 *cx = id->cx; in cx18_v4l2_close() local
559 struct cx18_stream *s = &cx->streams[id->type]; in cx18_v4l2_close()
563 v4l2_prio_close(&cx->prio, &id->prio); in cx18_v4l2_close()
574 mutex_lock(&cx->serialize_lock); in cx18_v4l2_close()
577 cx18_mute(cx); in cx18_v4l2_close()
579 clear_bit(CX18_F_I_RADIO_USER, &cx->i_flags); in cx18_v4l2_close()
581 cx18_call_i2c_clients(cx, VIDIOC_S_STD, &cx->std); in cx18_v4l2_close()
583 cx18_audio_set_io(cx); in cx18_v4l2_close()
584 if (atomic_read(&cx->ana_capturing) > 0) { in cx18_v4l2_close()
586 cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle, in cx18_v4l2_close()
587 cx->params.video_mute | in cx18_v4l2_close()
588 (cx->params.video_mute_yuv << 8)); in cx18_v4l2_close()
591 cx18_unmute(cx); in cx18_v4l2_close()
597 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_close()
603 struct cx18 *cx = s->cx; in cx18_serialized_open() local
614 item->cx = cx; in cx18_serialized_open()
616 v4l2_prio_open(&cx->prio, &item->prio); in cx18_serialized_open()
618 item->open_id = cx->open_id++; in cx18_serialized_open()
629 if (!test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) { in cx18_serialized_open()
630 if (atomic_read(&cx->ana_capturing) > 0) { in cx18_serialized_open()
640 set_bit(CX18_F_I_RADIO_USER, &cx->i_flags); in cx18_serialized_open()
642 cx18_mute(cx); in cx18_serialized_open()
644 cx18_call_i2c_clients(cx, AUDC_SET_RADIO, NULL); in cx18_serialized_open()
646 cx18_audio_set_io(cx); in cx18_serialized_open()
648 cx18_unmute(cx); in cx18_serialized_open()
656 struct cx18 *cx = NULL; in cx18_v4l2_open() local
662 for (x = 0; cx == NULL && x < cx18_cards_active; x++) { in cx18_v4l2_open()
669 cx = cx18_cards[x]; in cx18_v4l2_open()
676 if (cx == NULL) { in cx18_v4l2_open()
684 mutex_lock(&cx->serialize_lock); in cx18_v4l2_open()
685 if (cx18_init_on_first_open(cx)) { in cx18_v4l2_open()
687 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_open()
691 mutex_unlock(&cx->serialize_lock); in cx18_v4l2_open()
695 void cx18_mute(struct cx18 *cx) in cx18_mute() argument
698 if (atomic_read(&cx->ana_capturing)) { in cx18_mute()
699 h = cx18_find_handle(cx); in cx18_mute()
701 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 1); in cx18_mute()
708 void cx18_unmute(struct cx18 *cx) in cx18_unmute() argument
711 if (atomic_read(&cx->ana_capturing)) { in cx18_unmute()
712 h = cx18_find_handle(cx); in cx18_unmute()
715 cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 2, h, 12); in cx18_unmute()
716 cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, h, 0); in cx18_unmute()