aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorRicardo Cerqueira <v4l@cerqueira.org>2007-10-16 19:52:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:49 -0500
commit66e6fbdf99420efe58685feda0ac1b73b33400e0 (patch)
treeed2042c07280197c3bfcc308ec232b45ff4b2404 /drivers/media
parent6a0bc9a0162d10c551bb916a1a21bfede4db3203 (diff)
V4L/DVB (6833): Don't limit cx88 audio routing to blackbird boards
All cx2388 boards need the line-in audio to be routed from an external ADC (refered to as "ADC mode" in the spec sheet), since the chip is uncapable of dealing with baseband audio directly. So... this patch enables normal mode when using the tuner (TV or Radio), and enables ADC mode with any other source. It'll probably only work with boards that have supported ADCs (such as the Wolfson wm9775) Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx88/cx88-video.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 1b80f0f700e..c8a5cd5eedf 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -392,25 +392,41 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input)
392 break; 392 break;
393 } 393 }
394 394
395 if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { 395 /* if there are audioroutes defined, we have an external
396 /* sets sound input from external adc */ 396 ADC to deal with audio */
397 if (INPUT(input).audioroute) {
398 /* The wm8775 module has the "2" route hardwired into
399 the initialization. Some boards may use different
400 routes for different inputs. HVR-1300 surely does */
401 if (core->board.audio_chip &&
402 core->board.audio_chip == AUDIO_CHIP_WM8775) {
403 struct v4l2_routing route;
404
405 route.input = INPUT(input).audioroute;
406 cx88_call_i2c_clients(core,
407 VIDIOC_INT_S_AUDIO_ROUTING,&route);
408 }
409 397
398 if (INPUT(input).audioroute) {
399
400 /* cx2388's C-ADC is connected to the tuner only.
401 When used with S-Video, that ADC is busy dealing with
402 chroma, so an external must be used for baseband audio */
403
404 if (INPUT(input).type != CX88_VMUX_TELEVISION &&
405 INPUT(input).type != CX88_RADIO) {
406 /* "ADC mode" */
407 cx_write(AUD_I2SCNTL, 0x1);
410 cx_set(AUD_CTL, EN_I2SIN_ENABLE); 408 cx_set(AUD_CTL, EN_I2SIN_ENABLE);
411 } else 409 } else {
410 /* Normal mode */
411 cx_write(AUD_I2SCNTL, 0x0);
412 cx_clear(AUD_CTL, EN_I2SIN_ENABLE); 412 cx_clear(AUD_CTL, EN_I2SIN_ENABLE);
413 }
414
415 /* The wm8775 module has the "2" route hardwired into
416 the initialization. Some boards may use different
417 routes for different inputs. HVR-1300 surely does */
418 if (core->board.audio_chip &&
419 core->board.audio_chip == AUDIO_CHIP_WM8775) {
420 struct v4l2_routing route;
421
422 route.input = INPUT(input).audioroute;
423 cx88_call_i2c_clients(core,
424 VIDIOC_INT_S_AUDIO_ROUTING,&route);
425
426 }
427
413 } 428 }
429
414 return 0; 430 return 0;
415} 431}
416EXPORT_SYMBOL(cx88_video_mux); 432EXPORT_SYMBOL(cx88_video_mux);