Lines Matching refs:core
65 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \
333 int cx88_sram_channel_setup(struct cx88_core *core, in cx88_sram_channel_setup() argument
412 void cx88_sram_channel_dump(struct cx88_core *core, in cx88_sram_channel_dump() argument
432 core->name,ch->name); in cx88_sram_channel_dump()
435 core->name,name[i], in cx88_sram_channel_dump()
439 printk("%s: risc%d: ", core->name, i); in cx88_sram_channel_dump()
447 printk("%s: iq %x: ", core->name, i); in cx88_sram_channel_dump()
452 core->name, i+j, risc, j); in cx88_sram_channel_dump()
457 core->name, ch->fifo_start, ch->fifo_start+ch->fifo_size); in cx88_sram_channel_dump()
459 core->name, ch->ctrl_start, ch->ctrl_start+6*16); in cx88_sram_channel_dump()
461 core->name,cx_read(ch->ptr1_reg)); in cx88_sram_channel_dump()
463 core->name,cx_read(ch->ptr2_reg)); in cx88_sram_channel_dump()
465 core->name,cx_read(ch->cnt1_reg)); in cx88_sram_channel_dump()
467 core->name,cx_read(ch->cnt2_reg)); in cx88_sram_channel_dump()
499 int cx88_core_irq(struct cx88_core *core, u32 status) in cx88_core_irq() argument
504 cx88_ir_irq(core); in cx88_core_irq()
508 cx88_print_irqbits(core->name, "irq pci", in cx88_core_irq()
510 status, core->pci_irqmask); in cx88_core_irq()
514 void cx88_wakeup(struct cx88_core *core, in cx88_wakeup() argument
522 buf->vb.field = core->field; in cx88_wakeup()
528 void cx88_shutdown(struct cx88_core *core) in cx88_shutdown() argument
552 int cx88_reset(struct cx88_core *core) in cx88_reset() argument
555 cx88_shutdown(core); in cx88_reset()
566 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH21], 720*4, 0); in cx88_reset()
567 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH22], 128, 0); in cx88_reset()
568 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH23], 128, 0); in cx88_reset()
569 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH24], 128, 0); in cx88_reset()
570 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); in cx88_reset()
571 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); in cx88_reset()
572 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 188*4, 0); in cx88_reset()
573 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH27], 128, 0); in cx88_reset()
659 int cx88_set_scale(struct cx88_core *core, unsigned int width, unsigned int height, in cx88_set_scale() argument
662 unsigned int swidth = norm_swidth(core->tvnorm); in cx88_set_scale()
663 unsigned int sheight = norm_maxh(core->tvnorm); in cx88_set_scale()
669 v4l2_norm_to_name(core->tvnorm)); in cx88_set_scale()
674 value = (width * norm_hdelay(core->tvnorm)) / swidth; in cx88_set_scale()
690 cx_write(MO_VDELAY_EVEN, norm_vdelay(core->tvnorm)); in cx88_set_scale()
691 cx_write(MO_VDELAY_ODD, norm_vdelay(core->tvnorm)); in cx88_set_scale()
692 dprintk(1,"set_scale: vdelay 0x%04x\n", norm_vdelay(core->tvnorm)); in cx88_set_scale()
706 if (core->tvnorm & V4L2_STD_SECAM) { in cx88_set_scale()
710 if (INPUT(core->input).type == CX88_VMUX_SVIDEO) in cx88_set_scale()
730 static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) in set_pll() argument
746 printk("%s/0: pll out of range\n",core->name); in set_pll()
767 int cx88_start_audio_dma(struct cx88_core *core) in cx88_start_audio_dma() argument
779 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); in cx88_start_audio_dma()
780 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); in cx88_start_audio_dma()
781 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH27], in cx88_start_audio_dma()
793 int cx88_stop_audio_dma(struct cx88_core *core) in cx88_stop_audio_dma() argument
805 static int set_tvaudio(struct cx88_core *core) in set_tvaudio() argument
807 v4l2_std_id norm = core->tvnorm; in set_tvaudio()
809 if (CX88_VMUX_TELEVISION != INPUT(core->input).type && in set_tvaudio()
810 CX88_VMUX_CABLE != INPUT(core->input).type) in set_tvaudio()
814 core->tvaudio = WW_BG; in set_tvaudio()
817 core->tvaudio = WW_DK; in set_tvaudio()
820 core->tvaudio = WW_I; in set_tvaudio()
823 core->tvaudio = WW_L; in set_tvaudio()
826 core->tvaudio = WW_BG; in set_tvaudio()
829 core->tvaudio = WW_DK; in set_tvaudio()
833 core->tvaudio = WW_BTSC; in set_tvaudio()
836 core->tvaudio = WW_EIAJ; in set_tvaudio()
840 core->name, v4l2_norm_to_name(core->tvnorm)); in set_tvaudio()
841 core->tvaudio = WW_NONE; in set_tvaudio()
846 cx88_set_tvaudio(core); in set_tvaudio()
853 cx88_start_audio_dma(core); in set_tvaudio()
859 int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm) in cx88_set_tvnorm() argument
869 if (norm == core->tvnorm) in cx88_set_tvnorm()
871 if (core->v4ldev && (vb2_is_busy(&core->v4ldev->vb2_vidq) || in cx88_set_tvnorm()
872 vb2_is_busy(&core->v4ldev->vb2_vbiq))) in cx88_set_tvnorm()
874 if (core->dvbdev && vb2_is_busy(&core->dvbdev->vb2_mpegq)) in cx88_set_tvnorm()
876 core->tvnorm = norm; in cx88_set_tvnorm()
916 v4l2_norm_to_name(core->tvnorm), fsc8, adc_clock, vdec_clock, in cx88_set_tvnorm()
918 set_pll(core,2,vdec_clock); in cx88_set_tvnorm()
973 cx88_set_scale(core, 320, 240, V4L2_FIELD_INTERLACED); in cx88_set_tvnorm()
976 set_tvaudio(core); in cx88_set_tvnorm()
979 call_all(core, video, s_std, norm); in cx88_set_tvnorm()
982 v4l2_ctrl_grab(core->chroma_agc, cxiformat == VideoFormatSECAM); in cx88_set_tvnorm()
990 void cx88_vdev_init(struct cx88_core *core, in cx88_vdev_init() argument
1004 vfd->v4l2_dev = &core->v4l2_dev; in cx88_vdev_init()
1007 vfd->lock = &core->lock; in cx88_vdev_init()
1009 core->name, type, core->board.name); in cx88_vdev_init()
1014 struct cx88_core *core; in cx88_core_get() local
1017 list_for_each_entry(core, &cx88_devlist, devlist) { in cx88_core_get()
1018 if (pci->bus->number != core->pci_bus) in cx88_core_get()
1020 if (PCI_SLOT(pci->devfn) != core->pci_slot) in cx88_core_get()
1023 if (0 != cx88_get_resources(core, pci)) { in cx88_core_get()
1027 atomic_inc(&core->refcount); in cx88_core_get()
1029 return core; in cx88_core_get()
1032 core = cx88_core_create(pci, cx88_devcount); in cx88_core_get()
1033 if (NULL != core) { in cx88_core_get()
1035 list_add_tail(&core->devlist, &cx88_devlist); in cx88_core_get()
1039 return core; in cx88_core_get()
1042 void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) in cx88_core_put() argument
1047 if (!atomic_dec_and_test(&core->refcount)) in cx88_core_put()
1051 cx88_ir_fini(core); in cx88_core_put()
1052 if (0 == core->i2c_rc) { in cx88_core_put()
1053 if (core->i2c_rtc) in cx88_core_put()
1054 i2c_unregister_device(core->i2c_rtc); in cx88_core_put()
1055 i2c_del_adapter(&core->i2c_adap); in cx88_core_put()
1057 list_del(&core->devlist); in cx88_core_put()
1058 iounmap(core->lmmio); in cx88_core_put()
1061 v4l2_ctrl_handler_free(&core->video_hdl); in cx88_core_put()
1062 v4l2_ctrl_handler_free(&core->audio_hdl); in cx88_core_put()
1063 v4l2_device_unregister(&core->v4l2_dev); in cx88_core_put()
1064 kfree(core); in cx88_core_put()