diff options
author | Mike Thomas <rmthomas@sciolus.org> | 2010-11-07 15:00:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-09 19:31:14 -0500 |
commit | f36bc37a48148f31f936557b811431b98dbfe347 (patch) | |
tree | 7d665b41029a881e0129cd13de0c41b404729b5b /drivers/staging/easycap/easycap_sound.c | |
parent | e68703cfe8dd2f5605c53b46fae6c9c027e7ef50 (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.c | 20 |
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 | } |
641 | rc = adjust_volume(peasycap, -8192); | ||
642 | if (0 != rc) { | ||
643 | SAM("ERROR: adjust_volume(default) returned %i\n", rc); | ||
644 | return -EFAULT; | ||
645 | } | ||
646 | /*---------------------------------------------------------------------------*/ | 641 | /*---------------------------------------------------------------------------*/ |
647 | if ((struct usb_device *)NULL == peasycap->pusb_device) { | 642 | if ((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, \ | |||
653 | JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface, \ | 648 | JOM(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 | ||
656 | if ((struct usb_device *)NULL == peasycap->pusb_device) { | ||
657 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); | ||
658 | return -EFAULT; | ||
659 | } | ||
660 | rc = wakeup_device(peasycap->pusb_device); | 651 | rc = wakeup_device(peasycap->pusb_device); |
661 | if (0 == rc) | 652 | if (0 == rc) |
662 | JOM(8, "wakeup_device() returned %i\n", rc); | 653 | JOM(8, "wakeup_device() returned %i\n", rc); |
663 | else | 654 | else |
664 | JOM(8, "easysnd open(): ERROR: wakeup_device() returned %i\n", rc); | 655 | JOM(8, "ERROR: wakeup_device() returned %i\n", rc); |
665 | 656 | ||
666 | if ((struct usb_device *)NULL == peasycap->pusb_device) { | 657 | peasycap->audio_eof = 0; |
667 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); | ||
668 | return -EFAULT; | ||
669 | } | ||
670 | submit_audio_urbs(peasycap); | ||
671 | peasycap->audio_idle = 0; | 658 | peasycap->audio_idle = 0; |
672 | 659 | ||
673 | peasycap->timeval1.tv_sec = 0; | 660 | peasycap->timeval1.tv_sec = 0; |
674 | peasycap->timeval1.tv_usec = 0; | 661 | peasycap->timeval1.tv_usec = 0; |
675 | 662 | ||
663 | submit_audio_urbs(peasycap); | ||
664 | |||
676 | JOM(4, "finished initialization\n"); | 665 | JOM(4, "finished initialization\n"); |
677 | return 0; | 666 | return 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) { |