aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt5
-rw-r--r--include/uapi/sound/compress_offload.h14
-rw-r--r--include/uapi/sound/compress_params.h14
-rw-r--r--sound/pci/hda/hda_auto_parser.c1
-rw-r--r--sound/pci/hda/hda_intel.c65
-rw-r--r--sound/pci/hda/hda_local.h21
-rw-r--r--sound/pci/hda/patch_hdmi.c2
-rw-r--r--sound/pci/hda/patch_realtek.c489
-rw-r--r--sound/pci/hda/patch_sigmatel.c58
-rw-r--r--sound/usb/card.c13
-rw-r--r--sound/usb/endpoint.c17
-rw-r--r--sound/usb/endpoint.h1
12 files changed, 365 insertions, 335 deletions
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 85c362d8ea34..d1ab5e17eb13 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -286,6 +286,11 @@ STAC92HD83*
286 hp-inv-led HP with broken BIOS for inverted mute LED 286 hp-inv-led HP with broken BIOS for inverted mute LED
287 auto BIOS setup (default) 287 auto BIOS setup (default)
288 288
289STAC92HD95
290==========
291 hp-led LED support for HP laptops
292 hp-bass Bass HPF setup for HP Spectre 13
293
289STAC9872 294STAC9872
290======== 295========
291 vaio VAIO laptop without SPDIF 296 vaio VAIO laptop without SPDIF
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
index 21eed488783f..1964026b5e09 100644
--- a/include/uapi/sound/compress_offload.h
+++ b/include/uapi/sound/compress_offload.h
@@ -39,7 +39,7 @@
39struct snd_compressed_buffer { 39struct snd_compressed_buffer {
40 __u32 fragment_size; 40 __u32 fragment_size;
41 __u32 fragments; 41 __u32 fragments;
42}; 42} __attribute__((packed, aligned(4)));
43 43
44/** 44/**
45 * struct snd_compr_params: compressed stream params 45 * struct snd_compr_params: compressed stream params
@@ -51,7 +51,7 @@ struct snd_compr_params {
51 struct snd_compressed_buffer buffer; 51 struct snd_compressed_buffer buffer;
52 struct snd_codec codec; 52 struct snd_codec codec;
53 __u8 no_wake_mode; 53 __u8 no_wake_mode;
54}; 54} __attribute__((packed, aligned(4)));
55 55
56/** 56/**
57 * struct snd_compr_tstamp: timestamp descriptor 57 * struct snd_compr_tstamp: timestamp descriptor
@@ -70,7 +70,7 @@ struct snd_compr_tstamp {
70 __u32 pcm_frames; 70 __u32 pcm_frames;
71 __u32 pcm_io_frames; 71 __u32 pcm_io_frames;
72 __u32 sampling_rate; 72 __u32 sampling_rate;
73}; 73} __attribute__((packed, aligned(4)));
74 74
75/** 75/**
76 * struct snd_compr_avail: avail descriptor 76 * struct snd_compr_avail: avail descriptor
@@ -80,7 +80,7 @@ struct snd_compr_tstamp {
80struct snd_compr_avail { 80struct snd_compr_avail {
81 __u64 avail; 81 __u64 avail;
82 struct snd_compr_tstamp tstamp; 82 struct snd_compr_tstamp tstamp;
83} __attribute__((packed)); 83} __attribute__((packed, aligned(4)));
84 84
85enum snd_compr_direction { 85enum snd_compr_direction {
86 SND_COMPRESS_PLAYBACK = 0, 86 SND_COMPRESS_PLAYBACK = 0,
@@ -107,7 +107,7 @@ struct snd_compr_caps {
107 __u32 max_fragments; 107 __u32 max_fragments;
108 __u32 codecs[MAX_NUM_CODECS]; 108 __u32 codecs[MAX_NUM_CODECS];
109 __u32 reserved[11]; 109 __u32 reserved[11];
110}; 110} __attribute__((packed, aligned(4)));
111 111
112/** 112/**
113 * struct snd_compr_codec_caps: query capability of codec 113 * struct snd_compr_codec_caps: query capability of codec
@@ -119,7 +119,7 @@ struct snd_compr_codec_caps {
119 __u32 codec; 119 __u32 codec;
120 __u32 num_descriptors; 120 __u32 num_descriptors;
121 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; 121 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
122}; 122} __attribute__((packed, aligned(4)));
123 123
124/** 124/**
125 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the 125 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
@@ -140,7 +140,7 @@ enum {
140struct snd_compr_metadata { 140struct snd_compr_metadata {
141 __u32 key; 141 __u32 key;
142 __u32 value[8]; 142 __u32 value[8];
143}; 143} __attribute__((packed, aligned(4)));
144 144
145/** 145/**
146 * compress path ioctl definitions 146 * compress path ioctl definitions
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
index 165e7059de75..d9bd9ca0d5b0 100644
--- a/include/uapi/sound/compress_params.h
+++ b/include/uapi/sound/compress_params.h
@@ -268,7 +268,7 @@ struct snd_enc_vorbis {
268 __u32 max_bit_rate; 268 __u32 max_bit_rate;
269 __u32 min_bit_rate; 269 __u32 min_bit_rate;
270 __u32 downmix; 270 __u32 downmix;
271}; 271} __attribute__((packed, aligned(4)));
272 272
273 273
274/** 274/**
@@ -284,7 +284,7 @@ struct snd_enc_real {
284 __u32 quant_bits; 284 __u32 quant_bits;
285 __u32 start_region; 285 __u32 start_region;
286 __u32 num_regions; 286 __u32 num_regions;
287}; 287} __attribute__((packed, aligned(4)));
288 288
289/** 289/**
290 * struct snd_enc_flac 290 * struct snd_enc_flac
@@ -308,12 +308,12 @@ struct snd_enc_real {
308struct snd_enc_flac { 308struct snd_enc_flac {
309 __u32 num; 309 __u32 num;
310 __u32 gain; 310 __u32 gain;
311}; 311} __attribute__((packed, aligned(4)));
312 312
313struct snd_enc_generic { 313struct snd_enc_generic {
314 __u32 bw; /* encoder bandwidth */ 314 __u32 bw; /* encoder bandwidth */
315 __s32 reserved[15]; 315 __s32 reserved[15];
316}; 316} __attribute__((packed, aligned(4)));
317 317
318union snd_codec_options { 318union snd_codec_options {
319 struct snd_enc_wma wma; 319 struct snd_enc_wma wma;
@@ -321,7 +321,7 @@ union snd_codec_options {
321 struct snd_enc_real real; 321 struct snd_enc_real real;
322 struct snd_enc_flac flac; 322 struct snd_enc_flac flac;
323 struct snd_enc_generic generic; 323 struct snd_enc_generic generic;
324}; 324} __attribute__((packed, aligned(4)));
325 325
326/** struct snd_codec_desc - description of codec capabilities 326/** struct snd_codec_desc - description of codec capabilities
327 * @max_ch: Maximum number of audio channels 327 * @max_ch: Maximum number of audio channels
@@ -358,7 +358,7 @@ struct snd_codec_desc {
358 __u32 formats; 358 __u32 formats;
359 __u32 min_buffer; 359 __u32 min_buffer;
360 __u32 reserved[15]; 360 __u32 reserved[15];
361}; 361} __attribute__((packed, aligned(4)));
362 362
363/** struct snd_codec 363/** struct snd_codec
364 * @id: Identifies the supported audio encoder/decoder. 364 * @id: Identifies the supported audio encoder/decoder.
@@ -399,6 +399,6 @@ struct snd_codec {
399 __u32 align; 399 __u32 align;
400 union snd_codec_options options; 400 union snd_codec_options options;
401 __u32 reserved[3]; 401 __u32 reserved[3];
402}; 402} __attribute__((packed, aligned(4)));
403 403
404#endif 404#endif
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index b684c6e4f301..dabe41975a9d 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -898,6 +898,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
898 if (!strcmp(codec->modelname, models->name)) { 898 if (!strcmp(codec->modelname, models->name)) {
899 codec->fixup_id = models->id; 899 codec->fixup_id = models->id;
900 codec->fixup_name = models->name; 900 codec->fixup_name = models->name;
901 codec->fixup_list = fixlist;
901 codec->fixup_forced = 1; 902 codec->fixup_forced = 1;
902 return; 903 return;
903 } 904 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 23fd6b9aecca..25753db97071 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -288,6 +288,24 @@ static char *driver_short_names[] = {
288 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 288 [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
289}; 289};
290 290
291
292/* Intel HSW/BDW display HDA controller Extended Mode registers.
293 * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
294 * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
295 * The values will be lost when the display power well is disabled.
296 */
297#define ICH6_REG_EM4 0x100c
298#define ICH6_REG_EM5 0x1010
299
300struct hda_intel {
301 struct azx chip;
302
303 /* HSW/BDW display HDA controller to restore BCLK from CDCLK */
304 unsigned int bclk_m;
305 unsigned int bclk_n;
306};
307
308
291#ifdef CONFIG_X86 309#ifdef CONFIG_X86
292static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) 310static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on)
293{ 311{
@@ -580,6 +598,22 @@ static int param_set_xint(const char *val, const struct kernel_param *kp)
580#define azx_del_card_list(chip) /* NOP */ 598#define azx_del_card_list(chip) /* NOP */
581#endif /* CONFIG_PM */ 599#endif /* CONFIG_PM */
582 600
601static void haswell_save_bclk(struct azx *chip)
602{
603 struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
604
605 hda->bclk_m = azx_readw(chip, EM4);
606 hda->bclk_n = azx_readw(chip, EM5);
607}
608
609static void haswell_restore_bclk(struct azx *chip)
610{
611 struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
612
613 azx_writew(chip, EM4, hda->bclk_m);
614 azx_writew(chip, EM5, hda->bclk_n);
615}
616
583#if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) 617#if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO)
584/* 618/*
585 * power management 619 * power management
@@ -606,6 +640,13 @@ static int azx_suspend(struct device *dev)
606 free_irq(chip->irq, chip); 640 free_irq(chip->irq, chip);
607 chip->irq = -1; 641 chip->irq = -1;
608 } 642 }
643
644 /* Save BCLK M/N values before they become invalid in D3.
645 * Will test if display power well can be released now.
646 */
647 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
648 haswell_save_bclk(chip);
649
609 if (chip->msi) 650 if (chip->msi)
610 pci_disable_msi(chip->pci); 651 pci_disable_msi(chip->pci);
611 pci_disable_device(pci); 652 pci_disable_device(pci);
@@ -625,8 +666,10 @@ static int azx_resume(struct device *dev)
625 if (chip->disabled) 666 if (chip->disabled)
626 return 0; 667 return 0;
627 668
628 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 669 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
629 hda_display_power(true); 670 hda_display_power(true);
671 haswell_restore_bclk(chip);
672 }
630 pci_set_power_state(pci, PCI_D0); 673 pci_set_power_state(pci, PCI_D0);
631 pci_restore_state(pci); 674 pci_restore_state(pci);
632 if (pci_enable_device(pci) < 0) { 675 if (pci_enable_device(pci) < 0) {
@@ -670,8 +713,10 @@ static int azx_runtime_suspend(struct device *dev)
670 azx_stop_chip(chip); 713 azx_stop_chip(chip);
671 azx_enter_link_reset(chip); 714 azx_enter_link_reset(chip);
672 azx_clear_irq_pending(chip); 715 azx_clear_irq_pending(chip);
673 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 716 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
717 haswell_save_bclk(chip);
674 hda_display_power(false); 718 hda_display_power(false);
719 }
675 return 0; 720 return 0;
676} 721}
677 722
@@ -689,8 +734,10 @@ static int azx_runtime_resume(struct device *dev)
689 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 734 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
690 return 0; 735 return 0;
691 736
692 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 737 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
693 hda_display_power(true); 738 hda_display_power(true);
739 haswell_restore_bclk(chip);
740 }
694 741
695 /* Read STATESTS before controller reset */ 742 /* Read STATESTS before controller reset */
696 status = azx_readw(chip, STATESTS); 743 status = azx_readw(chip, STATESTS);
@@ -883,6 +930,8 @@ static int register_vga_switcheroo(struct azx *chip)
883static int azx_free(struct azx *chip) 930static int azx_free(struct azx *chip)
884{ 931{
885 struct pci_dev *pci = chip->pci; 932 struct pci_dev *pci = chip->pci;
933 struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
934
886 int i; 935 int i;
887 936
888 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) 937 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
@@ -930,7 +979,7 @@ static int azx_free(struct azx *chip)
930 hda_display_power(false); 979 hda_display_power(false);
931 hda_i915_exit(); 980 hda_i915_exit();
932 } 981 }
933 kfree(chip); 982 kfree(hda);
934 983
935 return 0; 984 return 0;
936} 985}
@@ -1174,6 +1223,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
1174 static struct snd_device_ops ops = { 1223 static struct snd_device_ops ops = {
1175 .dev_free = azx_dev_free, 1224 .dev_free = azx_dev_free,
1176 }; 1225 };
1226 struct hda_intel *hda;
1177 struct azx *chip; 1227 struct azx *chip;
1178 int err; 1228 int err;
1179 1229
@@ -1183,13 +1233,14 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
1183 if (err < 0) 1233 if (err < 0)
1184 return err; 1234 return err;
1185 1235
1186 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1236 hda = kzalloc(sizeof(*hda), GFP_KERNEL);
1187 if (!chip) { 1237 if (!hda) {
1188 dev_err(card->dev, "Cannot allocate chip\n"); 1238 dev_err(card->dev, "Cannot allocate hda\n");
1189 pci_disable_device(pci); 1239 pci_disable_device(pci);
1190 return -ENOMEM; 1240 return -ENOMEM;
1191 } 1241 }
1192 1242
1243 chip = &hda->chip;
1193 spin_lock_init(&chip->reg_lock); 1244 spin_lock_init(&chip->reg_lock);
1194 mutex_init(&chip->open_mutex); 1245 mutex_init(&chip->open_mutex);
1195 chip->card = card; 1246 chip->card = card;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index ebd1fa6f015c..4e2d4863daa1 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -417,6 +417,27 @@ struct snd_hda_pin_quirk {
417 int value; /* quirk value */ 417 int value; /* quirk value */
418}; 418};
419 419
420#ifdef CONFIG_SND_DEBUG_VERBOSE
421
422#define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \
423 { .codec = _codec,\
424 .subvendor = _subvendor,\
425 .name = _name,\
426 .value = _value,\
427 .pins = (const struct hda_pintbl[]) { _pins } \
428 }
429#else
430
431#define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \
432 { .codec = _codec,\
433 .subvendor = _subvendor,\
434 .value = _value,\
435 .pins = (const struct hda_pintbl[]) { _pins } \
436 }
437
438#endif
439
440
420/* fixup types */ 441/* fixup types */
421enum { 442enum {
422 HDA_FIXUP_INVALID, 443 HDA_FIXUP_INVALID,
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 3e4417b0ddbe..4fe876b65fda 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2204,7 +2204,7 @@ static int generic_hdmi_resume(struct hda_codec *codec)
2204 struct hdmi_spec *spec = codec->spec; 2204 struct hdmi_spec *spec = codec->spec;
2205 int pin_idx; 2205 int pin_idx;
2206 2206
2207 generic_hdmi_init(codec); 2207 codec->patch_ops.init(codec);
2208 snd_hda_codec_resume_amp(codec); 2208 snd_hda_codec_resume_amp(codec);
2209 snd_hda_codec_resume_cache(codec); 2209 snd_hda_codec_resume_cache(codec);
2210 2210
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index af76995fa966..1c654effcd1a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4962,228 +4962,129 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
4962}; 4962};
4963 4963
4964static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 4964static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
4965 { 4965 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4966 .codec = 0x10ec0255, 4966 {0x12, 0x90a60140},
4967 .subvendor = 0x1028, 4967 {0x14, 0x90170110},
4968#ifdef CONFIG_SND_DEBUG_VERBOSE 4968 {0x17, 0x40000000},
4969 .name = "Dell", 4969 {0x18, 0x411111f0},
4970#endif 4970 {0x19, 0x411111f0},
4971 .pins = (const struct hda_pintbl[]) { 4971 {0x1a, 0x411111f0},
4972 {0x12, 0x90a60140}, 4972 {0x1b, 0x411111f0},
4973 {0x14, 0x90170110}, 4973 {0x1d, 0x40700001},
4974 {0x17, 0x40000000}, 4974 {0x1e, 0x411111f0},
4975 {0x18, 0x411111f0}, 4975 {0x21, 0x02211020}),
4976 {0x19, 0x411111f0}, 4976 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4977 {0x1a, 0x411111f0}, 4977 {0x12, 0x90a60160},
4978 {0x1b, 0x411111f0}, 4978 {0x14, 0x90170120},
4979 {0x1d, 0x40700001}, 4979 {0x17, 0x40000000},
4980 {0x1e, 0x411111f0}, 4980 {0x18, 0x411111f0},
4981 {0x21, 0x02211020}, 4981 {0x19, 0x411111f0},
4982 }, 4982 {0x1a, 0x411111f0},
4983 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4983 {0x1b, 0x411111f0},
4984 }, 4984 {0x1d, 0x40700001},
4985 { 4985 {0x1e, 0x411111f0},
4986 .codec = 0x10ec0255, 4986 {0x21, 0x02211030}),
4987 .subvendor = 0x1028, 4987 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4988#ifdef CONFIG_SND_DEBUG_VERBOSE 4988 {0x12, 0x90a60160},
4989 .name = "Dell", 4989 {0x14, 0x90170120},
4990#endif 4990 {0x17, 0x90170140},
4991 .pins = (const struct hda_pintbl[]) { 4991 {0x18, 0x40000000},
4992 {0x12, 0x90a60160}, 4992 {0x19, 0x411111f0},
4993 {0x14, 0x90170120}, 4993 {0x1a, 0x411111f0},
4994 {0x17, 0x40000000}, 4994 {0x1b, 0x411111f0},
4995 {0x18, 0x411111f0}, 4995 {0x1d, 0x41163b05},
4996 {0x19, 0x411111f0}, 4996 {0x1e, 0x411111f0},
4997 {0x1a, 0x411111f0}, 4997 {0x21, 0x0321102f}),
4998 {0x1b, 0x411111f0}, 4998 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4999 {0x1d, 0x40700001}, 4999 {0x12, 0x90a60160},
5000 {0x1e, 0x411111f0}, 5000 {0x14, 0x90170130},
5001 {0x21, 0x02211030}, 5001 {0x17, 0x40000000},
5002 }, 5002 {0x18, 0x411111f0},
5003 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5003 {0x19, 0x411111f0},
5004 }, 5004 {0x1a, 0x411111f0},
5005 { 5005 {0x1b, 0x411111f0},
5006 .codec = 0x10ec0255, 5006 {0x1d, 0x40700001},
5007 .subvendor = 0x1028, 5007 {0x1e, 0x411111f0},
5008#ifdef CONFIG_SND_DEBUG_VERBOSE 5008 {0x21, 0x02211040}),
5009 .name = "Dell", 5009 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5010#endif 5010 {0x12, 0x90a60160},
5011 .pins = (const struct hda_pintbl[]) { 5011 {0x14, 0x90170140},
5012 {0x12, 0x90a60160}, 5012 {0x17, 0x40000000},
5013 {0x14, 0x90170120}, 5013 {0x18, 0x411111f0},
5014 {0x17, 0x90170140}, 5014 {0x19, 0x411111f0},
5015 {0x18, 0x40000000}, 5015 {0x1a, 0x411111f0},
5016 {0x19, 0x411111f0}, 5016 {0x1b, 0x411111f0},
5017 {0x1a, 0x411111f0}, 5017 {0x1d, 0x40700001},
5018 {0x1b, 0x411111f0}, 5018 {0x1e, 0x411111f0},
5019 {0x1d, 0x41163b05}, 5019 {0x21, 0x02211050}),
5020 {0x1e, 0x411111f0}, 5020 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5021 {0x21, 0x0321102f}, 5021 {0x12, 0x90a60170},
5022 }, 5022 {0x14, 0x90170120},
5023 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5023 {0x17, 0x40000000},
5024 }, 5024 {0x18, 0x411111f0},
5025 { 5025 {0x19, 0x411111f0},
5026 .codec = 0x10ec0255, 5026 {0x1a, 0x411111f0},
5027 .subvendor = 0x1028, 5027 {0x1b, 0x411111f0},
5028#ifdef CONFIG_SND_DEBUG_VERBOSE 5028 {0x1d, 0x40700001},
5029 .name = "Dell", 5029 {0x1e, 0x411111f0},
5030#endif 5030 {0x21, 0x02211030}),
5031 .pins = (const struct hda_pintbl[]) { 5031 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5032 {0x12, 0x90a60160}, 5032 {0x12, 0x90a60170},
5033 {0x14, 0x90170130}, 5033 {0x14, 0x90170130},
5034 {0x17, 0x40000000}, 5034 {0x17, 0x40000000},
5035 {0x18, 0x411111f0}, 5035 {0x18, 0x411111f0},
5036 {0x19, 0x411111f0}, 5036 {0x19, 0x411111f0},
5037 {0x1a, 0x411111f0}, 5037 {0x1a, 0x411111f0},
5038 {0x1b, 0x411111f0}, 5038 {0x1b, 0x411111f0},
5039 {0x1d, 0x40700001}, 5039 {0x1d, 0x40700001},
5040 {0x1e, 0x411111f0}, 5040 {0x1e, 0x411111f0},
5041 {0x21, 0x02211040}, 5041 {0x21, 0x02211040}),
5042 }, 5042 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5043 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5043 {0x12, 0x90a60130},
5044 }, 5044 {0x14, 0x90170110},
5045 { 5045 {0x17, 0x40020008},
5046 .codec = 0x10ec0255, 5046 {0x18, 0x411111f0},
5047 .subvendor = 0x1028, 5047 {0x19, 0x411111f0},
5048#ifdef CONFIG_SND_DEBUG_VERBOSE 5048 {0x1a, 0x411111f0},
5049 .name = "Dell", 5049 {0x1b, 0x411111f0},
5050#endif 5050 {0x1d, 0x40e00001},
5051 .pins = (const struct hda_pintbl[]) { 5051 {0x1e, 0x411111f0},
5052 {0x12, 0x90a60160}, 5052 {0x21, 0x0321101f}),
5053 {0x14, 0x90170140}, 5053 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5054 {0x17, 0x40000000}, 5054 {0x12, 0x90a60160},
5055 {0x18, 0x411111f0}, 5055 {0x14, 0x90170120},
5056 {0x19, 0x411111f0}, 5056 {0x17, 0x40000000},
5057 {0x1a, 0x411111f0}, 5057 {0x18, 0x411111f0},
5058 {0x1b, 0x411111f0}, 5058 {0x19, 0x411111f0},
5059 {0x1d, 0x40700001}, 5059 {0x1a, 0x411111f0},
5060 {0x1e, 0x411111f0}, 5060 {0x1b, 0x411111f0},
5061 {0x21, 0x02211050}, 5061 {0x1d, 0x40700001},
5062 }, 5062 {0x1e, 0x411111f0},
5063 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5063 {0x21, 0x02211030}),
5064 }, 5064 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5065 { 5065 {0x12, 0x90a60140},
5066 .codec = 0x10ec0255, 5066 {0x13, 0x411111f0},
5067 .subvendor = 0x1028, 5067 {0x14, 0x90170110},
5068#ifdef CONFIG_SND_DEBUG_VERBOSE 5068 {0x15, 0x0221401f},
5069 .name = "Dell", 5069 {0x16, 0x411111f0},
5070#endif 5070 {0x18, 0x411111f0},
5071 .pins = (const struct hda_pintbl[]) { 5071 {0x19, 0x411111f0},
5072 {0x12, 0x90a60170}, 5072 {0x1a, 0x411111f0},
5073 {0x14, 0x90170120}, 5073 {0x1b, 0x411111f0},
5074 {0x17, 0x40000000}, 5074 {0x1d, 0x40700001},
5075 {0x18, 0x411111f0}, 5075 {0x1e, 0x411111f0}),
5076 {0x19, 0x411111f0}, 5076 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5077 {0x1a, 0x411111f0}, 5077 {0x12, 0x40000000},
5078 {0x1b, 0x411111f0}, 5078 {0x13, 0x90a60140},
5079 {0x1d, 0x40700001}, 5079 {0x14, 0x90170110},
5080 {0x1e, 0x411111f0}, 5080 {0x15, 0x0221401f},
5081 {0x21, 0x02211030}, 5081 {0x16, 0x21014020},
5082 }, 5082 {0x18, 0x411111f0},
5083 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5083 {0x19, 0x21a19030},
5084 }, 5084 {0x1a, 0x411111f0},
5085 { 5085 {0x1b, 0x411111f0},
5086 .codec = 0x10ec0255, 5086 {0x1d, 0x40700001},
5087 .subvendor = 0x1028, 5087 {0x1e, 0x411111f0}),
5088#ifdef CONFIG_SND_DEBUG_VERBOSE
5089 .name = "Dell",
5090#endif
5091 .pins = (const struct hda_pintbl[]) {
5092 {0x12, 0x90a60170},
5093 {0x14, 0x90170130},
5094 {0x17, 0x40000000},
5095 {0x18, 0x411111f0},
5096 {0x19, 0x411111f0},
5097 {0x1a, 0x411111f0},
5098 {0x1b, 0x411111f0},
5099 {0x1d, 0x40700001},
5100 {0x1e, 0x411111f0},
5101 {0x21, 0x02211040},
5102 },
5103 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5104 },
5105 {
5106 .codec = 0x10ec0283,
5107 .subvendor = 0x1028,
5108#ifdef CONFIG_SND_DEBUG_VERBOSE
5109 .name = "Dell",
5110#endif
5111 .pins = (const struct hda_pintbl[]) {
5112 {0x12, 0x90a60130},
5113 {0x14, 0x90170110},
5114 {0x17, 0x40020008},
5115 {0x18, 0x411111f0},
5116 {0x19, 0x411111f0},
5117 {0x1a, 0x411111f0},
5118 {0x1b, 0x411111f0},
5119 {0x1d, 0x40e00001},
5120 {0x1e, 0x411111f0},
5121 {0x21, 0x0321101f},
5122 },
5123 .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5124 },
5125 {
5126 .codec = 0x10ec0283,
5127 .subvendor = 0x1028,
5128#ifdef CONFIG_SND_DEBUG_VERBOSE
5129 .name = "Dell",
5130#endif
5131 .pins = (const struct hda_pintbl[]) {
5132 {0x12, 0x90a60160},
5133 {0x14, 0x90170120},
5134 {0x17, 0x40000000},
5135 {0x18, 0x411111f0},
5136 {0x19, 0x411111f0},
5137 {0x1a, 0x411111f0},
5138 {0x1b, 0x411111f0},
5139 {0x1d, 0x40700001},
5140 {0x1e, 0x411111f0},
5141 {0x21, 0x02211030},
5142 },
5143 .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5144 },
5145 {
5146 .codec = 0x10ec0292,
5147 .subvendor = 0x1028,
5148#ifdef CONFIG_SND_DEBUG_VERBOSE
5149 .name = "Dell",
5150#endif
5151 .pins = (const struct hda_pintbl[]) {
5152 {0x12, 0x90a60140},
5153 {0x13, 0x411111f0},
5154 {0x14, 0x90170110},
5155 {0x15, 0x0221401f},
5156 {0x16, 0x411111f0},
5157 {0x18, 0x411111f0},
5158 {0x19, 0x411111f0},
5159 {0x1a, 0x411111f0},
5160 {0x1b, 0x411111f0},
5161 {0x1d, 0x40700001},
5162 {0x1e, 0x411111f0},
5163 },
5164 .value = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5165 },
5166 {
5167 .codec = 0x10ec0293,
5168 .subvendor = 0x1028,
5169#ifdef CONFIG_SND_DEBUG_VERBOSE
5170 .name = "Dell",
5171#endif
5172 .pins = (const struct hda_pintbl[]) {
5173 {0x12, 0x40000000},
5174 {0x13, 0x90a60140},
5175 {0x14, 0x90170110},
5176 {0x15, 0x0221401f},
5177 {0x16, 0x21014020},
5178 {0x18, 0x411111f0},
5179 {0x19, 0x21a19030},
5180 {0x1a, 0x411111f0},
5181 {0x1b, 0x411111f0},
5182 {0x1d, 0x40700001},
5183 {0x1e, 0x411111f0},
5184 },
5185 .value = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5186 },
5187 {} 5088 {}
5188}; 5089};
5189 5090
@@ -6039,90 +5940,66 @@ static const struct hda_model_fixup alc662_fixup_models[] = {
6039}; 5940};
6040 5941
6041static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 5942static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
6042 { 5943 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6043 .codec = 0x10ec0668, 5944 {0x12, 0x99a30130},
6044 .subvendor = 0x1028, 5945 {0x14, 0x90170110},
6045#ifdef CONFIG_SND_DEBUG_VERBOSE 5946 {0x15, 0x0321101f},
6046 .name = "Dell", 5947 {0x16, 0x03011020},
6047#endif 5948 {0x18, 0x40000008},
6048 .pins = (const struct hda_pintbl[]) { 5949 {0x19, 0x411111f0},
6049 {0x12, 0x99a30130}, 5950 {0x1a, 0x411111f0},
6050 {0x14, 0x90170110}, 5951 {0x1b, 0x411111f0},
6051 {0x15, 0x0321101f}, 5952 {0x1d, 0x41000001},
6052 {0x16, 0x03011020}, 5953 {0x1e, 0x411111f0},
6053 {0x18, 0x40000008}, 5954 {0x1f, 0x411111f0}),
6054 {0x19, 0x411111f0}, 5955 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6055 {0x1a, 0x411111f0}, 5956 {0x12, 0x99a30140},
6056 {0x1b, 0x411111f0}, 5957 {0x14, 0x90170110},
6057 {0x1d, 0x41000001}, 5958 {0x15, 0x0321101f},
6058 {0x1e, 0x411111f0}, 5959 {0x16, 0x03011020},
6059 {0x1f, 0x411111f0}, 5960 {0x18, 0x40000008},
6060 }, 5961 {0x19, 0x411111f0},
6061 .value = ALC668_FIXUP_AUTO_MUTE, 5962 {0x1a, 0x411111f0},
6062 }, 5963 {0x1b, 0x411111f0},
6063 { 5964 {0x1d, 0x41000001},
6064 .codec = 0x10ec0668, 5965 {0x1e, 0x411111f0},
6065 .subvendor = 0x1028, 5966 {0x1f, 0x411111f0}),
6066#ifdef CONFIG_SND_DEBUG_VERBOSE 5967 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6067 .name = "Dell", 5968 {0x12, 0x99a30150},
6068#endif 5969 {0x14, 0x90170110},
6069 .pins = (const struct hda_pintbl[]) { 5970 {0x15, 0x0321101f},
6070 {0x12, 0x99a30140}, 5971 {0x16, 0x03011020},
6071 {0x14, 0x90170110}, 5972 {0x18, 0x40000008},
6072 {0x15, 0x0321101f}, 5973 {0x19, 0x411111f0},
6073 {0x16, 0x03011020}, 5974 {0x1a, 0x411111f0},
6074 {0x18, 0x40000008}, 5975 {0x1b, 0x411111f0},
6075 {0x19, 0x411111f0}, 5976 {0x1d, 0x41000001},
6076 {0x1a, 0x411111f0}, 5977 {0x1e, 0x411111f0},
6077 {0x1b, 0x411111f0}, 5978 {0x1f, 0x411111f0}),
6078 {0x1d, 0x41000001}, 5979 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6079 {0x1e, 0x411111f0}, 5980 {0x12, 0x411111f0},
6080 {0x1f, 0x411111f0}, 5981 {0x14, 0x90170110},
6081 }, 5982 {0x15, 0x0321101f},
6082 .value = ALC668_FIXUP_AUTO_MUTE, 5983 {0x16, 0x03011020},
6083 }, 5984 {0x18, 0x40000008},
6084 { 5985 {0x19, 0x411111f0},
6085 .codec = 0x10ec0668, 5986 {0x1a, 0x411111f0},
6086 .subvendor = 0x1028, 5987 {0x1b, 0x411111f0},
6087#ifdef CONFIG_SND_DEBUG_VERBOSE 5988 {0x1d, 0x41000001},
6088 .name = "Dell", 5989 {0x1e, 0x411111f0},
6089#endif 5990 {0x1f, 0x411111f0}),
6090 .pins = (const struct hda_pintbl[]) { 5991 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
6091 {0x12, 0x99a30150}, 5992 {0x12, 0x90a60130},
6092 {0x14, 0x90170110}, 5993 {0x14, 0x90170110},
6093 {0x15, 0x0321101f}, 5994 {0x15, 0x0321101f},
6094 {0x16, 0x03011020}, 5995 {0x16, 0x40000000},
6095 {0x18, 0x40000008}, 5996 {0x18, 0x411111f0},
6096 {0x19, 0x411111f0}, 5997 {0x19, 0x411111f0},
6097 {0x1a, 0x411111f0}, 5998 {0x1a, 0x411111f0},
6098 {0x1b, 0x411111f0}, 5999 {0x1b, 0x411111f0},
6099 {0x1d, 0x41000001}, 6000 {0x1d, 0x40d6832d},
6100 {0x1e, 0x411111f0}, 6001 {0x1e, 0x411111f0},
6101 {0x1f, 0x411111f0}, 6002 {0x1f, 0x411111f0}),
6102 },
6103 .value = ALC668_FIXUP_AUTO_MUTE,
6104 },
6105 {
6106 .codec = 0x10ec0668,
6107 .subvendor = 0x1028,
6108#ifdef CONFIG_SND_DEBUG_VERBOSE
6109 .name = "Dell",
6110#endif
6111 .pins = (const struct hda_pintbl[]) {
6112 {0x12, 0x411111f0},
6113 {0x14, 0x90170110},
6114 {0x15, 0x0321101f},
6115 {0x16, 0x03011020},
6116 {0x18, 0x40000008},
6117 {0x19, 0x411111f0},
6118 {0x1a, 0x411111f0},
6119 {0x1b, 0x411111f0},
6120 {0x1d, 0x41000001},
6121 {0x1e, 0x411111f0},
6122 {0x1f, 0x411111f0},
6123 },
6124 .value = ALC668_FIXUP_AUTO_MUTE,
6125 },
6126 {} 6003 {}
6127}; 6004};
6128 6005
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7f40a150899c..3744ea4e843d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -122,6 +122,12 @@ enum {
122}; 122};
123 123
124enum { 124enum {
125 STAC_92HD95_HP_LED,
126 STAC_92HD95_HP_BASS,
127 STAC_92HD95_MODELS
128};
129
130enum {
125 STAC_925x_REF, 131 STAC_925x_REF,
126 STAC_M1, 132 STAC_M1,
127 STAC_M1_2, 133 STAC_M1_2,
@@ -4128,6 +4134,48 @@ static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
4128 {} /* terminator */ 4134 {} /* terminator */
4129}; 4135};
4130 4136
4137static void stac92hd95_fixup_hp_led(struct hda_codec *codec,
4138 const struct hda_fixup *fix, int action)
4139{
4140 struct sigmatel_spec *spec = codec->spec;
4141
4142 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4143 return;
4144
4145 if (find_mute_led_cfg(codec, spec->default_polarity))
4146 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
4147 spec->gpio_led,
4148 spec->gpio_led_polarity);
4149}
4150
4151static const struct hda_fixup stac92hd95_fixups[] = {
4152 [STAC_92HD95_HP_LED] = {
4153 .type = HDA_FIXUP_FUNC,
4154 .v.func = stac92hd95_fixup_hp_led,
4155 },
4156 [STAC_92HD95_HP_BASS] = {
4157 .type = HDA_FIXUP_VERBS,
4158 .v.verbs = (const struct hda_verb[]) {
4159 {0x1a, 0x795, 0x00}, /* HPF to 100Hz */
4160 {}
4161 },
4162 .chained = true,
4163 .chain_id = STAC_92HD95_HP_LED,
4164 },
4165};
4166
4167static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = {
4168 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS),
4169 {} /* terminator */
4170};
4171
4172static const struct hda_model_fixup stac92hd95_models[] = {
4173 { .id = STAC_92HD95_HP_LED, .name = "hp-led" },
4174 { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" },
4175 {}
4176};
4177
4178
4131static int stac_parse_auto_config(struct hda_codec *codec) 4179static int stac_parse_auto_config(struct hda_codec *codec)
4132{ 4180{
4133 struct sigmatel_spec *spec = codec->spec; 4181 struct sigmatel_spec *spec = codec->spec;
@@ -4580,10 +4628,16 @@ static int patch_stac92hd95(struct hda_codec *codec)
4580 spec->gen.beep_nid = 0x19; /* digital beep */ 4628 spec->gen.beep_nid = 0x19; /* digital beep */
4581 spec->pwr_nids = stac92hd95_pwr_nids; 4629 spec->pwr_nids = stac92hd95_pwr_nids;
4582 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); 4630 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids);
4583 spec->default_polarity = -1; /* no default cfg */ 4631 spec->default_polarity = 0;
4584 4632
4585 codec->patch_ops = stac_patch_ops; 4633 codec->patch_ops = stac_patch_ops;
4586 4634
4635 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl,
4636 stac92hd95_fixups);
4637 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4638
4639 stac_setup_gpio(codec);
4640
4587 err = stac_parse_auto_config(codec); 4641 err = stac_parse_auto_config(codec);
4588 if (err < 0) { 4642 if (err < 0) {
4589 stac_free(codec); 4643 stac_free(codec);
@@ -4592,6 +4646,8 @@ static int patch_stac92hd95(struct hda_codec *codec)
4592 4646
4593 codec->proc_widget_hook = stac92hd_proc_hook; 4647 codec->proc_widget_hook = stac92hd_proc_hook;
4594 4648
4649 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4650
4595 return 0; 4651 return 0;
4596} 4652}
4597 4653
diff --git a/sound/usb/card.c b/sound/usb/card.c
index c3b5b7dca1c3..a09e5f3519e3 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -307,6 +307,11 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
307 307
308static int snd_usb_audio_free(struct snd_usb_audio *chip) 308static int snd_usb_audio_free(struct snd_usb_audio *chip)
309{ 309{
310 struct list_head *p, *n;
311
312 list_for_each_safe(p, n, &chip->ep_list)
313 snd_usb_endpoint_free(p);
314
310 mutex_destroy(&chip->mutex); 315 mutex_destroy(&chip->mutex);
311 kfree(chip); 316 kfree(chip);
312 return 0; 317 return 0;
@@ -585,7 +590,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
585 struct snd_usb_audio *chip) 590 struct snd_usb_audio *chip)
586{ 591{
587 struct snd_card *card; 592 struct snd_card *card;
588 struct list_head *p, *n; 593 struct list_head *p;
589 594
590 if (chip == (void *)-1L) 595 if (chip == (void *)-1L)
591 return; 596 return;
@@ -598,14 +603,16 @@ static void snd_usb_audio_disconnect(struct usb_device *dev,
598 mutex_lock(&register_mutex); 603 mutex_lock(&register_mutex);
599 chip->num_interfaces--; 604 chip->num_interfaces--;
600 if (chip->num_interfaces <= 0) { 605 if (chip->num_interfaces <= 0) {
606 struct snd_usb_endpoint *ep;
607
601 snd_card_disconnect(card); 608 snd_card_disconnect(card);
602 /* release the pcm resources */ 609 /* release the pcm resources */
603 list_for_each(p, &chip->pcm_list) { 610 list_for_each(p, &chip->pcm_list) {
604 snd_usb_stream_disconnect(p); 611 snd_usb_stream_disconnect(p);
605 } 612 }
606 /* release the endpoint resources */ 613 /* release the endpoint resources */
607 list_for_each_safe(p, n, &chip->ep_list) { 614 list_for_each_entry(ep, &chip->ep_list, list) {
608 snd_usb_endpoint_free(p); 615 snd_usb_endpoint_release(ep);
609 } 616 }
610 /* release the midi resources */ 617 /* release the midi resources */
611 list_for_each(p, &chip->midi_list) { 618 list_for_each(p, &chip->midi_list) {
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 289f582c9130..114e3e7ff511 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -987,19 +987,30 @@ void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep)
987} 987}
988 988
989/** 989/**
990 * snd_usb_endpoint_release: Tear down an snd_usb_endpoint
991 *
992 * @ep: the endpoint to release
993 *
994 * This function does not care for the endpoint's use count but will tear
995 * down all the streaming URBs immediately.
996 */
997void snd_usb_endpoint_release(struct snd_usb_endpoint *ep)
998{
999 release_urbs(ep, 1);
1000}
1001
1002/**
990 * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint 1003 * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint
991 * 1004 *
992 * @ep: the list header of the endpoint to free 1005 * @ep: the list header of the endpoint to free
993 * 1006 *
994 * This function does not care for the endpoint's use count but will tear 1007 * This free all resources of the given ep.
995 * down all the streaming URBs immediately and free all resources.
996 */ 1008 */
997void snd_usb_endpoint_free(struct list_head *head) 1009void snd_usb_endpoint_free(struct list_head *head)
998{ 1010{
999 struct snd_usb_endpoint *ep; 1011 struct snd_usb_endpoint *ep;
1000 1012
1001 ep = list_entry(head, struct snd_usb_endpoint, list); 1013 ep = list_entry(head, struct snd_usb_endpoint, list);
1002 release_urbs(ep, 1);
1003 kfree(ep); 1014 kfree(ep);
1004} 1015}
1005 1016
diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h
index 1c7e8ee48abc..e61ee5c356a3 100644
--- a/sound/usb/endpoint.h
+++ b/sound/usb/endpoint.h
@@ -23,6 +23,7 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
23void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); 23void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
24int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); 24int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
25void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); 25void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep);
26void snd_usb_endpoint_release(struct snd_usb_endpoint *ep);
26void snd_usb_endpoint_free(struct list_head *head); 27void snd_usb_endpoint_free(struct list_head *head);
27 28
28int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep); 29int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);