Lines Matching refs:core

282 int cx88_video_mux(struct cx88_core *core, unsigned int input)  in cx88_video_mux()  argument
290 core->input = input; in cx88_video_mux()
322 if (core->sd_wm8775) { in cx88_video_mux()
323 call_all(core, audio, s_routing, in cx88_video_mux()
334 core->tvaudio = WW_I2SADC; in cx88_video_mux()
335 cx88_set_tvaudio(core); in cx88_video_mux()
353 struct cx88_core *core = dev->core; in start_video_dma() local
356 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH21], in start_video_dma()
358 cx88_set_scale(core, core->width, core->height, core->field); in start_video_dma()
366 cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_VIDINT); in start_video_dma()
391 struct cx88_core *core = dev->core; in stop_video_dma() local
427 struct cx88_core *core = dev->core; in queue_setup() local
430 sizes[0] = (dev->fmt->depth * core->width * core->height) >> 3; in queue_setup()
438 struct cx88_core *core = dev->core; in buffer_prepare() local
442 buf->bpl = core->width * dev->fmt->depth >> 3; in buffer_prepare()
444 if (vb2_plane_size(vb, 0) < core->height * buf->bpl) in buffer_prepare()
446 vb2_set_plane_payload(vb, 0, core->height * buf->bpl); in buffer_prepare()
448 switch (core->field) { in buffer_prepare()
452 buf->bpl, 0, core->height); in buffer_prepare()
457 buf->bpl, 0, core->height); in buffer_prepare()
462 0, buf->bpl * (core->height >> 1), in buffer_prepare()
464 core->height >> 1); in buffer_prepare()
469 buf->bpl * (core->height >> 1), 0, in buffer_prepare()
471 core->height >> 1); in buffer_prepare()
478 core->height >> 1); in buffer_prepare()
484 core->width, core->height, dev->fmt->depth, dev->fmt->fourcc, in buffer_prepare()
543 struct cx88_core *core = dev->core; in stop_streaming() local
576 struct cx88_core *core = dev->core; in radio_open() local
582 cx_write(MO_GP3_IO, core->board.radio.gpio3); in radio_open()
583 cx_write(MO_GP0_IO, core->board.radio.gpio0); in radio_open()
584 cx_write(MO_GP1_IO, core->board.radio.gpio1); in radio_open()
585 cx_write(MO_GP2_IO, core->board.radio.gpio2); in radio_open()
586 if (core->board.radio.audioroute) { in radio_open()
587 if (core->sd_wm8775) { in radio_open()
588 call_all(core, audio, s_routing, in radio_open()
589 core->board.radio.audioroute, 0, 0); in radio_open()
592 core->tvaudio = WW_I2SADC; in radio_open()
593 cx88_set_tvaudio(core); in radio_open()
596 core->tvaudio = WW_FM; in radio_open()
597 cx88_set_tvaudio(core); in radio_open()
598 cx88_set_stereo(core, V4L2_TUNER_MODE_STEREO, 1); in radio_open()
600 call_all(core, tuner, s_radio); in radio_open()
609 struct cx88_core *core = in cx8800_s_vid_ctrl() local
621 if (core->tvnorm & V4L2_STD_SECAM) { in cx8800_s_vid_ctrl()
656 struct cx88_core *core = in cx8800_s_aud_ctrl() local
662 if (core->sd_wm8775) { in cx8800_s_aud_ctrl()
665 wm8775_s_ctrl(core, ctrl->id, ctrl->val); in cx8800_s_aud_ctrl()
668 wm8775_s_ctrl(core, ctrl->id, (ctrl->val) ? in cx8800_s_aud_ctrl()
672 wm8775_s_ctrl(core, ctrl->id, ctrl->val << 9); in cx8800_s_aud_ctrl()
710 struct cx88_core *core = dev->core; in vidioc_g_fmt_vid_cap() local
712 f->fmt.pix.width = core->width; in vidioc_g_fmt_vid_cap()
713 f->fmt.pix.height = core->height; in vidioc_g_fmt_vid_cap()
714 f->fmt.pix.field = core->field; in vidioc_g_fmt_vid_cap()
728 struct cx88_core *core = dev->core; in vidioc_try_fmt_vid_cap() local
737 maxw = norm_maxw(core->tvnorm); in vidioc_try_fmt_vid_cap()
738 maxh = norm_maxh(core->tvnorm); in vidioc_try_fmt_vid_cap()
774 struct cx88_core *core = dev->core; in vidioc_s_fmt_vid_cap() local
781 if (core->dvbdev && vb2_is_busy(&core->dvbdev->vb2_mpegq)) in vidioc_s_fmt_vid_cap()
784 core->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
785 core->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
786 core->field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
790 int cx88_querycap(struct file *file, struct cx88_core *core, in cx88_querycap() argument
793 strscpy(cap->card, core->board.name, sizeof(cap->card)); in cx88_querycap()
797 if (core->board.tuner_type != UNSET) in cx88_querycap()
799 if (core->board.radio.type == CX88_RADIO) in cx88_querycap()
809 struct cx88_core *core = dev->core; in vidioc_querycap() local
813 return cx88_querycap(file, core, cap); in vidioc_querycap()
830 struct cx88_core *core = dev->core; in vidioc_g_std() local
832 *tvnorm = core->tvnorm; in vidioc_g_std()
839 struct cx88_core *core = dev->core; in vidioc_s_std() local
841 return cx88_set_tvnorm(core, tvnorms); in vidioc_s_std()
845 int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i) in cx88_enum_input() argument
879 struct cx88_core *core = dev->core; in vidioc_enum_input() local
881 return cx88_enum_input(core, i); in vidioc_enum_input()
887 struct cx88_core *core = dev->core; in vidioc_g_input() local
889 *i = core->input; in vidioc_g_input()
896 struct cx88_core *core = dev->core; in vidioc_s_input() local
903 cx88_newstation(core); in vidioc_s_input()
904 cx88_video_mux(core, i); in vidioc_s_input()
912 struct cx88_core *core = dev->core; in vidioc_g_tuner() local
915 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_tuner()
923 call_all(core, tuner, g_tuner, t); in vidioc_g_tuner()
925 cx88_get_stereo(core, t); in vidioc_g_tuner()
935 struct cx88_core *core = dev->core; in vidioc_s_tuner() local
937 if (core->board.tuner_type == UNSET) in vidioc_s_tuner()
942 cx88_set_stereo(core, t->audmode, 1); in vidioc_s_tuner()
950 struct cx88_core *core = dev->core; in vidioc_g_frequency() local
952 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_frequency()
957 f->frequency = core->freq; in vidioc_g_frequency()
959 call_all(core, tuner, g_frequency, f); in vidioc_g_frequency()
964 int cx88_set_freq(struct cx88_core *core, in cx88_set_freq() argument
969 if (unlikely(core->board.tuner_type == UNSET)) in cx88_set_freq()
974 cx88_newstation(core); in cx88_set_freq()
975 call_all(core, tuner, s_frequency, f); in cx88_set_freq()
976 call_all(core, tuner, g_frequency, &new_freq); in cx88_set_freq()
977 core->freq = new_freq.frequency; in cx88_set_freq()
981 cx88_set_tvaudio(core); in cx88_set_freq()
991 struct cx88_core *core = dev->core; in vidioc_s_frequency() local
993 return cx88_set_freq(core, f); in vidioc_s_frequency()
1001 struct cx88_core *core = dev->core; in vidioc_g_register() local
1013 struct cx88_core *core = dev->core; in vidioc_s_register() local
1028 struct cx88_core *core = dev->core; in radio_g_tuner() local
1035 call_all(core, tuner, g_tuner, t); in radio_g_tuner()
1043 struct cx88_core *core = dev->core; in radio_s_tuner() local
1048 call_all(core, tuner, s_tuner, t); in radio_s_tuner()
1064 struct cx88_core *core = dev->core; in cx8800_vid_irq() local
1082 cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); in cx8800_vid_irq()
1089 cx88_wakeup(core, &dev->vidq, count); in cx8800_vid_irq()
1097 cx88_wakeup(core, &dev->vbiq, count); in cx8800_vid_irq()
1105 struct cx88_core *core = dev->core; in cx8800_irq() local
1111 (core->pci_irqmask | PCI_INT_VIDINT); in cx8800_irq()
1117 if (status & core->pci_irqmask) in cx8800_irq()
1118 cx88_core_irq(core, status); in cx8800_irq()
1262 struct cx88_core *core; in cx8800_initdev() local
1277 core = cx88_core_get(dev->pci); in cx8800_initdev()
1278 if (!core) { in cx8800_initdev()
1282 dev->core = core; in cx8800_initdev()
1310 IRQF_SHARED, core->name, dev); in cx8800_initdev()
1315 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_initdev()
1321 vc = v4l2_ctrl_new_std(&core->audio_hdl, &cx8800_ctrl_aud_ops, in cx8800_initdev()
1325 err = core->audio_hdl.error; in cx8800_initdev()
1335 vc = v4l2_ctrl_new_std(&core->video_hdl, &cx8800_ctrl_vid_ops, in cx8800_initdev()
1339 err = core->video_hdl.error; in cx8800_initdev()
1344 core->chroma_agc = vc; in cx8800_initdev()
1346 v4l2_ctrl_add_handler(&core->video_hdl, &core->audio_hdl, NULL, false); in cx8800_initdev()
1350 if (core->board.audio_chip == CX88_AUDIO_WM8775) { in cx8800_initdev()
1354 .platform_data = &core->wm8775_data, in cx8800_initdev()
1358 if (core->boardnr == CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1) in cx8800_initdev()
1359 core->wm8775_data.is_nova_s = true; in cx8800_initdev()
1361 core->wm8775_data.is_nova_s = false; in cx8800_initdev()
1363 sd = v4l2_i2c_new_subdev_board(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1366 core->sd_wm8775 = sd; in cx8800_initdev()
1371 if (core->board.audio_chip == CX88_AUDIO_TVAUDIO) { in cx8800_initdev()
1376 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1380 switch (core->boardnr) { in cx8800_initdev()
1388 core->i2c_rtc = i2c_new_device(&core->i2c_adap, &rtc_info); in cx8800_initdev()
1401 core->v4ldev = dev; in cx8800_initdev()
1404 mutex_lock(&core->lock); in cx8800_initdev()
1405 cx88_set_tvnorm(core, V4L2_STD_NTSC_M); in cx8800_initdev()
1406 v4l2_ctrl_handler_setup(&core->video_hdl); in cx8800_initdev()
1407 v4l2_ctrl_handler_setup(&core->audio_hdl); in cx8800_initdev()
1408 cx88_video_mux(core, 0); in cx8800_initdev()
1420 q->lock = &core->lock; in cx8800_initdev()
1437 q->lock = &core->lock; in cx8800_initdev()
1445 cx88_vdev_init(core, dev->pci, &dev->video_dev, in cx8800_initdev()
1448 dev->video_dev.ctrl_handler = &core->video_hdl; in cx8800_initdev()
1452 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1455 video_nr[core->nr]); in cx8800_initdev()
1463 cx88_vdev_init(core, dev->pci, &dev->vbi_dev, in cx8800_initdev()
1469 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1472 vbi_nr[core->nr]); in cx8800_initdev()
1480 if (core->board.radio.type == CX88_RADIO) { in cx8800_initdev()
1481 cx88_vdev_init(core, dev->pci, &dev->radio_dev, in cx8800_initdev()
1484 dev->radio_dev.ctrl_handler = &core->audio_hdl; in cx8800_initdev()
1487 radio_nr[core->nr]); in cx8800_initdev()
1497 if (core->board.tuner_type != UNSET) { in cx8800_initdev()
1498 core->kthread = kthread_run(cx88_audio_thread, in cx8800_initdev()
1499 core, "cx88 tvaudio"); in cx8800_initdev()
1500 if (IS_ERR(core->kthread)) { in cx8800_initdev()
1501 err = PTR_ERR(core->kthread); in cx8800_initdev()
1506 mutex_unlock(&core->lock); in cx8800_initdev()
1513 mutex_unlock(&core->lock); in cx8800_initdev()
1515 core->v4ldev = NULL; in cx8800_initdev()
1516 cx88_core_put(core, dev->pci); in cx8800_initdev()
1525 struct cx88_core *core = dev->core; in cx8800_finidev() local
1528 if (core->kthread) { in cx8800_finidev()
1529 kthread_stop(core->kthread); in cx8800_finidev()
1530 core->kthread = NULL; in cx8800_finidev()
1533 if (core->ir) in cx8800_finidev()
1534 cx88_ir_stop(core); in cx8800_finidev()
1536 cx88_shutdown(core); /* FIXME */ in cx8800_finidev()
1544 core->v4ldev = NULL; in cx8800_finidev()
1547 cx88_core_put(core, dev->pci); in cx8800_finidev()
1555 struct cx88_core *core = dev->core; in cx8800_suspend() local
1570 if (core->ir) in cx8800_suspend()
1571 cx88_ir_stop(core); in cx8800_suspend()
1573 cx88_shutdown(core); in cx8800_suspend()
1587 struct cx88_core *core = dev->core; in cx8800_resume() local
1611 cx88_reset(core); in cx8800_resume()
1612 if (core->ir) in cx8800_resume()
1613 cx88_ir_start(core); in cx8800_resume()
1615 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_resume()