diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 10:54:58 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 10:54:58 -0200 |
commit | 8071d802deb562fb1801a2f0809b11b9a7d6c3a0 (patch) | |
tree | 93af66625c5cd40990554aca2cc40cd77441b1ef /linux/drivers | |
parent | 8b702294eb6b500645e914552b2f5077d3251ae7 (diff) | |
download | mediapointer-dvb-s2-8071d802deb562fb1801a2f0809b11b9a7d6c3a0.tar.gz mediapointer-dvb-s2-8071d802deb562fb1801a2f0809b11b9a7d6c3a0.tar.bz2 |
HVR950 requires additional settings for audio to properly work
From: Mauro Carvalho Chehab <mchehab@infradead.org>
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 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-cards.c | 45 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx.h | 13 |
2 files changed, 48 insertions, 10 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c index 809cc0a4a..34f5fab0b 100644 --- a/linux/drivers/media/video/em28xx/em28xx-cards.c +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c @@ -180,6 +180,7 @@ struct em28xx_board em28xx_boards[] = { .tda9887_conf = TDA9887_PRESENT, .tuner_type = TUNER_XC2028, .has_tuner = 1, + .mts_firmware = 1, .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, @@ -194,6 +195,9 @@ struct em28xx_board em28xx_boards[] = { .vmux = TVP5150_SVIDEO, .amux = 1, } }, + + /* gpio's 4, 1, 0 */ + .analog_gpio = 0x003d2d, }, [EM2880_BOARD_TERRATEC_HYBRID_XS] = { .name = "Terratec Hybrid XS", @@ -454,8 +458,18 @@ void em28xx_pre_card_setup(struct em28xx *dev) case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2880_BOARD_TERRATEC_HYBRID_XS: - /* reset through GPIO? */ - em28xx_write_regs_req(dev, 0x00, 0x08, "\x7d", 1); + em28xx_write_regs(dev, XCLK_REG, "\x27", 1); + em28xx_write_regs(dev, I2C_CLK_REG, "\x40", 1); + em28xx_write_regs(dev, 0x08, "\xff", 1); + em28xx_write_regs(dev, 0x04, "\x00", 1); + msleep(100); + em28xx_write_regs(dev, 0x04, "\x08", 1); + msleep(100); + em28xx_write_regs(dev, 0x08, "\xff", 1); + msleep(50); + em28xx_write_regs(dev, 0x08, "\x2d", 1); + msleep(50); + em28xx_write_regs(dev, 0x08, "\x3d", 1); break; } } @@ -470,13 +484,31 @@ static int em28xx_tuner_callback(void *ptr, int command, int arg) switch (command) { case XC2028_TUNER_RESET: - /* FIXME: This is device-dependent */ + { + char gpio0, gpio1, gpio4; + + /* GPIO and initialization codes for analog TV */ + gpio0 = dev->analog_gpio & 0xff; + gpio1 = (dev->analog_gpio >> 8) & 0xff; + gpio4 = dev->analog_gpio >> 24; + dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); - msleep(140); + if (gpio4) { + dev->em28xx_write_regs(dev, 0x04, &gpio4, 1); + msleep(140); + } + + msleep(6); + dev->em28xx_write_regs(dev, 0x08, &gpio0, 1); + msleep(10); + dev->em28xx_write_regs(dev, 0x08, &gpio1, 1); + msleep(5); + break; } + } return rc; } @@ -609,6 +641,7 @@ static void em28xx_set_model(struct em28xx *dev) dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf; dev->decoder = em28xx_boards[dev->model].decoder; dev->video_inputs = em28xx_boards[dev->model].vchannels; + dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; if (!em28xx_boards[dev->model].has_tuner) dev->tuner_type = UNSET; @@ -644,7 +677,9 @@ void em28xx_card_setup(struct em28xx *dev) if (tv.has_ir) request_module("ir-kbd-i2c"); #endif - /* FIXME: Should also retrieve decoder processor type */ + /* enable audio 12 mhz i2s */ + em28xx_write_regs(dev, XCLK_REG, "\xa7", 1); + msleep(10); break; } diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h index 0196371d6..4d318b3d5 100644 --- a/linux/drivers/media/video/em28xx/em28xx.h +++ b/linux/drivers/media/video/em28xx/em28xx.h @@ -181,12 +181,13 @@ struct em28xx_board { int tuner_type; /* i2c flags */ - unsigned int is_em2800; unsigned int tda9887_conf; + unsigned int is_em2800:1; unsigned int has_tuner:1; unsigned int has_msp34xx:1; unsigned int mts_firmware:1; + unsigned int analog_gpio; enum em28xx_decoder decoder; @@ -220,15 +221,16 @@ struct em28xx { char name[30]; /* name (including minor) of the device */ int model; /* index in the device_data struct */ int devno; /* marks the number of this device */ - unsigned int is_em2800; - int video_inputs; /* number of video inputs */ - struct list_head devlist; + unsigned int analog_gpio; + unsigned int is_em2800:1; unsigned int has_tuner:1; unsigned int has_msp34xx:1; unsigned int has_tda9887:1; - unsigned int stream_on:1; /* Locks streams */ + int video_inputs; /* number of video inputs */ + struct list_head devlist; + u32 i2s_speed; /* I2S speed for audio digital stream */ enum em28xx_decoder decoder; @@ -358,6 +360,7 @@ extern const unsigned int em28xx_bcount; #define EM2800_AUDIOSRC_REG 0x08 /* em28xx registers */ +#define I2C_CLK_REG 0x06 #define CHIPID_REG 0x0a #define USBSUSP_REG 0x0c /* */ |