diff options
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-alsa.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-cards.c | 25 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-dvb.c | 24 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-mpeg.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-tvaudio.c | 11 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 52 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88.h | 1 |
8 files changed, 84 insertions, 44 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c index c675cbeae..3dd2f6629 100644 --- a/linux/drivers/media/video/cx88/cx88-alsa.c +++ b/linux/drivers/media/video/cx88/cx88-alsa.c @@ -60,7 +60,7 @@ #define timestamp() if(debug>=2) { u64 time; u32 rem; rdtscll(time); \ time = (time - chip->starttime)<<12; \ rem = do_div(time, INT); \ - dprintk(2, "%s - called at %u.%03u us\n", __FUNCTION__, \ + dprintk(2, "%s - called at %u.%03u us\n", __func__, \ (unsigned int)time, (rem << 9) / FRAC); } #endif /**************************************************************************** diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index eac3508d6..1a79387c0 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -1314,22 +1314,26 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x84bf, + /* 1: TV Audio / FM Mono */ .audioroute = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0x84bf, + /* 2: Line-In */ .audioroute = 2, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x84bf, + /* 2: Line-In */ .audioroute = 2, }}, - /* FIXME Radio tunes but only noise is heard */ .radio = { .type = CX88_RADIO, .gpio0 = 0x84bf, + /* 4: FM Stereo (untested) */ + .audioroute = 8, }, .mpeg = CX88_MPEG_DVB, .num_frontends = 2, @@ -1398,23 +1402,27 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0xef88, + /* 1: TV Audio / FM Mono */ .audioroute = 1, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0xef88, + /* 2: Line-In */ .audioroute = 2, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0xef88, + /* 2: Line-In */ .audioroute = 2, }}, - /* fixme: Add radio support */ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, .radio = { .type = CX88_RADIO, .gpio0 = 0xef88, + /* 4: FM Stereo (untested) */ + .audioroute = 8, }, }, [CX88_BOARD_ADSTECH_PTV_390] = { @@ -1788,27 +1796,38 @@ static const struct cx88_board cx88_boards[] = { * d 0 I * e 1 O * f 1 O + * + * WM8775 ADC + * + * 1: TV Audio / FM Mono + * 2: Line-In + * 3: Line-In Expansion + * 4: FM Stereo */ .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0xc4bf, + /* 1: TV Audio / FM Mono */ .audioroute = 1, }, { .type = CX88_VMUX_COMPOSITE1, .vmux = 1, .gpio0 = 0xc4bf, + /* 2: Line-In */ .audioroute = 2, }, { .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0xc4bf, + /* 2: Line-In */ .audioroute = 2, } }, - /* FIXME Radio tunes but only noise is heard */ .radio = { .type = CX88_RADIO, .gpio0 = 0xc4bf, + /* 4: FM Stereo */ + .audioroute = 8, }, .mpeg = CX88_MPEG_DVB, .num_frontends = 2, diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 4ce5f7589..b2f6dc5c3 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -574,7 +574,8 @@ void cx88_wakeup(struct cx88_core *core, mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); } if (bc != 1) - printk("%s: %d buffers handled (should be 1)\n",__func__,bc); + dprintk(2, "%s: %d buffers handled (should be 1)\n", + __func__, bc); } void cx88_shutdown(struct cx88_core *core) diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c index 1a0f971c6..180c9ca11 100644 --- a/linux/drivers/media/video/cx88/cx88-dvb.c +++ b/linux/drivers/media/video/cx88/cx88-dvb.c @@ -121,7 +121,7 @@ static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire) fe_id = videobuf_dvb_find_frontend(&dev->frontends, fe); if (!fe_id) { - printk(KERN_ERR "%s() No frontend found\n", __FUNCTION__); + printk(KERN_ERR "%s() No frontend found\n", __func__); return -EINVAL; } @@ -662,10 +662,10 @@ static int dvb_register(struct cx8802_dev *dev) if (fe0->dvb.frontend) { if (!dvb_attach(isl6421_attach, fe0->dvb.frontend, &dev->core->i2c_adap, 0x08, ISL6421_DCL, 0x00)) { - dprintk( 1, "%s(): HVR3000 - DVB-S LNB Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR3000 - DVB-S LNB Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR3000 - DVB-S Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR3000 - DVB-S Init: failed\n", __func__); } /* DVB-T init */ fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2); @@ -680,13 +680,13 @@ static int dvb_register(struct cx8802_dev *dev) if(!dvb_attach(simple_tuner_attach, fe1->dvb.frontend, &dev->core->i2c_adap, 0x61, TUNER_PHILIPS_FMD1216ME_MK3)) { - dprintk( 1, "%s(): HVR3000 - DVB-T misc Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR3000 - DVB-T misc Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR3000 - DVB-T Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR3000 - DVB-T Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR3000 - DVB-T Init: can't find frontend 2.\n", __FUNCTION__); + dprintk( 1, "%s(): HVR3000 - DVB-T Init: can't find frontend 2.\n", __func__); } break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: @@ -1007,10 +1007,10 @@ static int dvb_register(struct cx8802_dev *dev) if (fe0->dvb.frontend) { if(!dvb_attach(isl6421_attach, fe0->dvb.frontend, &dev->core->i2c_adap, 0x08, ISL6421_DCL, 0x00)) { - dprintk( 1, "%s(): HVR4000 - DVB-S LNB Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR4000 - DVB-S LNB Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR4000 - DVB-S Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR4000 - DVB-S Init: failed\n", __func__); } /* DVB-T Init */ fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2); @@ -1025,13 +1025,13 @@ static int dvb_register(struct cx8802_dev *dev) if(!dvb_attach(simple_tuner_attach, fe1->dvb.frontend, &dev->core->i2c_adap, 0x61, TUNER_PHILIPS_FMD1216ME_MK3)) { - dprintk( 1, "%s(): HVR4000 - DVB-T misc Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR4000 - DVB-T misc Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR4000 - DVB-T Init: failed\n", __FUNCTION__); + dprintk( 1, "%s(): HVR4000 - DVB-T Init: failed\n", __func__); } } else { - dprintk( 1, "%s(): HVR4000 - DVB-T Init: can't find frontend 2.\n", __FUNCTION__); + dprintk( 1, "%s(): HVR4000 - DVB-T Init: can't find frontend 2.\n", __func__); } break; case CX88_BOARD_HAUPPAUGE_HVR4000LITE: @@ -1234,7 +1234,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) for (i = 1; i <= core->board.num_frontends; i++) { fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i); if (!fe) { - printk(KERN_ERR "%s() failed to get frontend(%d)\n", __FUNCTION__, i); + printk(KERN_ERR "%s() failed to get frontend(%d)\n", __func__, i); continue; } videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops, diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index 88c237790..bad3680b9 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -823,7 +823,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, goto fail_core; if (!core->board.num_frontends) { - printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __FUNCTION__, err); + printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __func__, err); goto fail_core; } @@ -842,14 +842,14 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev, list_add_tail(&dev->devlist,&cx8802_devlist); mutex_init(&dev->frontends.lock); - INIT_LIST_HEAD(&dev->frontends.frontend.felist); + INIT_LIST_HEAD(&dev->frontends.felist); - printk(KERN_INFO "%s() allocating %d frontend(s)\n", __FUNCTION__, core->board.num_frontends); + printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); for (i = 1; i <= core->board.num_frontends; i++) { - demod = videobuf_dvb_alloc_frontend(dev, &dev->frontends, i); + demod = videobuf_dvb_alloc_frontend(&dev->frontends, i); if(demod == NULL) { - printk(KERN_ERR "%s() failed to alloc\n", __FUNCTION__); + printk(KERN_ERR "%s() failed to alloc\n", __func__); err = -ENOMEM; goto fail_free; } diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index 5eb95dbbe..0039354cf 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -771,6 +771,14 @@ void cx88_set_tvaudio(struct cx88_core *core) case WW_FM: set_audio_standard_FM(core, radio_deemphasis); break; + case WW_I2SADC: + set_audio_start(core, 0x01); + /* Slave/Philips/Autobaud */ + cx_write(AUD_I2SINPUTCNTL, 0); + /* Switch to "I2S ADC mode" */ + cx_write(AUD_I2SCNTL, 0x1); + set_audio_finish(core, EN_I2SIN_ENABLE); + break; case WW_NONE: default: printk("%s/0: unknown tv audio mode [%d]\n", @@ -948,6 +956,9 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual) break; } break; + case WW_I2SADC: + /* DO NOTHING */ + break; } if (UNSET != ctl) { diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index c4fdb6da2..79b6b0b6d 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -427,24 +427,7 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) /* if there are audioroutes defined, we have an external ADC to deal with audio */ - if (INPUT(input).audioroute) { - - /* cx2388's C-ADC is connected to the tuner only. - When used with S-Video, that ADC is busy dealing with - chroma, so an external must be used for baseband audio */ - - if (INPUT(input).type != CX88_VMUX_TELEVISION && - INPUT(input).type != CX88_RADIO) { - /* "ADC mode" */ - cx_write(AUD_I2SCNTL, 0x1); - cx_set(AUD_CTL, EN_I2SIN_ENABLE); - } else { - /* Normal mode */ - cx_write(AUD_I2SCNTL, 0x0); - cx_clear(AUD_CTL, EN_I2SIN_ENABLE); - } - /* The wm8775 module has the "2" route hardwired into the initialization. Some boards may use different routes for different inputs. HVR-1300 surely does */ @@ -455,9 +438,19 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) route.input = INPUT(input).audioroute; cx88_call_i2c_clients(core, VIDIOC_INT_S_AUDIO_ROUTING, &route); - } - + /* cx2388's C-ADC is connected to the tuner only. + When used with S-Video, that ADC is busy dealing with + chroma, so an external must be used for baseband audio */ + if (INPUT(input).type != CX88_VMUX_TELEVISION ) { + /* "I2S ADC mode" */ + core->tvaudio = WW_I2SADC; + cx88_set_tvaudio(core); + } else { + /* Normal mode */ + cx_write(AUD_I2SCNTL, 0x0); + cx_clear(AUD_CTL, EN_I2SIN_ENABLE); + } } return 0; @@ -1058,9 +1051,24 @@ static int video_open(struct inode *inode, struct file *file) 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); + if (core->board.radio.audioroute) { + if(core->board.audio_chip && + core->board.audio_chip == V4L2_IDENT_WM8775) { + struct v4l2_routing route; + + route.input = core->board.radio.audioroute; + cx88_call_i2c_clients(core, + VIDIOC_INT_S_AUDIO_ROUTING, &route); + } + /* "I2S ADC mode" */ + core->tvaudio = WW_I2SADC; + cx88_set_tvaudio(core); + } else { + /* FM Mode */ + core->tvaudio = WW_FM; + cx88_set_tvaudio(core); + cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); + } cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); } unlock_kernel(); diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 774c0b9b1..0fc7c91f7 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -651,6 +651,7 @@ extern void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl); #define WW_EIAJ 7 #define WW_I2SPT 8 #define WW_FM 9 +#define WW_I2SADC 10 void cx88_set_tvaudio(struct cx88_core *core); void cx88_newstation(struct cx88_core *core); |