diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-05-05 10:54:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-05 10:54:33 -0400 |
commit | 59991da498122f779434c4e0beac8a69e0322938 (patch) | |
tree | 23e46bc7f355c6d65f3246f756cd8ef84cfc3030 /sound/usb | |
parent | 02fd1a76bfeb8d6293608dc3a1b8667b1da5a923 (diff) | |
parent | f06ab794af7055d0949b09885f79f8b493deec64 (diff) |
Merge branch 'for-linus' into for-next
... for applying the further HDMI fixes.
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/card.c | 12 | ||||
-rw-r--r-- | sound/usb/card.h | 1 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 15 | ||||
-rw-r--r-- | sound/usb/pcm.c | 5 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 1 |
5 files changed, 26 insertions, 8 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 893d5a1afc3c..c3b5b7dca1c3 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -651,7 +651,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) | |||
651 | int err = -ENODEV; | 651 | int err = -ENODEV; |
652 | 652 | ||
653 | down_read(&chip->shutdown_rwsem); | 653 | down_read(&chip->shutdown_rwsem); |
654 | if (chip->probing) | 654 | if (chip->probing && chip->in_pm) |
655 | err = 0; | 655 | err = 0; |
656 | else if (!chip->shutdown) | 656 | else if (!chip->shutdown) |
657 | err = usb_autopm_get_interface(chip->pm_intf); | 657 | err = usb_autopm_get_interface(chip->pm_intf); |
@@ -663,7 +663,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) | |||
663 | void snd_usb_autosuspend(struct snd_usb_audio *chip) | 663 | void snd_usb_autosuspend(struct snd_usb_audio *chip) |
664 | { | 664 | { |
665 | down_read(&chip->shutdown_rwsem); | 665 | down_read(&chip->shutdown_rwsem); |
666 | if (!chip->shutdown && !chip->probing) | 666 | if (!chip->shutdown && !chip->probing && !chip->in_pm) |
667 | usb_autopm_put_interface(chip->pm_intf); | 667 | usb_autopm_put_interface(chip->pm_intf); |
668 | up_read(&chip->shutdown_rwsem); | 668 | up_read(&chip->shutdown_rwsem); |
669 | } | 669 | } |
@@ -695,8 +695,9 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | |||
695 | chip->autosuspended = 1; | 695 | chip->autosuspended = 1; |
696 | } | 696 | } |
697 | 697 | ||
698 | list_for_each_entry(mixer, &chip->mixer_list, list) | 698 | if (chip->num_suspended_intf == 1) |
699 | snd_usb_mixer_suspend(mixer); | 699 | list_for_each_entry(mixer, &chip->mixer_list, list) |
700 | snd_usb_mixer_suspend(mixer); | ||
700 | 701 | ||
701 | return 0; | 702 | return 0; |
702 | } | 703 | } |
@@ -711,6 +712,8 @@ static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) | |||
711 | return 0; | 712 | return 0; |
712 | if (--chip->num_suspended_intf) | 713 | if (--chip->num_suspended_intf) |
713 | return 0; | 714 | return 0; |
715 | |||
716 | chip->in_pm = 1; | ||
714 | /* | 717 | /* |
715 | * ALSA leaves material resumption to user space | 718 | * ALSA leaves material resumption to user space |
716 | * we just notify and restart the mixers | 719 | * we just notify and restart the mixers |
@@ -726,6 +729,7 @@ static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) | |||
726 | chip->autosuspended = 0; | 729 | chip->autosuspended = 0; |
727 | 730 | ||
728 | err_out: | 731 | err_out: |
732 | chip->in_pm = 0; | ||
729 | return err; | 733 | return err; |
730 | } | 734 | } |
731 | 735 | ||
diff --git a/sound/usb/card.h b/sound/usb/card.h index 9867ab866857..97acb906acc2 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h | |||
@@ -92,6 +92,7 @@ struct snd_usb_endpoint { | |||
92 | unsigned int curframesize; /* current packet size in frames (for capture) */ | 92 | unsigned int curframesize; /* current packet size in frames (for capture) */ |
93 | unsigned int syncmaxsize; /* sync endpoint packet size */ | 93 | unsigned int syncmaxsize; /* sync endpoint packet size */ |
94 | unsigned int fill_max:1; /* fill max packet size always */ | 94 | unsigned int fill_max:1; /* fill max packet size always */ |
95 | unsigned int udh01_fb_quirk:1; /* corrupted feedback data */ | ||
95 | unsigned int datainterval; /* log_2 of data packet interval */ | 96 | unsigned int datainterval; /* log_2 of data packet interval */ |
96 | unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */ | 97 | unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */ |
97 | unsigned char silence_value; | 98 | unsigned char silence_value; |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index e70a87e0d9fe..289f582c9130 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -471,6 +471,10 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip, | |||
471 | ep->syncinterval = 3; | 471 | ep->syncinterval = 3; |
472 | 472 | ||
473 | ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize); | 473 | ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize); |
474 | |||
475 | if (chip->usb_id == USB_ID(0x0644, 0x8038) /* TEAC UD-H01 */ && | ||
476 | ep->syncmaxsize == 4) | ||
477 | ep->udh01_fb_quirk = 1; | ||
474 | } | 478 | } |
475 | 479 | ||
476 | list_add_tail(&ep->list, &chip->ep_list); | 480 | list_add_tail(&ep->list, &chip->ep_list); |
@@ -1105,7 +1109,16 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep, | |||
1105 | if (f == 0) | 1109 | if (f == 0) |
1106 | return; | 1110 | return; |
1107 | 1111 | ||
1108 | if (unlikely(ep->freqshift == INT_MIN)) { | 1112 | if (unlikely(sender->udh01_fb_quirk)) { |
1113 | /* | ||
1114 | * The TEAC UD-H01 firmware sometimes changes the feedback value | ||
1115 | * by +/- 0x1.0000. | ||
1116 | */ | ||
1117 | if (f < ep->freqn - 0x8000) | ||
1118 | f += 0x10000; | ||
1119 | else if (f > ep->freqn + 0x8000) | ||
1120 | f -= 0x10000; | ||
1121 | } else if (unlikely(ep->freqshift == INT_MIN)) { | ||
1109 | /* | 1122 | /* |
1110 | * The first time we see a feedback value, determine its format | 1123 | * The first time we see a feedback value, determine its format |
1111 | * by shifting it left or right until it matches the nominal | 1124 | * by shifting it left or right until it matches the nominal |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 131336d40492..c62a1659106d 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -1501,9 +1501,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs, | |||
1501 | * The error should be lower than 2ms since the estimate relies | 1501 | * The error should be lower than 2ms since the estimate relies |
1502 | * on two reads of a counter updated every ms. | 1502 | * on two reads of a counter updated every ms. |
1503 | */ | 1503 | */ |
1504 | if (printk_ratelimit() && | 1504 | if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) |
1505 | abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) | 1505 | dev_dbg_ratelimited(&subs->dev->dev, |
1506 | dev_dbg(&subs->dev->dev, | ||
1507 | "delay: estimated %d, actual %d\n", | 1506 | "delay: estimated %d, actual %d\n", |
1508 | est_delay, subs->last_delay); | 1507 | est_delay, subs->last_delay); |
1509 | 1508 | ||
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 25c4c7e217de..91d0380431b4 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -40,6 +40,7 @@ struct snd_usb_audio { | |||
40 | struct rw_semaphore shutdown_rwsem; | 40 | struct rw_semaphore shutdown_rwsem; |
41 | unsigned int shutdown:1; | 41 | unsigned int shutdown:1; |
42 | unsigned int probing:1; | 42 | unsigned int probing:1; |
43 | unsigned int in_pm:1; | ||
43 | unsigned int autosuspended:1; | 44 | unsigned int autosuspended:1; |
44 | unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ | 45 | unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ |
45 | 46 | ||