aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/easycap/easycap_sound.c
diff options
context:
space:
mode:
authorMike Thomas <rmthomas@sciolus.org>2010-11-07 15:00:35 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-09 19:31:14 -0500
commitf36bc37a48148f31f936557b811431b98dbfe347 (patch)
tree7d665b41029a881e0129cd13de0c41b404729b5b /drivers/staging/easycap/easycap_sound.c
parente68703cfe8dd2f5605c53b46fae6c9c027e7ef50 (diff)
staging/easycap: Improve hardware initialization
Sometimes at startup the video urbs consistently and persistently deliver bad data, each video frame (not isoc frame) containing an excess of precisely two bytes. A brute-force cure implemented here is to repeatedly reinitialize the registers of the SAA7113H chip and the STK1160 USB bridge until good behaviour is obtained. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap/easycap_sound.c')
-rw-r--r--drivers/staging/easycap/easycap_sound.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c
index 21275973faf..0b4b60b0a5a 100644
--- a/drivers/staging/easycap/easycap_sound.c
+++ b/drivers/staging/easycap/easycap_sound.c
@@ -638,11 +638,6 @@ if ((struct usb_device *)NULL == peasycap->pusb_device) {
638 SAM("ERROR: peasycap->pusb_device has become NULL\n"); 638 SAM("ERROR: peasycap->pusb_device has become NULL\n");
639 return -EFAULT; 639 return -EFAULT;
640} 640}
641rc = adjust_volume(peasycap, -8192);
642if (0 != rc) {
643 SAM("ERROR: adjust_volume(default) returned %i\n", rc);
644 return -EFAULT;
645}
646/*---------------------------------------------------------------------------*/ 641/*---------------------------------------------------------------------------*/
647if ((struct usb_device *)NULL == peasycap->pusb_device) { 642if ((struct usb_device *)NULL == peasycap->pusb_device) {
648 SAM("ERROR: peasycap->pusb_device has become NULL\n"); 643 SAM("ERROR: peasycap->pusb_device has become NULL\n");
@@ -653,26 +648,20 @@ rc = usb_set_interface(peasycap->pusb_device, peasycap->audio_interface, \
653JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, \ 648JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, \
654 peasycap->audio_altsetting_on, rc); 649 peasycap->audio_altsetting_on, rc);
655 650
656if ((struct usb_device *)NULL == peasycap->pusb_device) {
657 SAM("ERROR: peasycap->pusb_device has become NULL\n");
658 return -EFAULT;
659}
660rc = wakeup_device(peasycap->pusb_device); 651rc = wakeup_device(peasycap->pusb_device);
661if (0 == rc) 652if (0 == rc)
662 JOM(8, "wakeup_device() returned %i\n", rc); 653 JOM(8, "wakeup_device() returned %i\n", rc);
663else 654else
664 JOM(8, "easysnd open(): ERROR: wakeup_device() returned %i\n", rc); 655 JOM(8, "ERROR: wakeup_device() returned %i\n", rc);
665 656
666if ((struct usb_device *)NULL == peasycap->pusb_device) { 657peasycap->audio_eof = 0;
667 SAM("ERROR: peasycap->pusb_device has become NULL\n");
668 return -EFAULT;
669}
670submit_audio_urbs(peasycap);
671peasycap->audio_idle = 0; 658peasycap->audio_idle = 0;
672 659
673peasycap->timeval1.tv_sec = 0; 660peasycap->timeval1.tv_sec = 0;
674peasycap->timeval1.tv_usec = 0; 661peasycap->timeval1.tv_usec = 0;
675 662
663submit_audio_urbs(peasycap);
664
676JOM(4, "finished initialization\n"); 665JOM(4, "finished initialization\n");
677return 0; 666return 0;
678} 667}
@@ -764,7 +753,6 @@ while ((fragment == (peasycap->audio_fill / \
764 JOM(8, "returning 0 because %i=audio_eof\n", \ 753 JOM(8, "returning 0 because %i=audio_eof\n", \
765 peasycap->audio_eof); 754 peasycap->audio_eof);
766 kill_audio_urbs(peasycap); 755 kill_audio_urbs(peasycap);
767 msleep(500);
768 return 0; 756 return 0;
769 } 757 }
770 if (peasycap->audio_idle) { 758 if (peasycap->audio_idle) {