diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 15:14:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 15:14:22 -0500 |
commit | 9991357259a5718813881bae96d3704bb3f531e2 (patch) | |
tree | 1d57363d0658ecdfe18bce35ffecfb9f09bb7b3b /sound | |
parent | c861cd3e92d92ae946e19099f198018fcb4fd887 (diff) | |
parent | f441917256c9727d3573ca2f89f657a75e06a262 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Revert the check of NO_PRESENCE pincfg default bit
ALSA: hda - Fix a regression for DMA-position check with CA0110
ALSA: hda - Fix silent output regression with ALC861
ALSA: control: remove compilation warning on 32-bit
ALSA: ua101: fix crash when unplugging
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/control.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_local.h | 7 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 6 | ||||
-rw-r--r-- | sound/usb/misc/ua101.c | 28 |
5 files changed, 36 insertions, 13 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 978fe1a8e9f0..59edb12dd542 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -1081,12 +1081,12 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue) | |||
1081 | char *names, *p; | 1081 | char *names, *p; |
1082 | size_t buf_len, name_len; | 1082 | size_t buf_len, name_len; |
1083 | unsigned int i; | 1083 | unsigned int i; |
1084 | const uintptr_t user_ptrval = ue->info.value.enumerated.names_ptr; | ||
1084 | 1085 | ||
1085 | if (ue->info.value.enumerated.names_length > 64 * 1024) | 1086 | if (ue->info.value.enumerated.names_length > 64 * 1024) |
1086 | return -EINVAL; | 1087 | return -EINVAL; |
1087 | 1088 | ||
1088 | names = memdup_user( | 1089 | names = memdup_user((const void __user *)user_ptrval, |
1089 | (const void __user *)ue->info.value.enumerated.names_ptr, | ||
1090 | ue->info.value.enumerated.names_length); | 1090 | ue->info.value.enumerated.names_length); |
1091 | if (IS_ERR(names)) | 1091 | if (IS_ERR(names)) |
1092 | return PTR_ERR(names); | 1092 | return PTR_ERR(names); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bd7fc99af187..096507d2ca9a 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -3063,12 +3063,12 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { | |||
3063 | .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, | 3063 | .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, |
3064 | .class_mask = 0xffffff, | 3064 | .class_mask = 0xffffff, |
3065 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | | 3065 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | |
3066 | AZX_DCAPS_RIRB_PRE_DELAY }, | 3066 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, |
3067 | #else | 3067 | #else |
3068 | /* this entry seems still valid -- i.e. without emu20kx chip */ | 3068 | /* this entry seems still valid -- i.e. without emu20kx chip */ |
3069 | { PCI_DEVICE(0x1102, 0x0009), | 3069 | { PCI_DEVICE(0x1102, 0x0009), |
3070 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | | 3070 | .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | |
3071 | AZX_DCAPS_RIRB_PRE_DELAY }, | 3071 | AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, |
3072 | #endif | 3072 | #endif |
3073 | /* Vortex86MX */ | 3073 | /* Vortex86MX */ |
3074 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, | 3074 | { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 79f49e2e8cbc..dcbea0da0fa2 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -511,8 +511,11 @@ int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid); | |||
511 | static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) | 511 | static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) |
512 | { | 512 | { |
513 | return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) && | 513 | return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) && |
514 | !(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) & | 514 | /* disable MISC_NO_PRESENCE check because it may break too |
515 | AC_DEFCFG_MISC_NO_PRESENCE)) && | 515 | * many devices |
516 | */ | ||
517 | /*(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) & | ||
518 | AC_DEFCFG_MISC_NO_PRESENCE)) &&*/ | ||
516 | (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP); | 519 | (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP); |
517 | } | 520 | } |
518 | 521 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 80d6add8a620..9693059dec84 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3329,6 +3329,12 @@ static void alc_auto_set_output_and_unmute(struct hda_codec *codec, | |||
3329 | if (nid) | 3329 | if (nid) |
3330 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 3330 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
3331 | AMP_OUT_ZERO); | 3331 | AMP_OUT_ZERO); |
3332 | |||
3333 | /* unmute DAC if it's not assigned to a mixer */ | ||
3334 | nid = alc_look_for_out_mute_nid(codec, pin, dac); | ||
3335 | if (nid == mix && nid_has_mute(codec, dac, HDA_OUTPUT)) | ||
3336 | snd_hda_codec_write(codec, dac, 0, AC_VERB_SET_AMP_GAIN_MUTE, | ||
3337 | AMP_OUT_ZERO); | ||
3332 | } | 3338 | } |
3333 | 3339 | ||
3334 | static void alc_auto_init_multi_out(struct hda_codec *codec) | 3340 | static void alc_auto_init_multi_out(struct hda_codec *codec) |
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 67bec7612442..c0609c210303 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -459,7 +459,8 @@ static void kill_stream_urbs(struct ua101_stream *stream) | |||
459 | unsigned int i; | 459 | unsigned int i; |
460 | 460 | ||
461 | for (i = 0; i < stream->queue_length; ++i) | 461 | for (i = 0; i < stream->queue_length; ++i) |
462 | usb_kill_urb(&stream->urbs[i]->urb); | 462 | if (stream->urbs[i]) |
463 | usb_kill_urb(&stream->urbs[i]->urb); | ||
463 | } | 464 | } |
464 | 465 | ||
465 | static int enable_iso_interface(struct ua101 *ua, unsigned int intf_index) | 466 | static int enable_iso_interface(struct ua101 *ua, unsigned int intf_index) |
@@ -484,6 +485,9 @@ static void disable_iso_interface(struct ua101 *ua, unsigned int intf_index) | |||
484 | { | 485 | { |
485 | struct usb_host_interface *alts; | 486 | struct usb_host_interface *alts; |
486 | 487 | ||
488 | if (!ua->intf[intf_index]) | ||
489 | return; | ||
490 | |||
487 | alts = ua->intf[intf_index]->cur_altsetting; | 491 | alts = ua->intf[intf_index]->cur_altsetting; |
488 | if (alts->desc.bAlternateSetting != 0) { | 492 | if (alts->desc.bAlternateSetting != 0) { |
489 | int err = usb_set_interface(ua->dev, | 493 | int err = usb_set_interface(ua->dev, |
@@ -1144,27 +1148,37 @@ static void free_stream_urbs(struct ua101_stream *stream) | |||
1144 | { | 1148 | { |
1145 | unsigned int i; | 1149 | unsigned int i; |
1146 | 1150 | ||
1147 | for (i = 0; i < stream->queue_length; ++i) | 1151 | for (i = 0; i < stream->queue_length; ++i) { |
1148 | kfree(stream->urbs[i]); | 1152 | kfree(stream->urbs[i]); |
1153 | stream->urbs[i] = NULL; | ||
1154 | } | ||
1149 | } | 1155 | } |
1150 | 1156 | ||
1151 | static void free_usb_related_resources(struct ua101 *ua, | 1157 | static void free_usb_related_resources(struct ua101 *ua, |
1152 | struct usb_interface *interface) | 1158 | struct usb_interface *interface) |
1153 | { | 1159 | { |
1154 | unsigned int i; | 1160 | unsigned int i; |
1161 | struct usb_interface *intf; | ||
1155 | 1162 | ||
1163 | mutex_lock(&ua->mutex); | ||
1156 | free_stream_urbs(&ua->capture); | 1164 | free_stream_urbs(&ua->capture); |
1157 | free_stream_urbs(&ua->playback); | 1165 | free_stream_urbs(&ua->playback); |
1166 | mutex_unlock(&ua->mutex); | ||
1158 | free_stream_buffers(ua, &ua->capture); | 1167 | free_stream_buffers(ua, &ua->capture); |
1159 | free_stream_buffers(ua, &ua->playback); | 1168 | free_stream_buffers(ua, &ua->playback); |
1160 | 1169 | ||
1161 | for (i = 0; i < ARRAY_SIZE(ua->intf); ++i) | 1170 | for (i = 0; i < ARRAY_SIZE(ua->intf); ++i) { |
1162 | if (ua->intf[i]) { | 1171 | mutex_lock(&ua->mutex); |
1163 | usb_set_intfdata(ua->intf[i], NULL); | 1172 | intf = ua->intf[i]; |
1164 | if (ua->intf[i] != interface) | 1173 | ua->intf[i] = NULL; |
1174 | mutex_unlock(&ua->mutex); | ||
1175 | if (intf) { | ||
1176 | usb_set_intfdata(intf, NULL); | ||
1177 | if (intf != interface) | ||
1165 | usb_driver_release_interface(&ua101_driver, | 1178 | usb_driver_release_interface(&ua101_driver, |
1166 | ua->intf[i]); | 1179 | intf); |
1167 | } | 1180 | } |
1181 | } | ||
1168 | } | 1182 | } |
1169 | 1183 | ||
1170 | static void ua101_card_free(struct snd_card *card) | 1184 | static void ua101_card_free(struct snd_card *card) |