Lines Matching full:core
282 int cx88_video_mux(struct cx88_core *core, unsigned int input) in cx88_video_mux() argument
284 /* struct cx88_core *core = dev->core; */ in cx88_video_mux()
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()
390 struct cx88_core *core = dev->core; in stop_video_dma() local
425 struct cx88_core *core = dev->core; in queue_setup() local
428 sizes[0] = (dev->fmt->depth * core->width * core->height) >> 3; in queue_setup()
436 struct cx88_core *core = dev->core; in buffer_prepare() local
440 buf->bpl = core->width * dev->fmt->depth >> 3; in buffer_prepare()
442 if (vb2_plane_size(vb, 0) < core->height * buf->bpl) in buffer_prepare()
444 vb2_set_plane_payload(vb, 0, core->height * buf->bpl); in buffer_prepare()
446 switch (core->field) { in buffer_prepare()
450 buf->bpl, 0, core->height); in buffer_prepare()
455 buf->bpl, 0, core->height); in buffer_prepare()
460 0, buf->bpl * (core->height >> 1), in buffer_prepare()
462 core->height >> 1); in buffer_prepare()
467 buf->bpl * (core->height >> 1), 0, in buffer_prepare()
469 core->height >> 1); in buffer_prepare()
476 core->height >> 1); in buffer_prepare()
482 core->width, core->height, dev->fmt->depth, dev->fmt->fourcc, in buffer_prepare()
541 struct cx88_core *core = dev->core; in stop_streaming() local
574 struct cx88_core *core = dev->core; in radio_open() local
580 cx_write(MO_GP3_IO, core->board.radio.gpio3); in radio_open()
581 cx_write(MO_GP0_IO, core->board.radio.gpio0); in radio_open()
582 cx_write(MO_GP1_IO, core->board.radio.gpio1); in radio_open()
583 cx_write(MO_GP2_IO, core->board.radio.gpio2); in radio_open()
584 if (core->board.radio.audioroute) { in radio_open()
585 if (core->sd_wm8775) { in radio_open()
586 call_all(core, audio, s_routing, in radio_open()
587 core->board.radio.audioroute, 0, 0); in radio_open()
590 core->tvaudio = WW_I2SADC; in radio_open()
591 cx88_set_tvaudio(core); in radio_open()
594 core->tvaudio = WW_FM; in radio_open()
595 cx88_set_tvaudio(core); in radio_open()
596 cx88_set_stereo(core, V4L2_TUNER_MODE_STEREO, 1); in radio_open()
598 call_all(core, tuner, s_radio); in radio_open()
607 struct cx88_core *core = in cx8800_s_vid_ctrl() local
619 if (core->tvnorm & V4L2_STD_SECAM) { in cx8800_s_vid_ctrl()
654 struct cx88_core *core = in cx8800_s_aud_ctrl() local
660 if (core->sd_wm8775) { in cx8800_s_aud_ctrl()
663 wm8775_s_ctrl(core, ctrl->id, ctrl->val); in cx8800_s_aud_ctrl()
666 wm8775_s_ctrl(core, ctrl->id, (ctrl->val) ? in cx8800_s_aud_ctrl()
670 wm8775_s_ctrl(core, ctrl->id, ctrl->val << 9); in cx8800_s_aud_ctrl()
708 struct cx88_core *core = dev->core; in vidioc_g_fmt_vid_cap() local
710 f->fmt.pix.width = core->width; in vidioc_g_fmt_vid_cap()
711 f->fmt.pix.height = core->height; in vidioc_g_fmt_vid_cap()
712 f->fmt.pix.field = core->field; in vidioc_g_fmt_vid_cap()
726 struct cx88_core *core = dev->core; in vidioc_try_fmt_vid_cap() local
735 maxw = norm_maxw(core->tvnorm); in vidioc_try_fmt_vid_cap()
736 maxh = norm_maxh(core->tvnorm); in vidioc_try_fmt_vid_cap()
772 struct cx88_core *core = dev->core; in vidioc_s_fmt_vid_cap() local
779 if (core->dvbdev && vb2_is_busy(&core->dvbdev->vb2_mpegq)) in vidioc_s_fmt_vid_cap()
782 core->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
783 core->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
784 core->field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
788 int cx88_querycap(struct file *file, struct cx88_core *core, in cx88_querycap() argument
791 strscpy(cap->card, core->board.name, sizeof(cap->card)); in cx88_querycap()
795 if (core->board.tuner_type != UNSET) in cx88_querycap()
797 if (core->board.radio.type == CX88_RADIO) in cx88_querycap()
807 struct cx88_core *core = dev->core; in vidioc_querycap() local
811 return cx88_querycap(file, core, cap); in vidioc_querycap()
828 struct cx88_core *core = dev->core; in vidioc_g_std() local
830 *tvnorm = core->tvnorm; in vidioc_g_std()
837 struct cx88_core *core = dev->core; in vidioc_s_std() local
839 return cx88_set_tvnorm(core, tvnorms); in vidioc_s_std()
843 int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i) in cx88_enum_input() argument
877 struct cx88_core *core = dev->core; in vidioc_enum_input() local
879 return cx88_enum_input(core, i); in vidioc_enum_input()
885 struct cx88_core *core = dev->core; in vidioc_g_input() local
887 *i = core->input; in vidioc_g_input()
894 struct cx88_core *core = dev->core; in vidioc_s_input() local
901 cx88_newstation(core); in vidioc_s_input()
902 cx88_video_mux(core, i); in vidioc_s_input()
910 struct cx88_core *core = dev->core; in vidioc_g_tuner() local
913 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_tuner()
921 call_all(core, tuner, g_tuner, t); in vidioc_g_tuner()
923 cx88_get_stereo(core, t); in vidioc_g_tuner()
933 struct cx88_core *core = dev->core; in vidioc_s_tuner() local
935 if (core->board.tuner_type == UNSET) in vidioc_s_tuner()
940 cx88_set_stereo(core, t->audmode, 1); in vidioc_s_tuner()
948 struct cx88_core *core = dev->core; in vidioc_g_frequency() local
950 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_frequency()
955 f->frequency = core->freq; in vidioc_g_frequency()
957 call_all(core, tuner, g_frequency, f); in vidioc_g_frequency()
962 int cx88_set_freq(struct cx88_core *core, in cx88_set_freq() argument
967 if (unlikely(core->board.tuner_type == UNSET)) in cx88_set_freq()
972 cx88_newstation(core); in cx88_set_freq()
973 call_all(core, tuner, s_frequency, f); in cx88_set_freq()
974 call_all(core, tuner, g_frequency, &new_freq); in cx88_set_freq()
975 core->freq = new_freq.frequency; in cx88_set_freq()
979 cx88_set_tvaudio(core); in cx88_set_freq()
989 struct cx88_core *core = dev->core; in vidioc_s_frequency() local
991 return cx88_set_freq(core, f); in vidioc_s_frequency()
999 struct cx88_core *core = dev->core; in vidioc_g_register() local
1011 struct cx88_core *core = dev->core; in vidioc_s_register() local
1026 struct cx88_core *core = dev->core; in radio_g_tuner() local
1033 call_all(core, tuner, g_tuner, t); in radio_g_tuner()
1041 struct cx88_core *core = dev->core; in radio_s_tuner() local
1046 call_all(core, tuner, s_tuner, t); in radio_s_tuner()
1062 struct cx88_core *core = dev->core; in cx8800_vid_irq() local
1080 cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); in cx8800_vid_irq()
1087 cx88_wakeup(core, &dev->vidq, count); in cx8800_vid_irq()
1095 cx88_wakeup(core, &dev->vbiq, count); in cx8800_vid_irq()
1103 struct cx88_core *core = dev->core; in cx8800_irq() local
1109 (core->pci_irqmask | PCI_INT_VIDINT); in cx8800_irq()
1115 if (status & core->pci_irqmask) in cx8800_irq()
1116 cx88_core_irq(core, status); in cx8800_irq()
1260 struct cx88_core *core; in cx8800_initdev() local
1275 core = cx88_core_get(dev->pci); in cx8800_initdev()
1276 if (!core) { in cx8800_initdev()
1280 dev->core = core; in cx8800_initdev()
1308 IRQF_SHARED, core->name, dev); in cx8800_initdev()
1313 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_initdev()
1319 vc = v4l2_ctrl_new_std(&core->audio_hdl, &cx8800_ctrl_aud_ops, in cx8800_initdev()
1323 err = core->audio_hdl.error; in cx8800_initdev()
1333 vc = v4l2_ctrl_new_std(&core->video_hdl, &cx8800_ctrl_vid_ops, in cx8800_initdev()
1337 err = core->video_hdl.error; in cx8800_initdev()
1342 core->chroma_agc = vc; in cx8800_initdev()
1344 v4l2_ctrl_add_handler(&core->video_hdl, &core->audio_hdl, NULL, false); in cx8800_initdev()
1348 if (core->board.audio_chip == CX88_AUDIO_WM8775) { in cx8800_initdev()
1352 .platform_data = &core->wm8775_data, in cx8800_initdev()
1356 if (core->boardnr == CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1) in cx8800_initdev()
1357 core->wm8775_data.is_nova_s = true; in cx8800_initdev()
1359 core->wm8775_data.is_nova_s = false; in cx8800_initdev()
1361 sd = v4l2_i2c_new_subdev_board(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1364 core->sd_wm8775 = sd; in cx8800_initdev()
1369 if (core->board.audio_chip == CX88_AUDIO_TVAUDIO) { in cx8800_initdev()
1374 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1378 switch (core->boardnr) { in cx8800_initdev()
1386 core->i2c_rtc = i2c_new_client_device(&core->i2c_adap, &rtc_info); in cx8800_initdev()
1399 core->v4ldev = dev; in cx8800_initdev()
1402 mutex_lock(&core->lock); in cx8800_initdev()
1403 cx88_set_tvnorm(core, V4L2_STD_NTSC_M); in cx8800_initdev()
1404 v4l2_ctrl_handler_setup(&core->video_hdl); in cx8800_initdev()
1405 v4l2_ctrl_handler_setup(&core->audio_hdl); in cx8800_initdev()
1406 cx88_video_mux(core, 0); in cx8800_initdev()
1418 q->lock = &core->lock; in cx8800_initdev()
1435 q->lock = &core->lock; in cx8800_initdev()
1443 cx88_vdev_init(core, dev->pci, &dev->video_dev, in cx8800_initdev()
1446 dev->video_dev.ctrl_handler = &core->video_hdl; in cx8800_initdev()
1450 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1453 video_nr[core->nr]); in cx8800_initdev()
1461 cx88_vdev_init(core, dev->pci, &dev->vbi_dev, in cx8800_initdev()
1467 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1470 vbi_nr[core->nr]); in cx8800_initdev()
1478 if (core->board.radio.type == CX88_RADIO) { in cx8800_initdev()
1479 cx88_vdev_init(core, dev->pci, &dev->radio_dev, in cx8800_initdev()
1482 dev->radio_dev.ctrl_handler = &core->audio_hdl; in cx8800_initdev()
1485 radio_nr[core->nr]); in cx8800_initdev()
1495 if (core->board.tuner_type != UNSET) { in cx8800_initdev()
1496 core->kthread = kthread_run(cx88_audio_thread, in cx8800_initdev()
1497 core, "cx88 tvaudio"); in cx8800_initdev()
1498 if (IS_ERR(core->kthread)) { in cx8800_initdev()
1499 err = PTR_ERR(core->kthread); in cx8800_initdev()
1504 mutex_unlock(&core->lock); in cx8800_initdev()
1510 mutex_unlock(&core->lock); in cx8800_initdev()
1514 core->v4ldev = NULL; in cx8800_initdev()
1515 cx88_core_put(core, dev->pci); in cx8800_initdev()
1526 struct cx88_core *core = dev->core; in cx8800_finidev() local
1529 if (core->kthread) { in cx8800_finidev()
1530 kthread_stop(core->kthread); in cx8800_finidev()
1531 core->kthread = NULL; in cx8800_finidev()
1534 if (core->ir) in cx8800_finidev()
1535 cx88_ir_stop(core); in cx8800_finidev()
1537 cx88_shutdown(core); /* FIXME */ in cx8800_finidev()
1545 core->v4ldev = NULL; in cx8800_finidev()
1548 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()
1582 struct cx88_core *core = dev->core; in cx8800_resume() local
1588 cx88_reset(core); in cx8800_resume()
1589 if (core->ir) in cx8800_resume()
1590 cx88_ir_start(core); in cx8800_resume()
1592 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_resume()