Lines Matching refs:cx

152 	struct cx18 *cx = id->cx;  in cx18_g_fmt_vid_cap()  local
153 struct cx18_stream *s = &cx->streams[id->type]; in cx18_g_fmt_vid_cap()
156 pixfmt->width = cx->cxhdl.width; in cx18_g_fmt_vid_cap()
157 pixfmt->height = cx->cxhdl.height; in cx18_g_fmt_vid_cap()
175 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_fmt_vbi_cap() local
182 vbifmt->start[0] = cx->vbi.start[0]; in cx18_g_fmt_vbi_cap()
183 vbifmt->start[1] = cx->vbi.start[1]; in cx18_g_fmt_vbi_cap()
184 vbifmt->count[0] = vbifmt->count[1] = cx->vbi.count; in cx18_g_fmt_vbi_cap()
194 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_fmt_sliced_vbi_cap() local
209 if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced)) in cx18_g_fmt_sliced_vbi_cap()
220 struct cx18 *cx = id->cx; in cx18_try_fmt_vid_cap() local
232 h = min(h, cx->is_50hz ? 576 : 480); in cx18_try_fmt_vid_cap()
249 struct cx18 *cx = fh2id(fh)->cx; in cx18_try_fmt_sliced_vbi_cap() local
258 cx18_expand_service_set(vbifmt, cx->is_50hz); in cx18_try_fmt_sliced_vbi_cap()
260 if (check_service_set(vbifmt, cx->is_50hz)) in cx18_try_fmt_sliced_vbi_cap()
269 struct cx18 *cx = id->cx; in cx18_s_fmt_vid_cap() local
271 struct cx18_stream *s = &cx->streams[id->type]; in cx18_s_fmt_vid_cap()
281 if (cx->cxhdl.width == w && cx->cxhdl.height == h && in cx18_s_fmt_vid_cap()
285 if (atomic_read(&cx->ana_capturing) > 0) in cx18_s_fmt_vid_cap()
299 mbus_fmt.width = cx->cxhdl.width = w; in cx18_s_fmt_vid_cap()
300 mbus_fmt.height = cx->cxhdl.height = h; in cx18_s_fmt_vid_cap()
302 v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &mbus_fmt); in cx18_s_fmt_vid_cap()
310 struct cx18 *cx = id->cx; in cx18_s_fmt_vbi_cap() local
317 if (!cx18_raw_vbi(cx) && atomic_read(&cx->ana_capturing) > 0) in cx18_s_fmt_vbi_cap()
325 ret = v4l2_subdev_call(cx->sd_av, vbi, s_raw_fmt, &fmt->fmt.vbi); in cx18_s_fmt_vbi_cap()
330 cx->vbi.sliced_in->service_set = 0; in cx18_s_fmt_vbi_cap()
331 cx->vbi.in.type = V4L2_BUF_TYPE_VBI_CAPTURE; in cx18_s_fmt_vbi_cap()
340 struct cx18 *cx = id->cx; in cx18_s_fmt_sliced_vbi_cap() local
350 if (cx18_raw_vbi(cx) && atomic_read(&cx->ana_capturing) > 0) in cx18_s_fmt_sliced_vbi_cap()
358 ret = v4l2_subdev_call(cx->sd_av, vbi, s_sliced_fmt, &fmt->fmt.sliced); in cx18_s_fmt_sliced_vbi_cap()
362 cx->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; in cx18_s_fmt_sliced_vbi_cap()
363 memcpy(cx->vbi.sliced_in, vbifmt, sizeof(*cx->vbi.sliced_in)); in cx18_s_fmt_sliced_vbi_cap()
371 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_register() local
378 reg->val = cx18_read_enc(cx, reg->reg); in cx18_g_register()
385 struct cx18 *cx = fh2id(fh)->cx; in cx18_s_register() local
391 cx18_write_enc(cx, reg->val, reg->reg); in cx18_s_register()
401 struct cx18 *cx = id->cx; in cx18_querycap() local
404 strlcpy(vcap->card, cx->card_name, sizeof(vcap->card)); in cx18_querycap()
406 "PCI:%s", pci_name(cx->pci_dev)); in cx18_querycap()
407 vcap->capabilities = cx->v4l2_cap; /* capabilities */ in cx18_querycap()
415 struct cx18 *cx = fh2id(fh)->cx; in cx18_enumaudio() local
417 return cx18_get_audio_input(cx, vin->index, vin); in cx18_enumaudio()
422 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_audio() local
424 vin->index = cx->audio_input; in cx18_g_audio()
425 return cx18_get_audio_input(cx, vin->index, vin); in cx18_g_audio()
430 struct cx18 *cx = fh2id(fh)->cx; in cx18_s_audio() local
432 if (vout->index >= cx->nof_audio_inputs) in cx18_s_audio()
434 cx->audio_input = vout->index; in cx18_s_audio()
435 cx18_audio_set_io(cx); in cx18_s_audio()
441 struct cx18 *cx = fh2id(fh)->cx; in cx18_enum_input() local
444 return cx18_get_input(cx, vin->index, vin); in cx18_enum_input()
450 struct cx18 *cx = fh2id(fh)->cx; in cx18_cropcap() local
454 cropcap->pixelaspect.numerator = cx->is_50hz ? 59 : 10; in cx18_cropcap()
455 cropcap->pixelaspect.denominator = cx->is_50hz ? 54 : 11; in cx18_cropcap()
462 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_selection() local
471 sel->r.height = cx->is_50hz ? 576 : 480; in cx18_g_selection()
502 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_input() local
504 *i = cx->active_input; in cx18_g_input()
511 struct cx18 *cx = id->cx; in cx18_s_input() local
514 cx->card->video_inputs + inp; in cx18_s_input()
516 if (inp >= cx->nof_inputs) in cx18_s_input()
519 if (inp == cx->active_input) { in cx18_s_input()
525 cx->active_input, inp); in cx18_s_input()
527 cx->active_input = inp; in cx18_s_input()
529 cx->audio_input = cx->card->video_inputs[inp].audio_index; in cx18_s_input()
531 std = cx->tuner_std; in cx18_s_input()
532 cx->streams[CX18_ENC_STREAM_TYPE_MPG].video_dev.tvnorms = std; in cx18_s_input()
533 cx->streams[CX18_ENC_STREAM_TYPE_YUV].video_dev.tvnorms = std; in cx18_s_input()
534 cx->streams[CX18_ENC_STREAM_TYPE_VBI].video_dev.tvnorms = std; in cx18_s_input()
538 cx18_mute(cx); in cx18_s_input()
539 cx18_video_set_io(cx); in cx18_s_input()
540 cx18_audio_set_io(cx); in cx18_s_input()
541 cx18_unmute(cx); in cx18_s_input()
548 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_frequency() local
553 cx18_call_all(cx, tuner, g_frequency, vf); in cx18_g_frequency()
560 struct cx18 *cx = id->cx; in cx18_s_frequency() local
565 cx18_mute(cx); in cx18_s_frequency()
567 cx18_call_all(cx, tuner, s_frequency, vf); in cx18_s_frequency()
568 cx18_unmute(cx); in cx18_s_frequency()
574 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_std() local
576 *std = cx->std; in cx18_g_std()
583 struct cx18 *cx = id->cx; in cx18_s_std() local
588 if (std == cx->std) in cx18_s_std()
591 if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) || in cx18_s_std()
592 atomic_read(&cx->ana_capturing) > 0) { in cx18_s_std()
599 cx->std = std; in cx18_s_std()
600 cx->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0; in cx18_s_std()
601 cx->is_50hz = !cx->is_60hz; in cx18_s_std()
602 cx2341x_handler_set_50hz(&cx->cxhdl, cx->is_50hz); in cx18_s_std()
603 cx->cxhdl.width = 720; in cx18_s_std()
604 cx->cxhdl.height = cx->is_50hz ? 576 : 480; in cx18_s_std()
605 cx->vbi.count = cx->is_50hz ? 18 : 12; in cx18_s_std()
606 cx->vbi.start[0] = cx->is_50hz ? 6 : 10; in cx18_s_std()
607 cx->vbi.start[1] = cx->is_50hz ? 318 : 273; in cx18_s_std()
609 (unsigned long long) cx->std); in cx18_s_std()
612 cx18_call_all(cx, video, s_std, cx->std); in cx18_s_std()
619 struct cx18 *cx = id->cx; in cx18_s_tuner() local
624 cx18_call_all(cx, tuner, s_tuner, vt); in cx18_s_tuner()
630 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_tuner() local
635 cx18_call_all(cx, tuner, g_tuner, vt); in cx18_g_tuner()
647 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_sliced_vbi_cap() local
648 int set = cx->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; in cx18_g_sliced_vbi_cap()
657 if (valid_service_line(f, l, cx->is_50hz)) { in cx18_g_sliced_vbi_cap()
768 struct cx18 *cx = fh2id(fh)->cx; in cx18_g_enc_index() local
769 struct cx18_stream *s = &cx->streams[CX18_ENC_STREAM_TYPE_IDX]; in cx18_g_enc_index()
815 struct cx18 *cx = id->cx; in cx18_vb_queue() local
816 struct cx18_stream *s = &cx->streams[id->type]; in cx18_vb_queue()
834 struct cx18 *cx = id->cx; in cx18_streamon() local
835 struct cx18_stream *s = &cx->streams[id->type]; in cx18_streamon()
855 struct cx18 *cx = id->cx; in cx18_streamoff() local
856 struct cx18_stream *s = &cx->streams[id->type]; in cx18_streamoff()
873 struct cx18 *cx = id->cx; in cx18_reqbufs() local
874 struct cx18_stream *s = &cx->streams[id->type]; in cx18_reqbufs()
887 struct cx18 *cx = id->cx; in cx18_querybuf() local
888 struct cx18_stream *s = &cx->streams[id->type]; in cx18_querybuf()
900 struct cx18 *cx = id->cx; in cx18_qbuf() local
901 struct cx18_stream *s = &cx->streams[id->type]; in cx18_qbuf()
913 struct cx18 *cx = id->cx; in cx18_dqbuf() local
914 struct cx18_stream *s = &cx->streams[id->type]; in cx18_dqbuf()
927 struct cx18 *cx = id->cx; in cx18_encoder_cmd() local
946 if (!atomic_read(&cx->ana_capturing)) in cx18_encoder_cmd()
948 if (test_and_set_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) in cx18_encoder_cmd()
950 h = cx18_find_handle(cx); in cx18_encoder_cmd()
956 cx18_mute(cx); in cx18_encoder_cmd()
957 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, h); in cx18_encoder_cmd()
963 if (!atomic_read(&cx->ana_capturing)) in cx18_encoder_cmd()
965 if (!test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) in cx18_encoder_cmd()
967 h = cx18_find_handle(cx); in cx18_encoder_cmd()
973 cx18_vapi(cx, CX18_CPU_CAPTURE_RESUME, 1, h); in cx18_encoder_cmd()
974 cx18_unmute(cx); in cx18_encoder_cmd()
987 struct cx18 *cx = fh2id(fh)->cx; in cx18_try_encoder_cmd() local
1019 struct cx18 *cx = fh2id(fh)->cx; in cx18_log_status() local
1024 CX18_INFO("Version: %s Card: %s\n", CX18_VERSION, cx->card_name); in cx18_log_status()
1025 if (cx->hw_flags & CX18_HW_TVEEPROM) { in cx18_log_status()
1028 cx18_read_eeprom(cx, &tv); in cx18_log_status()
1030 cx18_call_all(cx, core, log_status); in cx18_log_status()
1031 cx18_get_input(cx, cx->active_input, &vidin); in cx18_log_status()
1032 cx18_get_audio_input(cx, cx->audio_input, &audin); in cx18_log_status()
1035 mutex_lock(&cx->gpio_lock); in cx18_log_status()
1037 cx->gpio_dir, cx->gpio_val); in cx18_log_status()
1038 mutex_unlock(&cx->gpio_lock); in cx18_log_status()
1040 test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ? "Radio" : "TV"); in cx18_log_status()
1041 v4l2_ctrl_handler_log_status(&cx->cxhdl.hdl, cx->v4l2_dev.name); in cx18_log_status()
1042 CX18_INFO("Status flags: 0x%08lx\n", cx->i_flags); in cx18_log_status()
1044 struct cx18_stream *s = &cx->streams[i]; in cx18_log_status()
1055 (long long)cx->mpg_data_received, in cx18_log_status()
1056 (long long)cx->vbi_data_inserted); in cx18_log_status()
1063 struct cx18 *cx = fh2id(fh)->cx; in cx18_default() local
1070 cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL, core, reset, in cx18_default()