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()
542 struct cx88_core *core = dev->core; in stop_streaming() local
575 struct cx88_core *core = dev->core; in radio_open() local
581 cx_write(MO_GP3_IO, core->board.radio.gpio3); in radio_open()
582 cx_write(MO_GP0_IO, core->board.radio.gpio0); in radio_open()
583 cx_write(MO_GP1_IO, core->board.radio.gpio1); in radio_open()
584 cx_write(MO_GP2_IO, core->board.radio.gpio2); in radio_open()
585 if (core->board.radio.audioroute) { in radio_open()
586 if (core->sd_wm8775) { in radio_open()
587 call_all(core, audio, s_routing, in radio_open()
588 core->board.radio.audioroute, 0, 0); in radio_open()
591 core->tvaudio = WW_I2SADC; in radio_open()
592 cx88_set_tvaudio(core); in radio_open()
595 core->tvaudio = WW_FM; in radio_open()
596 cx88_set_tvaudio(core); in radio_open()
597 cx88_set_stereo(core, V4L2_TUNER_MODE_STEREO, 1); in radio_open()
599 call_all(core, tuner, s_radio); in radio_open()
608 struct cx88_core *core = in cx8800_s_vid_ctrl() local
620 if (core->tvnorm & V4L2_STD_SECAM) { in cx8800_s_vid_ctrl()
655 struct cx88_core *core = in cx8800_s_aud_ctrl() local
661 if (core->sd_wm8775) { in cx8800_s_aud_ctrl()
664 wm8775_s_ctrl(core, ctrl->id, ctrl->val); in cx8800_s_aud_ctrl()
667 wm8775_s_ctrl(core, ctrl->id, (ctrl->val) ? in cx8800_s_aud_ctrl()
671 wm8775_s_ctrl(core, ctrl->id, ctrl->val << 9); in cx8800_s_aud_ctrl()
709 struct cx88_core *core = dev->core; in vidioc_g_fmt_vid_cap() local
711 f->fmt.pix.width = core->width; in vidioc_g_fmt_vid_cap()
712 f->fmt.pix.height = core->height; in vidioc_g_fmt_vid_cap()
713 f->fmt.pix.field = core->field; in vidioc_g_fmt_vid_cap()
727 struct cx88_core *core = dev->core; in vidioc_try_fmt_vid_cap() local
736 maxw = norm_maxw(core->tvnorm); in vidioc_try_fmt_vid_cap()
737 maxh = norm_maxh(core->tvnorm); in vidioc_try_fmt_vid_cap()
773 struct cx88_core *core = dev->core; in vidioc_s_fmt_vid_cap() local
780 if (core->dvbdev && vb2_is_busy(&core->dvbdev->vb2_mpegq)) in vidioc_s_fmt_vid_cap()
783 core->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
784 core->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
785 core->field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
789 int cx88_querycap(struct file *file, struct cx88_core *core, in cx88_querycap() argument
792 strscpy(cap->card, core->board.name, sizeof(cap->card)); in cx88_querycap()
796 if (core->board.tuner_type != UNSET) in cx88_querycap()
798 if (core->board.radio.type == CX88_RADIO) in cx88_querycap()
808 struct cx88_core *core = dev->core; in vidioc_querycap() local
812 return cx88_querycap(file, core, cap); in vidioc_querycap()
829 struct cx88_core *core = dev->core; in vidioc_g_std() local
831 *tvnorm = core->tvnorm; in vidioc_g_std()
838 struct cx88_core *core = dev->core; in vidioc_s_std() local
840 return cx88_set_tvnorm(core, tvnorms); in vidioc_s_std()
844 int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i) in cx88_enum_input() argument
878 struct cx88_core *core = dev->core; in vidioc_enum_input() local
880 return cx88_enum_input(core, i); in vidioc_enum_input()
886 struct cx88_core *core = dev->core; in vidioc_g_input() local
888 *i = core->input; in vidioc_g_input()
895 struct cx88_core *core = dev->core; in vidioc_s_input() local
902 cx88_newstation(core); in vidioc_s_input()
903 cx88_video_mux(core, i); in vidioc_s_input()
911 struct cx88_core *core = dev->core; in vidioc_g_tuner() local
914 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_tuner()
922 call_all(core, tuner, g_tuner, t); in vidioc_g_tuner()
924 cx88_get_stereo(core, t); in vidioc_g_tuner()
934 struct cx88_core *core = dev->core; in vidioc_s_tuner() local
936 if (core->board.tuner_type == UNSET) in vidioc_s_tuner()
941 cx88_set_stereo(core, t->audmode, 1); in vidioc_s_tuner()
949 struct cx88_core *core = dev->core; in vidioc_g_frequency() local
951 if (unlikely(core->board.tuner_type == UNSET)) in vidioc_g_frequency()
956 f->frequency = core->freq; in vidioc_g_frequency()
958 call_all(core, tuner, g_frequency, f); in vidioc_g_frequency()
963 int cx88_set_freq(struct cx88_core *core, in cx88_set_freq() argument
968 if (unlikely(core->board.tuner_type == UNSET)) in cx88_set_freq()
973 cx88_newstation(core); in cx88_set_freq()
974 call_all(core, tuner, s_frequency, f); in cx88_set_freq()
975 call_all(core, tuner, g_frequency, &new_freq); in cx88_set_freq()
976 core->freq = new_freq.frequency; in cx88_set_freq()
980 cx88_set_tvaudio(core); in cx88_set_freq()
990 struct cx88_core *core = dev->core; in vidioc_s_frequency() local
992 return cx88_set_freq(core, f); in vidioc_s_frequency()
1000 struct cx88_core *core = dev->core; in vidioc_g_register() local
1012 struct cx88_core *core = dev->core; in vidioc_s_register() local
1027 struct cx88_core *core = dev->core; in radio_g_tuner() local
1034 call_all(core, tuner, g_tuner, t); in radio_g_tuner()
1042 struct cx88_core *core = dev->core; in radio_s_tuner() local
1047 call_all(core, tuner, s_tuner, t); in radio_s_tuner()
1063 struct cx88_core *core = dev->core; in cx8800_vid_irq() local
1081 cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); in cx8800_vid_irq()
1088 cx88_wakeup(core, &dev->vidq, count); in cx8800_vid_irq()
1096 cx88_wakeup(core, &dev->vbiq, count); in cx8800_vid_irq()
1104 struct cx88_core *core = dev->core; in cx8800_irq() local
1110 (core->pci_irqmask | PCI_INT_VIDINT); in cx8800_irq()
1116 if (status & core->pci_irqmask) in cx8800_irq()
1117 cx88_core_irq(core, status); in cx8800_irq()
1261 struct cx88_core *core; in cx8800_initdev() local
1276 core = cx88_core_get(dev->pci); in cx8800_initdev()
1277 if (!core) { in cx8800_initdev()
1281 dev->core = core; in cx8800_initdev()
1309 IRQF_SHARED, core->name, dev); in cx8800_initdev()
1314 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_initdev()
1320 vc = v4l2_ctrl_new_std(&core->audio_hdl, &cx8800_ctrl_aud_ops, in cx8800_initdev()
1324 err = core->audio_hdl.error; in cx8800_initdev()
1334 vc = v4l2_ctrl_new_std(&core->video_hdl, &cx8800_ctrl_vid_ops, in cx8800_initdev()
1338 err = core->video_hdl.error; in cx8800_initdev()
1343 core->chroma_agc = vc; in cx8800_initdev()
1345 v4l2_ctrl_add_handler(&core->video_hdl, &core->audio_hdl, NULL, false); in cx8800_initdev()
1349 if (core->board.audio_chip == CX88_AUDIO_WM8775) { in cx8800_initdev()
1353 .platform_data = &core->wm8775_data, in cx8800_initdev()
1357 if (core->boardnr == CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1) in cx8800_initdev()
1358 core->wm8775_data.is_nova_s = true; in cx8800_initdev()
1360 core->wm8775_data.is_nova_s = false; in cx8800_initdev()
1362 sd = v4l2_i2c_new_subdev_board(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1365 core->sd_wm8775 = sd; in cx8800_initdev()
1370 if (core->board.audio_chip == CX88_AUDIO_TVAUDIO) { in cx8800_initdev()
1375 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, in cx8800_initdev()
1379 switch (core->boardnr) { in cx8800_initdev()
1387 core->i2c_rtc = i2c_new_client_device(&core->i2c_adap, &rtc_info); in cx8800_initdev()
1400 core->v4ldev = dev; in cx8800_initdev()
1403 mutex_lock(&core->lock); in cx8800_initdev()
1404 cx88_set_tvnorm(core, V4L2_STD_NTSC_M); in cx8800_initdev()
1405 v4l2_ctrl_handler_setup(&core->video_hdl); in cx8800_initdev()
1406 v4l2_ctrl_handler_setup(&core->audio_hdl); in cx8800_initdev()
1407 cx88_video_mux(core, 0); in cx8800_initdev()
1419 q->lock = &core->lock; in cx8800_initdev()
1436 q->lock = &core->lock; in cx8800_initdev()
1444 cx88_vdev_init(core, dev->pci, &dev->video_dev, in cx8800_initdev()
1447 dev->video_dev.ctrl_handler = &core->video_hdl; in cx8800_initdev()
1451 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1454 video_nr[core->nr]); in cx8800_initdev()
1462 cx88_vdev_init(core, dev->pci, &dev->vbi_dev, in cx8800_initdev()
1468 if (core->board.tuner_type != UNSET) in cx8800_initdev()
1471 vbi_nr[core->nr]); in cx8800_initdev()
1479 if (core->board.radio.type == CX88_RADIO) { in cx8800_initdev()
1480 cx88_vdev_init(core, dev->pci, &dev->radio_dev, in cx8800_initdev()
1483 dev->radio_dev.ctrl_handler = &core->audio_hdl; in cx8800_initdev()
1486 radio_nr[core->nr]); in cx8800_initdev()
1496 if (core->board.tuner_type != UNSET) { in cx8800_initdev()
1497 core->kthread = kthread_run(cx88_audio_thread, in cx8800_initdev()
1498 core, "cx88 tvaudio"); in cx8800_initdev()
1499 if (IS_ERR(core->kthread)) { in cx8800_initdev()
1500 err = PTR_ERR(core->kthread); in cx8800_initdev()
1505 mutex_unlock(&core->lock); in cx8800_initdev()
1511 mutex_unlock(&core->lock); in cx8800_initdev()
1515 core->v4ldev = NULL; in cx8800_initdev()
1516 cx88_core_put(core, dev->pci); in cx8800_initdev()
1527 struct cx88_core *core = dev->core; in cx8800_finidev() local
1530 if (core->kthread) { in cx8800_finidev()
1531 kthread_stop(core->kthread); in cx8800_finidev()
1532 core->kthread = NULL; in cx8800_finidev()
1535 if (core->ir) in cx8800_finidev()
1536 cx88_ir_stop(core); in cx8800_finidev()
1538 cx88_shutdown(core); /* FIXME */ in cx8800_finidev()
1546 core->v4ldev = NULL; in cx8800_finidev()
1549 cx88_core_put(core, dev->pci); in cx8800_finidev()
1556 struct cx88_core *core = dev->core; in cx8800_suspend() local
1571 if (core->ir) in cx8800_suspend()
1572 cx88_ir_stop(core); in cx8800_suspend()
1574 cx88_shutdown(core); in cx8800_suspend()
1583 struct cx88_core *core = dev->core; in cx8800_resume() local
1589 cx88_reset(core); in cx8800_resume()
1590 if (core->ir) in cx8800_resume()
1591 cx88_ir_start(core); in cx8800_resume()
1593 cx_set(MO_PCI_INTMSK, core->pci_irqmask); in cx8800_resume()