diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-05 15:01:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:33 -0500 |
commit | 3abee53e4402b6ae39e1e610f9ef94eb74097138 (patch) | |
tree | bb96b460ebf6be07a127216dda86a1f896274afd /drivers/media | |
parent | 0f6dac18ccc6fb0c95f3e0269e60239661c9b4c5 (diff) |
V4L/DVB (6955): Properly implement 12MHz I2S support
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 20 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-core.c | 11 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 7 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 3 |
4 files changed, 24 insertions, 17 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 78be0dc25720..1011813ad7c2 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -174,13 +174,14 @@ struct em28xx_board em28xx_boards[] = { | |||
174 | } }, | 174 | } }, |
175 | }, | 175 | }, |
176 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = { | 176 | [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = { |
177 | .name = "Hauppauge WinTV HVR 950", | 177 | .name = "Hauppauge WinTV HVR 950", |
178 | .vchannels = 3, | 178 | .vchannels = 3, |
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 | .mts_firmware = 1, |
183 | .decoder = EM28XX_TVP5150, | 183 | .has_12mhz_i2s = 1, |
184 | .decoder = EM28XX_TVP5150, | ||
184 | .input = { { | 185 | .input = { { |
185 | .type = EM28XX_VMUX_TELEVISION, | 186 | .type = EM28XX_VMUX_TELEVISION, |
186 | .vmux = TVP5150_COMPOSITE0, | 187 | .vmux = TVP5150_COMPOSITE0, |
@@ -641,6 +642,7 @@ static void em28xx_set_model(struct em28xx *dev) | |||
641 | dev->decoder = em28xx_boards[dev->model].decoder; | 642 | dev->decoder = em28xx_boards[dev->model].decoder; |
642 | dev->video_inputs = em28xx_boards[dev->model].vchannels; | 643 | dev->video_inputs = em28xx_boards[dev->model].vchannels; |
643 | dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; | 644 | dev->analog_gpio = em28xx_boards[dev->model].analog_gpio; |
645 | dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s; | ||
644 | 646 | ||
645 | if (!em28xx_boards[dev->model].has_tuner) | 647 | if (!em28xx_boards[dev->model].has_tuner) |
646 | dev->tuner_type = UNSET; | 648 | dev->tuner_type = UNSET; |
@@ -676,10 +678,6 @@ void em28xx_card_setup(struct em28xx *dev) | |||
676 | if (tv.has_ir) | 678 | if (tv.has_ir) |
677 | request_module("ir-kbd-i2c"); | 679 | request_module("ir-kbd-i2c"); |
678 | #endif | 680 | #endif |
679 | /* enable audio 12 mhz i2s */ | ||
680 | em28xx_write_regs(dev, XCLK_REG, "\xa7", 1); | ||
681 | msleep(10); | ||
682 | |||
683 | break; | 681 | break; |
684 | } | 682 | } |
685 | case EM2820_BOARD_KWORLD_PVRTV2800RF: | 683 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 70c5ec268f6a..f6b78357f0e5 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c | |||
@@ -332,6 +332,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
332 | { | 332 | { |
333 | int ret; | 333 | int ret; |
334 | char s[2] = { 0x00, 0x00 }; | 334 | char s[2] = { 0x00, 0x00 }; |
335 | u8 xclk = 0x07; | ||
335 | 336 | ||
336 | s[0] |= 0x1f - dev->volume; | 337 | s[0] |= 0x1f - dev->volume; |
337 | s[1] |= 0x1f - dev->volume; | 338 | s[1] |= 0x1f - dev->volume; |
@@ -342,10 +343,16 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
342 | if (ret < 0) | 343 | if (ret < 0) |
343 | return ret; | 344 | return ret; |
344 | 345 | ||
345 | ret = em28xx_write_reg_bits(dev, XCLK_REG, | 346 | if (dev->has_12mhz_i2s) |
346 | dev->mute ? 0x00 : 0x80, 0x80); | 347 | xclk |= 0x20; |
348 | |||
349 | if (!dev->mute) | ||
350 | xclk |= 0x80; | ||
351 | |||
352 | ret = em28xx_write_reg_bits(dev, XCLK_REG, xclk, 0xa7); | ||
347 | if (ret < 0) | 353 | if (ret < 0) |
348 | return ret; | 354 | return ret; |
355 | msleep(10); | ||
349 | 356 | ||
350 | /* Selects the proper audio input */ | 357 | /* Selects the proper audio input */ |
351 | ret = em28xx_set_audio_source(dev); | 358 | ret = em28xx_set_audio_source(dev); |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index a03e9d724b5f..0f075f532eae 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -125,10 +125,6 @@ static int em28xx_config(struct em28xx *dev) | |||
125 | dev->mute = 1; /* maybe not the right place... */ | 125 | dev->mute = 1; /* maybe not the right place... */ |
126 | dev->volume = 0x1f; | 126 | dev->volume = 0x1f; |
127 | 127 | ||
128 | /* Init XCLK_REG, audio muted */ | ||
129 | dev->em28xx_write_regs(dev, XCLK_REG, "\x87", 1); | ||
130 | |||
131 | em28xx_audio_analog_set(dev); | ||
132 | em28xx_outfmt_set_yuv422(dev); | 128 | em28xx_outfmt_set_yuv422(dev); |
133 | em28xx_colorlevels_set_default(dev); | 129 | em28xx_colorlevels_set_default(dev); |
134 | em28xx_compression_disable(dev); | 130 | em28xx_compression_disable(dev); |
@@ -1688,6 +1684,9 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1688 | /* Do board specific init and eeprom reading */ | 1684 | /* Do board specific init and eeprom reading */ |
1689 | em28xx_card_setup(dev); | 1685 | em28xx_card_setup(dev); |
1690 | 1686 | ||
1687 | /* Configure audio */ | ||
1688 | em28xx_audio_analog_set(dev); | ||
1689 | |||
1691 | /* configure the device */ | 1690 | /* configure the device */ |
1692 | em28xx_config_i2c(dev); | 1691 | em28xx_config_i2c(dev); |
1693 | 1692 | ||
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 9eb213132da1..2d57330c4537 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -184,6 +184,8 @@ struct em28xx_board { | |||
184 | unsigned int has_tuner:1; | 184 | unsigned int has_tuner:1; |
185 | unsigned int has_msp34xx:1; | 185 | unsigned int has_msp34xx:1; |
186 | unsigned int mts_firmware:1; | 186 | unsigned int mts_firmware:1; |
187 | unsigned int has_12mhz_i2s:1; | ||
188 | |||
187 | unsigned int analog_gpio; | 189 | unsigned int analog_gpio; |
188 | 190 | ||
189 | enum em28xx_decoder decoder; | 191 | enum em28xx_decoder decoder; |
@@ -247,6 +249,7 @@ struct em28xx { | |||
247 | unsigned int has_tda9887:1; | 249 | unsigned int has_tda9887:1; |
248 | unsigned int stream_on:1; /* Locks streams */ | 250 | unsigned int stream_on:1; /* Locks streams */ |
249 | unsigned int has_audio_class:1; | 251 | unsigned int has_audio_class:1; |
252 | unsigned int has_12mhz_i2s:1; | ||
250 | 253 | ||
251 | int video_inputs; /* number of video inputs */ | 254 | int video_inputs; /* number of video inputs */ |
252 | struct list_head devlist; | 255 | struct list_head devlist; |