From bdbbe79cdde094319f28e840abb5c009381aa8a7 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Tue, 16 Oct 2007 20:52:08 -0300 Subject: [PATCH] --- yaml --- r: 76595 b: refs/heads/master c: 66e6fbdf99420efe58685feda0ac1b73b33400e0 h: refs/heads/master i: 76593: ed6575e64453ebb7ee03ed1872b984e856cdaa85 76591: 2060e27641539d40e7949b1b2078b330817cecf8 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx88/cx88-video.c | 46 ++++++++++++++------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index a81bc71867a5..ab6e4eaa17ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6a0bc9a0162d10c551bb916a1a21bfede4db3203 +refs/heads/master: 66e6fbdf99420efe58685feda0ac1b73b33400e0 diff --git a/trunk/drivers/media/video/cx88/cx88-video.c b/trunk/drivers/media/video/cx88/cx88-video.c index 1b80f0f700e6..c8a5cd5eedf3 100644 --- a/trunk/drivers/media/video/cx88/cx88-video.c +++ b/trunk/drivers/media/video/cx88/cx88-video.c @@ -392,25 +392,41 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input) break; } - if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { - /* sets sound input from external adc */ - if (INPUT(input).audioroute) { - /* The wm8775 module has the "2" route hardwired into - the initialization. Some boards may use different - routes for different inputs. HVR-1300 surely does */ - if (core->board.audio_chip && - core->board.audio_chip == AUDIO_CHIP_WM8775) { - struct v4l2_routing route; - - route.input = INPUT(input).audioroute; - cx88_call_i2c_clients(core, - VIDIOC_INT_S_AUDIO_ROUTING,&route); - } + /* 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 + } 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 */ + if (core->board.audio_chip && + core->board.audio_chip == AUDIO_CHIP_WM8775) { + struct v4l2_routing route; + + route.input = INPUT(input).audioroute; + cx88_call_i2c_clients(core, + VIDIOC_INT_S_AUDIO_ROUTING,&route); + + } + } + return 0; } EXPORT_SYMBOL(cx88_video_mux);