diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 18:01:41 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 18:01:41 -0200 |
commit | 24a9538c24f678ac7dd1e53348bd49fdf4b71414 (patch) | |
tree | 33de30fd3b373f0037068d07792f94366de1a4b6 | |
parent | c8abe9596bde0bfdd4537b9635bebeb8b5acf88c (diff) | |
download | mediapointer-dvb-s2-24a9538c24f678ac7dd1e53348bd49fdf4b71414.tar.gz mediapointer-dvb-s2-24a9538c24f678ac7dd1e53348bd49fdf4b71414.tar.bz2 |
Properly implement 12MHz I2S support
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-cards.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-core.c | 11 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 7 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx.h | 3 |
4 files changed, 24 insertions, 17 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c index 34f5fab0b..25344980a 100644 --- a/linux/drivers/media/video/em28xx/em28xx-cards.c +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c @@ -175,13 +175,14 @@ struct em28xx_board em28xx_boards[] = { } }, }, [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = { - .name = "Hauppauge WinTV HVR 950", - .vchannels = 3, - .tda9887_conf = TDA9887_PRESENT, - .tuner_type = TUNER_XC2028, - .has_tuner = 1, - .mts_firmware = 1, - .decoder = EM28XX_TVP5150, + .name = "Hauppauge WinTV HVR 950", + .vchannels = 3, + .tda9887_conf = TDA9887_PRESENT, + .tuner_type = TUNER_XC2028, + .has_tuner = 1, + .mts_firmware = 1, + .has_12mhz_i2s = 1, + .decoder = EM28XX_TVP5150, .input = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0, @@ -642,6 +643,7 @@ static void em28xx_set_model(struct em28xx *dev) dev->decoder = em28xx_boards[dev->model].decoder; dev->video_inputs = em28xx_boards[dev->model].vchannels; dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; + dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; if (!em28xx_boards[dev->model].has_tuner) dev->tuner_type = UNSET; @@ -677,10 +679,6 @@ void em28xx_card_setup(struct em28xx *dev) if (tv.has_ir) request_module("ir-kbd-i2c"); #endif - /* enable audio 12 mhz i2s */ - em28xx_write_regs(dev, XCLK_REG, "\xa7", 1); - msleep(10); - break; } case EM2820_BOARD_KWORLD_PVRTV2800RF: diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index 98153d70d..cb87e7e41 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -383,6 +383,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) { int ret; char s[2] = { 0x00, 0x00 }; + u8 xclk = 0x07; s[0] |= 0x1f - dev->volume; s[1] |= 0x1f - dev->volume; @@ -393,10 +394,16 @@ int em28xx_audio_analog_set(struct em28xx *dev) if (ret < 0) return ret; - ret = em28xx_write_reg_bits(dev, XCLK_REG, - dev->mute ? 0x00 : 0x80, 0x80); + if (dev->has_12mhz_i2s) + xclk |= 0x20; + + if (!dev->mute) + xclk |= 0x80; + + ret = em28xx_write_reg_bits(dev, XCLK_REG, xclk, 0xa7); if (ret < 0) return ret; + msleep(10); /* Selects the proper audio input */ ret = em28xx_set_audio_source(dev); diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 1a269b643..b7c8a1fa0 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -145,10 +145,6 @@ static int em28xx_config(struct em28xx *dev) dev->mute = 1; /* maybe not the right place... */ dev->volume = 0x1f; - /* Init XCLK_REG, audio muted */ - dev->em28xx_write_regs(dev, XCLK_REG, "\x87", 1); - - em28xx_audio_analog_set(dev); em28xx_outfmt_set_yuv422(dev); em28xx_colorlevels_set_default(dev); em28xx_compression_disable(dev); @@ -1760,6 +1756,9 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, /* Do board specific init and eeprom reading */ em28xx_card_setup(dev); + /* Configure audio */ + em28xx_audio_analog_set(dev); + /* configure the device */ em28xx_config_i2c(dev); diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h index 64a63b2c8..ff216a813 100644 --- a/linux/drivers/media/video/em28xx/em28xx.h +++ b/linux/drivers/media/video/em28xx/em28xx.h @@ -187,6 +187,8 @@ struct em28xx_board { unsigned int has_tuner:1; unsigned int has_msp34xx:1; unsigned int mts_firmware:1; + unsigned int has_12mhz_i2s:1; + unsigned int analog_gpio; enum em28xx_decoder decoder; @@ -258,6 +260,7 @@ struct em28xx { unsigned int has_tda9887:1; unsigned int stream_on:1; /* Locks streams */ unsigned int has_audio_class:1; + unsigned int has_12mhz_i2s:1; int video_inputs; /* number of video inputs */ struct list_head devlist; |