diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 07:54:58 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:31 -0500 |
commit | 74f38a82376fb1b289d0957429ba45349f0cad62 (patch) | |
tree | 4d887f3bd985b0426e18ec8bec11cdb17080d181 /drivers/media/video/em28xx/em28xx-cards.c | |
parent | 539c96d0fd86bfdcfac75c88b74aa5798439293d (diff) |
V4L/DVB (6948): HVR950 requires additional settings for audio to properly work
Thanks to Markus Rechberger <mrechberger@gmail.com> for retriving those
commands.
Also, MTS firmware is required for audio to work on HVR950.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index e00de3286055..78be0dc25720 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -179,6 +179,7 @@ struct em28xx_board em28xx_boards[] = { | |||
179 | .tda9887_conf = TDA9887_PRESENT, | 179 | .tda9887_conf = TDA9887_PRESENT, |
180 | .tuner_type = TUNER_XC2028, | 180 | .tuner_type = TUNER_XC2028, |
181 | .has_tuner = 1, | 181 | .has_tuner = 1, |
182 | .mts_firmware = 1, | ||
182 | .decoder = EM28XX_TVP5150, | 183 | .decoder = EM28XX_TVP5150, |
183 | .input = { { | 184 | .input = { { |
184 | .type = EM28XX_VMUX_TELEVISION, | 185 | .type = EM28XX_VMUX_TELEVISION, |
@@ -193,6 +194,9 @@ struct em28xx_board em28xx_boards[] = { | |||
193 | .vmux = TVP5150_SVIDEO, | 194 | .vmux = TVP5150_SVIDEO, |
194 | .amux = 1, | 195 | .amux = 1, |
195 | } }, | 196 | } }, |
197 | |||
198 | /* gpio's 4, 1, 0 */ | ||
199 | .analog_gpio = 0x003d2d, | ||
196 | }, | 200 | }, |
197 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { | 201 | [EM2880_BOARD_TERRATEC_HYBRID_XS] = { |
198 | .name = "Terratec Hybrid XS", | 202 | .name = "Terratec Hybrid XS", |
@@ -453,8 +457,18 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
453 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: | 457 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: |
454 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: | 458 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: |
455 | case EM2880_BOARD_TERRATEC_HYBRID_XS: | 459 | case EM2880_BOARD_TERRATEC_HYBRID_XS: |
456 | /* reset through GPIO? */ | 460 | em28xx_write_regs(dev, XCLK_REG, "\x27", 1); |
457 | em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); | 461 | em28xx_write_regs(dev, I2C_CLK_REG, "\x40", 1); |
462 | em28xx_write_regs(dev, 0x08, "\xff", 1); | ||
463 | em28xx_write_regs(dev, 0x04, "\x00", 1); | ||
464 | msleep(100); | ||
465 | em28xx_write_regs(dev, 0x04, "\x08", 1); | ||
466 | msleep(100); | ||
467 | em28xx_write_regs(dev, 0x08, "\xff", 1); | ||
468 | msleep(50); | ||
469 | em28xx_write_regs(dev, 0x08, "\x2d", 1); | ||
470 | msleep(50); | ||
471 | em28xx_write_regs(dev, 0x08, "\x3d", 1); | ||
458 | break; | 472 | break; |
459 | } | 473 | } |
460 | } | 474 | } |
@@ -469,13 +483,31 @@ static int em28xx_tuner_callback(void *ptr, int command, int arg) | |||
469 | 483 | ||
470 | switch (command) { | 484 | switch (command) { |
471 | case XC2028_TUNER_RESET: | 485 | case XC2028_TUNER_RESET: |
472 | /* FIXME: This is device-dependent */ | 486 | { |
487 | char gpio0, gpio1, gpio4; | ||
488 | |||
489 | /* GPIO and initialization codes for analog TV */ | ||
490 | gpio0 = dev->analog_gpio & 0xff; | ||
491 | gpio1 = (dev->analog_gpio >> 8) & 0xff; | ||
492 | gpio4 = dev->analog_gpio >> 24; | ||
493 | |||
473 | dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); | 494 | dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); |
474 | dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); | 495 | dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); |
475 | 496 | ||
476 | msleep(140); | 497 | if (gpio4) { |
498 | dev->em28xx_write_regs(dev, 0x04, &gpio4, 1); | ||
499 | msleep(140); | ||
500 | } | ||
501 | |||
502 | msleep(6); | ||
503 | dev->em28xx_write_regs(dev, 0x08, &gpio0, 1); | ||
504 | msleep(10); | ||
505 | dev->em28xx_write_regs(dev, 0x08, &gpio1, 1); | ||
506 | msleep(5); | ||
507 | |||
477 | break; | 508 | break; |
478 | } | 509 | } |
510 | } | ||
479 | return rc; | 511 | return rc; |
480 | } | 512 | } |
481 | 513 | ||
@@ -608,6 +640,7 @@ static void em28xx_set_model(struct em28xx *dev) | |||
608 | dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; | 640 | dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; |
609 | dev->decoder = em28xx_boards[dev->model].decoder; | 641 | dev->decoder = em28xx_boards[dev->model].decoder; |
610 | dev->video_inputs = em28xx_boards[dev->model].vchannels; | 642 | dev->video_inputs = em28xx_boards[dev->model].vchannels; |
643 | dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; | ||
611 | 644 | ||
612 | if (!em28xx_boards[dev->model].has_tuner) | 645 | if (!em28xx_boards[dev->model].has_tuner) |
613 | dev->tuner_type = UNSET; | 646 | dev->tuner_type = UNSET; |
@@ -643,7 +676,9 @@ void em28xx_card_setup(struct em28xx *dev) | |||
643 | if (tv.has_ir) | 676 | if (tv.has_ir) |
644 | request_module("ir-kbd-i2c"); | 677 | request_module("ir-kbd-i2c"); |
645 | #endif | 678 | #endif |
646 | /* FIXME: Should also retrieve decoder processor type */ | 679 | /* enable audio 12 mhz i2s */ |
680 | em28xx_write_regs(dev, XCLK_REG, "\xa7", 1); | ||
681 | msleep(10); | ||
647 | 682 | ||
648 | break; | 683 | break; |
649 | } | 684 | } |