diff options
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r-- | sound/usb/card.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 2da8ad75fd96..1a033177b83f 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -82,6 +82,7 @@ static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; | |||
82 | static int nrpacks = 8; /* max. number of packets per urb */ | 82 | static int nrpacks = 8; /* max. number of packets per urb */ |
83 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ | 83 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ |
84 | static bool ignore_ctl_error; | 84 | static bool ignore_ctl_error; |
85 | static bool autoclock = true; | ||
85 | 86 | ||
86 | module_param_array(index, int, NULL, 0444); | 87 | module_param_array(index, int, NULL, 0444); |
87 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); | 88 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); |
@@ -100,6 +101,8 @@ MODULE_PARM_DESC(device_setup, "Specific device setup (if needed)."); | |||
100 | module_param(ignore_ctl_error, bool, 0444); | 101 | module_param(ignore_ctl_error, bool, 0444); |
101 | MODULE_PARM_DESC(ignore_ctl_error, | 102 | MODULE_PARM_DESC(ignore_ctl_error, |
102 | "Ignore errors from USB controller for mixer interfaces."); | 103 | "Ignore errors from USB controller for mixer interfaces."); |
104 | module_param(autoclock, bool, 0444); | ||
105 | MODULE_PARM_DESC(autoclock, "Enable auto-clock selection for UAC2 devices (default: yes)."); | ||
103 | 106 | ||
104 | /* | 107 | /* |
105 | * we keep the snd_usb_audio_t instances by ourselves for merging | 108 | * we keep the snd_usb_audio_t instances by ourselves for merging |
@@ -354,6 +357,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, | |||
354 | chip->card = card; | 357 | chip->card = card; |
355 | chip->setup = device_setup[idx]; | 358 | chip->setup = device_setup[idx]; |
356 | chip->nrpacks = nrpacks; | 359 | chip->nrpacks = nrpacks; |
360 | chip->autoclock = autoclock; | ||
357 | chip->probing = 1; | 361 | chip->probing = 1; |
358 | 362 | ||
359 | chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor), | 363 | chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor), |
@@ -627,7 +631,9 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) | |||
627 | int err = -ENODEV; | 631 | int err = -ENODEV; |
628 | 632 | ||
629 | down_read(&chip->shutdown_rwsem); | 633 | down_read(&chip->shutdown_rwsem); |
630 | if (!chip->shutdown && !chip->probing) | 634 | if (chip->probing) |
635 | err = 0; | ||
636 | else if (!chip->shutdown) | ||
631 | err = usb_autopm_get_interface(chip->pm_intf); | 637 | err = usb_autopm_get_interface(chip->pm_intf); |
632 | up_read(&chip->shutdown_rwsem); | 638 | up_read(&chip->shutdown_rwsem); |
633 | 639 | ||
@@ -645,7 +651,6 @@ void snd_usb_autosuspend(struct snd_usb_audio *chip) | |||
645 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | 651 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) |
646 | { | 652 | { |
647 | struct snd_usb_audio *chip = usb_get_intfdata(intf); | 653 | struct snd_usb_audio *chip = usb_get_intfdata(intf); |
648 | struct list_head *p; | ||
649 | struct snd_usb_stream *as; | 654 | struct snd_usb_stream *as; |
650 | struct usb_mixer_interface *mixer; | 655 | struct usb_mixer_interface *mixer; |
651 | 656 | ||
@@ -655,8 +660,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | |||
655 | if (!PMSG_IS_AUTO(message)) { | 660 | if (!PMSG_IS_AUTO(message)) { |
656 | snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); | 661 | snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); |
657 | if (!chip->num_suspended_intf++) { | 662 | if (!chip->num_suspended_intf++) { |
658 | list_for_each(p, &chip->pcm_list) { | 663 | list_for_each_entry(as, &chip->pcm_list, list) { |
659 | as = list_entry(p, struct snd_usb_stream, list); | ||
660 | snd_pcm_suspend_all(as->pcm); | 664 | snd_pcm_suspend_all(as->pcm); |
661 | as->substream[0].need_setup_ep = | 665 | as->substream[0].need_setup_ep = |
662 | as->substream[1].need_setup_ep = true; | 666 | as->substream[1].need_setup_ep = true; |
@@ -716,8 +720,7 @@ static struct usb_device_id usb_audio_ids [] = { | |||
716 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL }, | 720 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL }, |
717 | { } /* Terminating entry */ | 721 | { } /* Terminating entry */ |
718 | }; | 722 | }; |
719 | 723 | MODULE_DEVICE_TABLE(usb, usb_audio_ids); | |
720 | MODULE_DEVICE_TABLE (usb, usb_audio_ids); | ||
721 | 724 | ||
722 | /* | 725 | /* |
723 | * entry point for linux usb interface | 726 | * entry point for linux usb interface |