diff -r 025ebbfcfcff linux/drivers/media/video/cx88/cx88-video.c --- a/linux/drivers/media/video/cx88/cx88-video.c Sat Mar 10 08:30:12 2007 -0200 +++ b/linux/drivers/media/video/cx88/cx88-video.c Tue Mar 13 00:47:42 2007 +0000 @@ -416,6 +416,34 @@ int cx88_video_mux(struct cx88_core *cor else cx_clear(AUD_CTL, EN_I2SIN_ENABLE); } + + /* If we're not using television, we want to route the audio + from I2S, not the tuner */ + + if (INPUT(input)->type != CX88_VMUX_TELEVISION) { + /* ADC mode */ + cx_write(AUD_I2SCNTL, 0x1); + cx_set(AUD_CTL, EN_I2SIN_ENABLE); + cx_clear(AUD_CTL, EN_I2SOUT_ENABLE); + if (cx88_boards[core->board].audio_chip == AUDIO_CHIP_WM8775) { + struct v4l2_routing route; + + route.input = 2; + cx88_call_i2c_clients(core,VIDIOC_INT_S_AUDIO_ROUTING,&route); + } + } else { + /* Normal mode */ + cx_write(AUD_I2SCNTL, 0x8); + cx_set(AUD_CTL, EN_I2SIN_ENABLE); + cx_set(AUD_CTL, EN_I2SOUT_ENABLE); + if (cx88_boards[core->board].audio_chip == AUDIO_CHIP_WM8775) { + struct v4l2_routing route; + + route.input = 1; + cx88_call_i2c_clients(core,VIDIOC_INT_S_AUDIO_ROUTING,&route); + } + } + return 0; } EXPORT_SYMBOL(cx88_video_mux);