diff options
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-video.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 0d357a4be..0eb63220b 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -384,17 +384,17 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) /* struct cx88_core *core = dev->core; */ dprintk(1,"video_mux: %d [vmux=%d,gpio=0x%x,0x%x,0x%x,0x%x]\n", - input, INPUT(input)->vmux, - INPUT(input)->gpio0,INPUT(input)->gpio1, - INPUT(input)->gpio2,INPUT(input)->gpio3); + input, INPUT(input).vmux, + INPUT(input).gpio0,INPUT(input).gpio1, + INPUT(input).gpio2,INPUT(input).gpio3); core->input = input; - cx_andor(MO_INPUT_FORMAT, 0x03 << 14, INPUT(input)->vmux << 14); - cx_write(MO_GP3_IO, INPUT(input)->gpio3); - cx_write(MO_GP0_IO, INPUT(input)->gpio0); - cx_write(MO_GP1_IO, INPUT(input)->gpio1); - cx_write(MO_GP2_IO, INPUT(input)->gpio2); + cx_andor(MO_INPUT_FORMAT, 0x03 << 14, INPUT(input).vmux << 14); + cx_write(MO_GP3_IO, INPUT(input).gpio3); + cx_write(MO_GP0_IO, INPUT(input).gpio0); + cx_write(MO_GP1_IO, INPUT(input).gpio1); + cx_write(MO_GP2_IO, INPUT(input).gpio2); - switch (INPUT(input)->type) { + switch (INPUT(input).type) { case CX88_VMUX_SVIDEO: cx_set(MO_AFECFG_IO, 0x00000001); cx_set(MO_INPUT_FORMAT, 0x00010010); @@ -409,9 +409,9 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) break; } - if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) { + if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { /* sets sound input from external adc */ - if (INPUT(input)->extadc) + if (INPUT(input).extadc) cx_set(AUD_CTL, EN_I2SIN_ENABLE); else cx_clear(AUD_CTL, EN_I2SIN_ENABLE); @@ -1008,12 +1008,11 @@ static int video_open(struct inode *inode, struct file *file) fh); if (fh->radio) { - int board = core->board; dprintk(1,"video_open: setting radio device\n"); - cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); - cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); - cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); - cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); + cx_write(MO_GP3_IO, core->board.radio.gpio3); + cx_write(MO_GP0_IO, core->board.radio.gpio0); + cx_write(MO_GP1_IO, core->board.radio.gpio1); + cx_write(MO_GP2_IO, core->board.radio.gpio2); core->tvaudio = WW_FM; cx88_set_tvaudio(core); cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); @@ -1327,8 +1326,7 @@ static int vidioc_querycap (struct file *file, void *priv, struct cx88_core *core = dev->core; strcpy(cap->driver, "cx8800"); - strlcpy(cap->card, cx88_boards[core->board].name, - sizeof(cap->card)); + strlcpy(cap->card, core->board.name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); cap->version = CX88_VERSION_CODE; cap->capabilities = @@ -1339,7 +1337,7 @@ static int vidioc_querycap (struct file *file, void *priv, V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_VBI_CAPTURE; - if (UNSET != core->tuner_type) + if (UNSET != core->board.tuner_type) cap->capabilities |= V4L2_CAP_TUNER; return 0; } @@ -1473,14 +1471,14 @@ int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i) n = i->index; if (n >= 4) return -EINVAL; - if (0 == INPUT(n)->type) + if (0 == INPUT(n).type) return -EINVAL; memset(i,0,sizeof(*i)); i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; - strcpy(i->name,iname[INPUT(n)->type]); - if ((CX88_VMUX_TELEVISION == INPUT(n)->type) || - (CX88_VMUX_CABLE == INPUT(n)->type)) + strcpy(i->name,iname[INPUT(n).type]); + if ((CX88_VMUX_TELEVISION == INPUT(n).type) || + (CX88_VMUX_CABLE == INPUT(n).type)) i->type = V4L2_INPUT_TYPE_TUNER; i->std = CX88_NORMS; return 0; @@ -1527,15 +1525,15 @@ static int vidioc_g_audio (struct file *file, void *priv, unsigned int i) a->index = n; switch (n) { case 0: - if ((CX88_VMUX_TELEVISION == INPUT(n)->type) - || (CX88_VMUX_CABLE == INPUT(n)->type)) { + if ((CX88_VMUX_TELEVISION == INPUT(n).type) || + (CX88_VMUX_CABLE == INPUT(n).type)) { strcpy(a->name,"Television"); /* FIXME figure out if stereo received and set V4L2_AUDCAP_STEREO. */ return 0; } break; case 1: - if (CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q == core->board) { + if (CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q == core->boardnr) { strcpy(a->name,"Line In"); a->capability = V4L2_AUDCAP_STEREO; return 0; @@ -1578,7 +1576,7 @@ static int vidioc_g_tuner (struct file *file, void *priv, struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; u32 reg; - if (unlikely(UNSET == core->tuner_type)) + if (unlikely(UNSET == core->board.tuner_type)) return -EINVAL; if (0 != t->index) return -EINVAL; @@ -1599,7 +1597,7 @@ static int vidioc_s_tuner (struct file *file, void *priv, { struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; - if (UNSET == core->tuner_type) + if (UNSET == core->board.tuner_type) return -EINVAL; if (0 != t->index) return -EINVAL; @@ -1614,7 +1612,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, struct cx8800_fh *fh = priv; struct cx88_core *core = fh->dev->core; - if (unlikely(UNSET == core->tuner_type)) + if (unlikely(UNSET == core->board.tuner_type)) return -EINVAL; /* f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; */ @@ -1629,7 +1627,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, int cx88_set_freq (struct cx88_core *core, struct v4l2_frequency *f) { - if (unlikely(UNSET == core->tuner_type)) + if (unlikely(UNSET == core->board.tuner_type)) return -EINVAL; if (unlikely(f->tuner != 0)) return -EINVAL; @@ -1700,8 +1698,7 @@ static int radio_querycap (struct file *file, void *priv, struct cx88_core *core = dev->core; strcpy(cap->driver, "cx8800"); - strlcpy(cap->card, cx88_boards[core->board].name, - sizeof(cap->card)); + strlcpy(cap->card, core->board.name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); cap->version = CX88_VERSION_CODE; cap->capabilities = V4L2_CAP_TUNER; @@ -2121,10 +2118,10 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, cx_set(MO_PCI_INTMSK, core->pci_irqmask); /* load and configure helper modules */ - if (TUNER_ABSENT != core->tuner_type) + if (TUNER_ABSENT != core->board.tuner_type) request_module("tuner"); - if (cx88_boards[ core->board ].audio_chip == AUDIO_CHIP_WM8775) + if (core->board.audio_chip == AUDIO_CHIP_WM8775) request_module("wm8775"); /* register v4l devices */ @@ -2151,7 +2148,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, printk(KERN_INFO "%s/0: registered device vbi%d\n", core->name,dev->vbi_dev->minor & 0x1f); - if (core->has_radio) { + if (core->board.radio.type == CX88_RADIO) { dev->radio_dev = cx88_vdev_init(core,dev->pci, &cx8800_radio_template,"radio"); err = video_register_device(dev->radio_dev,VFL_TYPE_RADIO, @@ -2178,7 +2175,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* start tvaudio thread */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - if (core->tuner_type != TUNER_ABSENT) { + if (core->board.tuner_type != TUNER_ABSENT) { core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio"); if (IS_ERR(core->kthread)) { err = PTR_ERR(core->kthread); @@ -2188,7 +2185,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, } #else /*FIXME: Not sure if this will work */ - if (core->tuner_type != TUNER_ABSENT) + if (core->board.tuner_type != TUNER_ABSENT) kernel_thread (cx88_audio_thread, core, 0); core->kthread = NULL; |