diff options
-rw-r--r-- | drivers/media/video/em28xx/em28xx-core.c | 9 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index eb5fb05fab22..69ce78867a49 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c | |||
@@ -454,6 +454,15 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
454 | em28xx_warn("couldn't setup AC97 register %d\n", | 454 | em28xx_warn("couldn't setup AC97 register %d\n", |
455 | outputs[i].reg); | 455 | outputs[i].reg); |
456 | } | 456 | } |
457 | |||
458 | if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) { | ||
459 | int sel = ac97_return_record_select(dev->ctl_aoutput); | ||
460 | |||
461 | /* Use the same input for both left and right channels */ | ||
462 | sel |= (sel << 8); | ||
463 | |||
464 | em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel); | ||
465 | } | ||
457 | } | 466 | } |
458 | 467 | ||
459 | return ret; | 468 | return ret; |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 6c6b94aa05b2..23d1482df2d1 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -300,13 +300,32 @@ enum em28xx_amux { | |||
300 | }; | 300 | }; |
301 | 301 | ||
302 | enum em28xx_aout { | 302 | enum em28xx_aout { |
303 | /* AC97 outputs */ | ||
303 | EM28XX_AOUT_MASTER = 1 << 0, | 304 | EM28XX_AOUT_MASTER = 1 << 0, |
304 | EM28XX_AOUT_LINE = 1 << 1, | 305 | EM28XX_AOUT_LINE = 1 << 1, |
305 | EM28XX_AOUT_MONO = 1 << 2, | 306 | EM28XX_AOUT_MONO = 1 << 2, |
306 | EM28XX_AOUT_LFE = 1 << 3, | 307 | EM28XX_AOUT_LFE = 1 << 3, |
307 | EM28XX_AOUT_SURR = 1 << 4, | 308 | EM28XX_AOUT_SURR = 1 << 4, |
309 | |||
310 | /* PCM IN Mixer - used by AC97_RECORD_SELECT register */ | ||
311 | EM28XX_AOUT_PCM_IN = 1 << 7, | ||
312 | |||
313 | /* Bits 10-8 are used to indicate the PCM IN record select */ | ||
314 | EM28XX_AOUT_PCM_MIC_PCM = 0 << 8, | ||
315 | EM28XX_AOUT_PCM_CD = 1 << 8, | ||
316 | EM28XX_AOUT_PCM_VIDEO = 2 << 8, | ||
317 | EM28XX_AOUT_PCM_AUX = 3 << 8, | ||
318 | EM28XX_AOUT_PCM_LINE = 4 << 8, | ||
319 | EM28XX_AOUT_PCM_STEREO = 5 << 8, | ||
320 | EM28XX_AOUT_PCM_MONO = 6 << 8, | ||
321 | EM28XX_AOUT_PCM_PHONE = 7 << 8, | ||
308 | }; | 322 | }; |
309 | 323 | ||
324 | static int ac97_return_record_select(int a_out) | ||
325 | { | ||
326 | return (a_out & 0x700) >> 8; | ||
327 | } | ||
328 | |||
310 | struct em28xx_reg_seq { | 329 | struct em28xx_reg_seq { |
311 | int reg; | 330 | int reg; |
312 | unsigned char val, mask; | 331 | unsigned char val, mask; |