aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index eb5fb05fab22..94fb1b639a2e 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -438,6 +438,10 @@ int em28xx_audio_analog_set(struct em28xx *dev)
438 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) { 438 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
439 int vol; 439 int vol;
440 440
441 em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200);
442 em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031);
443 em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80);
444
441 /* LSB: left channel - both channels with the same level */ 445 /* LSB: left channel - both channels with the same level */
442 vol = (0x1f - dev->volume) | ((0x1f - dev->volume) << 8); 446 vol = (0x1f - dev->volume) | ((0x1f - dev->volume) << 8);
443 447
@@ -454,6 +458,15 @@ int em28xx_audio_analog_set(struct em28xx *dev)
454 em28xx_warn("couldn't setup AC97 register %d\n", 458 em28xx_warn("couldn't setup AC97 register %d\n",
455 outputs[i].reg); 459 outputs[i].reg);
456 } 460 }
461
462 if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) {
463 int sel = ac97_return_record_select(dev->ctl_aoutput);
464
465 /* Use the same input for both left and right channels */
466 sel |= (sel << 8);
467
468 em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel);
469 }
457 } 470 }
458 471
459 return ret; 472 return ret;
@@ -847,8 +860,11 @@ void em28xx_uninit_isoc(struct em28xx *dev)
847 for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { 860 for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
848 urb = dev->isoc_ctl.urb[i]; 861 urb = dev->isoc_ctl.urb[i];
849 if (urb) { 862 if (urb) {
850 usb_kill_urb(urb); 863 if (!irqs_disabled())
851 usb_unlink_urb(urb); 864 usb_kill_urb(urb);
865 else
866 usb_unlink_urb(urb);
867
852 if (dev->isoc_ctl.transfer_buffer[i]) { 868 if (dev->isoc_ctl.transfer_buffer[i]) {
853 usb_buffer_free(dev->udev, 869 usb_buffer_free(dev->udev,
854 urb->transfer_buffer_length, 870 urb->transfer_buffer_length,