Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Here includes a few patchset for fixing mostly HD-audio issues in
addition to a patch assuring the compress API bytes alignment and a
fix for the die-hard existing race condition at USB-audio
disconnection. The volume looks big in Realtek HD-audio code, but
it's just a translation of the fixup tables, and the actual changes
are rather trivial"

* tag 'sound-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller
ALSA: usb-audio: Fix races at disconnection and PCM closing
ALSA: hda - Adjust speaker HPF and add LED support for HP Spectre 13
ALSA: hda - Make the pin quirk tables use the SND_HDA_PIN_QUIRK macro
ALSA: hda - Make a SND_HDA_PIN_QUIRK macro
ALSA: hda - Add pin quirk for Dell XPS 15
ALSA: hda - hdmi: call overridden init on resume
ALSA: hda - Fix usage of "model" module parameter
ALSA: compress: fix the struct alignment to 4 bytes

+365 -335
+5
Documentation/sound/alsa/HD-Audio-Models.txt
··· 286 286 hp-inv-led HP with broken BIOS for inverted mute LED 287 287 auto BIOS setup (default) 288 288 289 + STAC92HD95 290 + ========== 291 + hp-led LED support for HP laptops 292 + hp-bass Bass HPF setup for HP Spectre 13 293 + 289 294 STAC9872 290 295 ======== 291 296 vaio VAIO laptop without SPDIF
+7 -7
include/uapi/sound/compress_offload.h
··· 39 39 struct snd_compressed_buffer { 40 40 __u32 fragment_size; 41 41 __u32 fragments; 42 - }; 42 + } __attribute__((packed, aligned(4))); 43 43 44 44 /** 45 45 * struct snd_compr_params: compressed stream params ··· 51 51 struct snd_compressed_buffer buffer; 52 52 struct snd_codec codec; 53 53 __u8 no_wake_mode; 54 - }; 54 + } __attribute__((packed, aligned(4))); 55 55 56 56 /** 57 57 * struct snd_compr_tstamp: timestamp descriptor ··· 70 70 __u32 pcm_frames; 71 71 __u32 pcm_io_frames; 72 72 __u32 sampling_rate; 73 - }; 73 + } __attribute__((packed, aligned(4))); 74 74 75 75 /** 76 76 * struct snd_compr_avail: avail descriptor ··· 80 80 struct snd_compr_avail { 81 81 __u64 avail; 82 82 struct snd_compr_tstamp tstamp; 83 - } __attribute__((packed)); 83 + } __attribute__((packed, aligned(4))); 84 84 85 85 enum snd_compr_direction { 86 86 SND_COMPRESS_PLAYBACK = 0, ··· 107 107 __u32 max_fragments; 108 108 __u32 codecs[MAX_NUM_CODECS]; 109 109 __u32 reserved[11]; 110 - }; 110 + } __attribute__((packed, aligned(4))); 111 111 112 112 /** 113 113 * struct snd_compr_codec_caps: query capability of codec ··· 119 119 __u32 codec; 120 120 __u32 num_descriptors; 121 121 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; 122 - }; 122 + } __attribute__((packed, aligned(4))); 123 123 124 124 /** 125 125 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the ··· 140 140 struct snd_compr_metadata { 141 141 __u32 key; 142 142 __u32 value[8]; 143 - }; 143 + } __attribute__((packed, aligned(4))); 144 144 145 145 /** 146 146 * compress path ioctl definitions
+7 -7
include/uapi/sound/compress_params.h
··· 268 268 __u32 max_bit_rate; 269 269 __u32 min_bit_rate; 270 270 __u32 downmix; 271 - }; 271 + } __attribute__((packed, aligned(4))); 272 272 273 273 274 274 /** ··· 284 284 __u32 quant_bits; 285 285 __u32 start_region; 286 286 __u32 num_regions; 287 - }; 287 + } __attribute__((packed, aligned(4))); 288 288 289 289 /** 290 290 * struct snd_enc_flac ··· 308 308 struct snd_enc_flac { 309 309 __u32 num; 310 310 __u32 gain; 311 - }; 311 + } __attribute__((packed, aligned(4))); 312 312 313 313 struct snd_enc_generic { 314 314 __u32 bw; /* encoder bandwidth */ 315 315 __s32 reserved[15]; 316 - }; 316 + } __attribute__((packed, aligned(4))); 317 317 318 318 union snd_codec_options { 319 319 struct snd_enc_wma wma; ··· 321 321 struct snd_enc_real real; 322 322 struct snd_enc_flac flac; 323 323 struct snd_enc_generic generic; 324 - }; 324 + } __attribute__((packed, aligned(4))); 325 325 326 326 /** struct snd_codec_desc - description of codec capabilities 327 327 * @max_ch: Maximum number of audio channels ··· 358 358 __u32 formats; 359 359 __u32 min_buffer; 360 360 __u32 reserved[15]; 361 - }; 361 + } __attribute__((packed, aligned(4))); 362 362 363 363 /** struct snd_codec 364 364 * @id: Identifies the supported audio encoder/decoder. ··· 399 399 __u32 align; 400 400 union snd_codec_options options; 401 401 __u32 reserved[3]; 402 - }; 402 + } __attribute__((packed, aligned(4))); 403 403 404 404 #endif
+1
sound/pci/hda/hda_auto_parser.c
··· 898 898 if (!strcmp(codec->modelname, models->name)) { 899 899 codec->fixup_id = models->id; 900 900 codec->fixup_name = models->name; 901 + codec->fixup_list = fixlist; 901 902 codec->fixup_forced = 1; 902 903 return; 903 904 }
+58 -7
sound/pci/hda/hda_intel.c
··· 288 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 + 300 + struct 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 309 #ifdef CONFIG_X86 292 310 static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) 293 311 { ··· 598 580 #define azx_del_card_list(chip) /* NOP */ 599 581 #endif /* CONFIG_PM */ 600 582 583 + static void haswell_save_bclk(struct azx *chip) 584 + { 585 + struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 586 + 587 + hda->bclk_m = azx_readw(chip, EM4); 588 + hda->bclk_n = azx_readw(chip, EM5); 589 + } 590 + 591 + static void haswell_restore_bclk(struct azx *chip) 592 + { 593 + struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 594 + 595 + azx_writew(chip, EM4, hda->bclk_m); 596 + azx_writew(chip, EM5, hda->bclk_n); 597 + } 598 + 601 599 #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) 602 600 /* 603 601 * power management ··· 640 606 free_irq(chip->irq, chip); 641 607 chip->irq = -1; 642 608 } 609 + 610 + /* Save BCLK M/N values before they become invalid in D3. 611 + * Will test if display power well can be released now. 612 + */ 613 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 614 + haswell_save_bclk(chip); 615 + 643 616 if (chip->msi) 644 617 pci_disable_msi(chip->pci); 645 618 pci_disable_device(pci); ··· 666 625 if (chip->disabled) 667 626 return 0; 668 627 669 - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 628 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 670 629 hda_display_power(true); 630 + haswell_restore_bclk(chip); 631 + } 671 632 pci_set_power_state(pci, PCI_D0); 672 633 pci_restore_state(pci); 673 634 if (pci_enable_device(pci) < 0) { ··· 713 670 azx_stop_chip(chip); 714 671 azx_enter_link_reset(chip); 715 672 azx_clear_irq_pending(chip); 716 - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 673 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 674 + haswell_save_bclk(chip); 717 675 hda_display_power(false); 676 + } 718 677 return 0; 719 678 } 720 679 ··· 734 689 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 735 690 return 0; 736 691 737 - if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 692 + if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 738 693 hda_display_power(true); 694 + haswell_restore_bclk(chip); 695 + } 739 696 740 697 /* Read STATESTS before controller reset */ 741 698 status = azx_readw(chip, STATESTS); ··· 930 883 static int azx_free(struct azx *chip) 931 884 { 932 885 struct pci_dev *pci = chip->pci; 886 + struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 887 + 933 888 int i; 934 889 935 890 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) ··· 979 930 hda_display_power(false); 980 931 hda_i915_exit(); 981 932 } 982 - kfree(chip); 933 + kfree(hda); 983 934 984 935 return 0; 985 936 } ··· 1223 1174 static struct snd_device_ops ops = { 1224 1175 .dev_free = azx_dev_free, 1225 1176 }; 1177 + struct hda_intel *hda; 1226 1178 struct azx *chip; 1227 1179 int err; 1228 1180 ··· 1233 1183 if (err < 0) 1234 1184 return err; 1235 1185 1236 - chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1237 - if (!chip) { 1238 - dev_err(card->dev, "Cannot allocate chip\n"); 1186 + hda = kzalloc(sizeof(*hda), GFP_KERNEL); 1187 + if (!hda) { 1188 + dev_err(card->dev, "Cannot allocate hda\n"); 1239 1189 pci_disable_device(pci); 1240 1190 return -ENOMEM; 1241 1191 } 1242 1192 1193 + chip = &hda->chip; 1243 1194 spin_lock_init(&chip->reg_lock); 1244 1195 mutex_init(&chip->open_mutex); 1245 1196 chip->card = card;
+21
sound/pci/hda/hda_local.h
··· 417 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 441 /* fixup types */ 421 442 enum { 422 443 HDA_FIXUP_INVALID,
+1 -1
sound/pci/hda/patch_hdmi.c
··· 2204 2204 struct hdmi_spec *spec = codec->spec; 2205 2205 int pin_idx; 2206 2206 2207 - generic_hdmi_init(codec); 2207 + codec->patch_ops.init(codec); 2208 2208 snd_hda_codec_resume_amp(codec); 2209 2209 snd_hda_codec_resume_cache(codec); 2210 2210
+183 -306
sound/pci/hda/patch_realtek.c
··· 4962 4962 }; 4963 4963 4964 4964 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 4965 - { 4966 - .codec = 0x10ec0255, 4967 - .subvendor = 0x1028, 4968 - #ifdef CONFIG_SND_DEBUG_VERBOSE 4969 - .name = "Dell", 4970 - #endif 4971 - .pins = (const struct hda_pintbl[]) { 4972 - {0x12, 0x90a60140}, 4973 - {0x14, 0x90170110}, 4974 - {0x17, 0x40000000}, 4975 - {0x18, 0x411111f0}, 4976 - {0x19, 0x411111f0}, 4977 - {0x1a, 0x411111f0}, 4978 - {0x1b, 0x411111f0}, 4979 - {0x1d, 0x40700001}, 4980 - {0x1e, 0x411111f0}, 4981 - {0x21, 0x02211020}, 4982 - }, 4983 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4984 - }, 4985 - { 4986 - .codec = 0x10ec0255, 4987 - .subvendor = 0x1028, 4988 - #ifdef CONFIG_SND_DEBUG_VERBOSE 4989 - .name = "Dell", 4990 - #endif 4991 - .pins = (const struct hda_pintbl[]) { 4992 - {0x12, 0x90a60160}, 4993 - {0x14, 0x90170120}, 4994 - {0x17, 0x40000000}, 4995 - {0x18, 0x411111f0}, 4996 - {0x19, 0x411111f0}, 4997 - {0x1a, 0x411111f0}, 4998 - {0x1b, 0x411111f0}, 4999 - {0x1d, 0x40700001}, 5000 - {0x1e, 0x411111f0}, 5001 - {0x21, 0x02211030}, 5002 - }, 5003 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5004 - }, 5005 - { 5006 - .codec = 0x10ec0255, 5007 - .subvendor = 0x1028, 5008 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5009 - .name = "Dell", 5010 - #endif 5011 - .pins = (const struct hda_pintbl[]) { 5012 - {0x12, 0x90a60160}, 5013 - {0x14, 0x90170120}, 5014 - {0x17, 0x90170140}, 5015 - {0x18, 0x40000000}, 5016 - {0x19, 0x411111f0}, 5017 - {0x1a, 0x411111f0}, 5018 - {0x1b, 0x411111f0}, 5019 - {0x1d, 0x41163b05}, 5020 - {0x1e, 0x411111f0}, 5021 - {0x21, 0x0321102f}, 5022 - }, 5023 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5024 - }, 5025 - { 5026 - .codec = 0x10ec0255, 5027 - .subvendor = 0x1028, 5028 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5029 - .name = "Dell", 5030 - #endif 5031 - .pins = (const struct hda_pintbl[]) { 5032 - {0x12, 0x90a60160}, 5033 - {0x14, 0x90170130}, 5034 - {0x17, 0x40000000}, 5035 - {0x18, 0x411111f0}, 5036 - {0x19, 0x411111f0}, 5037 - {0x1a, 0x411111f0}, 5038 - {0x1b, 0x411111f0}, 5039 - {0x1d, 0x40700001}, 5040 - {0x1e, 0x411111f0}, 5041 - {0x21, 0x02211040}, 5042 - }, 5043 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5044 - }, 5045 - { 5046 - .codec = 0x10ec0255, 5047 - .subvendor = 0x1028, 5048 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5049 - .name = "Dell", 5050 - #endif 5051 - .pins = (const struct hda_pintbl[]) { 5052 - {0x12, 0x90a60160}, 5053 - {0x14, 0x90170140}, 5054 - {0x17, 0x40000000}, 5055 - {0x18, 0x411111f0}, 5056 - {0x19, 0x411111f0}, 5057 - {0x1a, 0x411111f0}, 5058 - {0x1b, 0x411111f0}, 5059 - {0x1d, 0x40700001}, 5060 - {0x1e, 0x411111f0}, 5061 - {0x21, 0x02211050}, 5062 - }, 5063 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5064 - }, 5065 - { 5066 - .codec = 0x10ec0255, 5067 - .subvendor = 0x1028, 5068 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5069 - .name = "Dell", 5070 - #endif 5071 - .pins = (const struct hda_pintbl[]) { 5072 - {0x12, 0x90a60170}, 5073 - {0x14, 0x90170120}, 5074 - {0x17, 0x40000000}, 5075 - {0x18, 0x411111f0}, 5076 - {0x19, 0x411111f0}, 5077 - {0x1a, 0x411111f0}, 5078 - {0x1b, 0x411111f0}, 5079 - {0x1d, 0x40700001}, 5080 - {0x1e, 0x411111f0}, 5081 - {0x21, 0x02211030}, 5082 - }, 5083 - .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5084 - }, 5085 - { 5086 - .codec = 0x10ec0255, 5087 - .subvendor = 0x1028, 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 - }, 4965 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4966 + {0x12, 0x90a60140}, 4967 + {0x14, 0x90170110}, 4968 + {0x17, 0x40000000}, 4969 + {0x18, 0x411111f0}, 4970 + {0x19, 0x411111f0}, 4971 + {0x1a, 0x411111f0}, 4972 + {0x1b, 0x411111f0}, 4973 + {0x1d, 0x40700001}, 4974 + {0x1e, 0x411111f0}, 4975 + {0x21, 0x02211020}), 4976 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4977 + {0x12, 0x90a60160}, 4978 + {0x14, 0x90170120}, 4979 + {0x17, 0x40000000}, 4980 + {0x18, 0x411111f0}, 4981 + {0x19, 0x411111f0}, 4982 + {0x1a, 0x411111f0}, 4983 + {0x1b, 0x411111f0}, 4984 + {0x1d, 0x40700001}, 4985 + {0x1e, 0x411111f0}, 4986 + {0x21, 0x02211030}), 4987 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4988 + {0x12, 0x90a60160}, 4989 + {0x14, 0x90170120}, 4990 + {0x17, 0x90170140}, 4991 + {0x18, 0x40000000}, 4992 + {0x19, 0x411111f0}, 4993 + {0x1a, 0x411111f0}, 4994 + {0x1b, 0x411111f0}, 4995 + {0x1d, 0x41163b05}, 4996 + {0x1e, 0x411111f0}, 4997 + {0x21, 0x0321102f}), 4998 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4999 + {0x12, 0x90a60160}, 5000 + {0x14, 0x90170130}, 5001 + {0x17, 0x40000000}, 5002 + {0x18, 0x411111f0}, 5003 + {0x19, 0x411111f0}, 5004 + {0x1a, 0x411111f0}, 5005 + {0x1b, 0x411111f0}, 5006 + {0x1d, 0x40700001}, 5007 + {0x1e, 0x411111f0}, 5008 + {0x21, 0x02211040}), 5009 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5010 + {0x12, 0x90a60160}, 5011 + {0x14, 0x90170140}, 5012 + {0x17, 0x40000000}, 5013 + {0x18, 0x411111f0}, 5014 + {0x19, 0x411111f0}, 5015 + {0x1a, 0x411111f0}, 5016 + {0x1b, 0x411111f0}, 5017 + {0x1d, 0x40700001}, 5018 + {0x1e, 0x411111f0}, 5019 + {0x21, 0x02211050}), 5020 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5021 + {0x12, 0x90a60170}, 5022 + {0x14, 0x90170120}, 5023 + {0x17, 0x40000000}, 5024 + {0x18, 0x411111f0}, 5025 + {0x19, 0x411111f0}, 5026 + {0x1a, 0x411111f0}, 5027 + {0x1b, 0x411111f0}, 5028 + {0x1d, 0x40700001}, 5029 + {0x1e, 0x411111f0}, 5030 + {0x21, 0x02211030}), 5031 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5032 + {0x12, 0x90a60170}, 5033 + {0x14, 0x90170130}, 5034 + {0x17, 0x40000000}, 5035 + {0x18, 0x411111f0}, 5036 + {0x19, 0x411111f0}, 5037 + {0x1a, 0x411111f0}, 5038 + {0x1b, 0x411111f0}, 5039 + {0x1d, 0x40700001}, 5040 + {0x1e, 0x411111f0}, 5041 + {0x21, 0x02211040}), 5042 + SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 5043 + {0x12, 0x90a60130}, 5044 + {0x14, 0x90170110}, 5045 + {0x17, 0x40020008}, 5046 + {0x18, 0x411111f0}, 5047 + {0x19, 0x411111f0}, 5048 + {0x1a, 0x411111f0}, 5049 + {0x1b, 0x411111f0}, 5050 + {0x1d, 0x40e00001}, 5051 + {0x1e, 0x411111f0}, 5052 + {0x21, 0x0321101f}), 5053 + SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 5054 + {0x12, 0x90a60160}, 5055 + {0x14, 0x90170120}, 5056 + {0x17, 0x40000000}, 5057 + {0x18, 0x411111f0}, 5058 + {0x19, 0x411111f0}, 5059 + {0x1a, 0x411111f0}, 5060 + {0x1b, 0x411111f0}, 5061 + {0x1d, 0x40700001}, 5062 + {0x1e, 0x411111f0}, 5063 + {0x21, 0x02211030}), 5064 + SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 5065 + {0x12, 0x90a60140}, 5066 + {0x13, 0x411111f0}, 5067 + {0x14, 0x90170110}, 5068 + {0x15, 0x0221401f}, 5069 + {0x16, 0x411111f0}, 5070 + {0x18, 0x411111f0}, 5071 + {0x19, 0x411111f0}, 5072 + {0x1a, 0x411111f0}, 5073 + {0x1b, 0x411111f0}, 5074 + {0x1d, 0x40700001}, 5075 + {0x1e, 0x411111f0}), 5076 + SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 5077 + {0x12, 0x40000000}, 5078 + {0x13, 0x90a60140}, 5079 + {0x14, 0x90170110}, 5080 + {0x15, 0x0221401f}, 5081 + {0x16, 0x21014020}, 5082 + {0x18, 0x411111f0}, 5083 + {0x19, 0x21a19030}, 5084 + {0x1a, 0x411111f0}, 5085 + {0x1b, 0x411111f0}, 5086 + {0x1d, 0x40700001}, 5087 + {0x1e, 0x411111f0}), 5187 5088 {} 5188 5089 }; 5189 5090 ··· 5940 6039 }; 5941 6040 5942 6041 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 5943 - { 5944 - .codec = 0x10ec0668, 5945 - .subvendor = 0x1028, 5946 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5947 - .name = "Dell", 5948 - #endif 5949 - .pins = (const struct hda_pintbl[]) { 5950 - {0x12, 0x99a30130}, 5951 - {0x14, 0x90170110}, 5952 - {0x15, 0x0321101f}, 5953 - {0x16, 0x03011020}, 5954 - {0x18, 0x40000008}, 5955 - {0x19, 0x411111f0}, 5956 - {0x1a, 0x411111f0}, 5957 - {0x1b, 0x411111f0}, 5958 - {0x1d, 0x41000001}, 5959 - {0x1e, 0x411111f0}, 5960 - {0x1f, 0x411111f0}, 5961 - }, 5962 - .value = ALC668_FIXUP_AUTO_MUTE, 5963 - }, 5964 - { 5965 - .codec = 0x10ec0668, 5966 - .subvendor = 0x1028, 5967 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5968 - .name = "Dell", 5969 - #endif 5970 - .pins = (const struct hda_pintbl[]) { 5971 - {0x12, 0x99a30140}, 5972 - {0x14, 0x90170110}, 5973 - {0x15, 0x0321101f}, 5974 - {0x16, 0x03011020}, 5975 - {0x18, 0x40000008}, 5976 - {0x19, 0x411111f0}, 5977 - {0x1a, 0x411111f0}, 5978 - {0x1b, 0x411111f0}, 5979 - {0x1d, 0x41000001}, 5980 - {0x1e, 0x411111f0}, 5981 - {0x1f, 0x411111f0}, 5982 - }, 5983 - .value = ALC668_FIXUP_AUTO_MUTE, 5984 - }, 5985 - { 5986 - .codec = 0x10ec0668, 5987 - .subvendor = 0x1028, 5988 - #ifdef CONFIG_SND_DEBUG_VERBOSE 5989 - .name = "Dell", 5990 - #endif 5991 - .pins = (const struct hda_pintbl[]) { 5992 - {0x12, 0x99a30150}, 5993 - {0x14, 0x90170110}, 5994 - {0x15, 0x0321101f}, 5995 - {0x16, 0x03011020}, 5996 - {0x18, 0x40000008}, 5997 - {0x19, 0x411111f0}, 5998 - {0x1a, 0x411111f0}, 5999 - {0x1b, 0x411111f0}, 6000 - {0x1d, 0x41000001}, 6001 - {0x1e, 0x411111f0}, 6002 - {0x1f, 0x411111f0}, 6003 - }, 6004 - .value = ALC668_FIXUP_AUTO_MUTE, 6005 - }, 6006 - { 6007 - .codec = 0x10ec0668, 6008 - .subvendor = 0x1028, 6009 - #ifdef CONFIG_SND_DEBUG_VERBOSE 6010 - .name = "Dell", 6011 - #endif 6012 - .pins = (const struct hda_pintbl[]) { 6013 - {0x12, 0x411111f0}, 6014 - {0x14, 0x90170110}, 6015 - {0x15, 0x0321101f}, 6016 - {0x16, 0x03011020}, 6017 - {0x18, 0x40000008}, 6018 - {0x19, 0x411111f0}, 6019 - {0x1a, 0x411111f0}, 6020 - {0x1b, 0x411111f0}, 6021 - {0x1d, 0x41000001}, 6022 - {0x1e, 0x411111f0}, 6023 - {0x1f, 0x411111f0}, 6024 - }, 6025 - .value = ALC668_FIXUP_AUTO_MUTE, 6026 - }, 6042 + SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 6043 + {0x12, 0x99a30130}, 6044 + {0x14, 0x90170110}, 6045 + {0x15, 0x0321101f}, 6046 + {0x16, 0x03011020}, 6047 + {0x18, 0x40000008}, 6048 + {0x19, 0x411111f0}, 6049 + {0x1a, 0x411111f0}, 6050 + {0x1b, 0x411111f0}, 6051 + {0x1d, 0x41000001}, 6052 + {0x1e, 0x411111f0}, 6053 + {0x1f, 0x411111f0}), 6054 + SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 6055 + {0x12, 0x99a30140}, 6056 + {0x14, 0x90170110}, 6057 + {0x15, 0x0321101f}, 6058 + {0x16, 0x03011020}, 6059 + {0x18, 0x40000008}, 6060 + {0x19, 0x411111f0}, 6061 + {0x1a, 0x411111f0}, 6062 + {0x1b, 0x411111f0}, 6063 + {0x1d, 0x41000001}, 6064 + {0x1e, 0x411111f0}, 6065 + {0x1f, 0x411111f0}), 6066 + SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 6067 + {0x12, 0x99a30150}, 6068 + {0x14, 0x90170110}, 6069 + {0x15, 0x0321101f}, 6070 + {0x16, 0x03011020}, 6071 + {0x18, 0x40000008}, 6072 + {0x19, 0x411111f0}, 6073 + {0x1a, 0x411111f0}, 6074 + {0x1b, 0x411111f0}, 6075 + {0x1d, 0x41000001}, 6076 + {0x1e, 0x411111f0}, 6077 + {0x1f, 0x411111f0}), 6078 + SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 6079 + {0x12, 0x411111f0}, 6080 + {0x14, 0x90170110}, 6081 + {0x15, 0x0321101f}, 6082 + {0x16, 0x03011020}, 6083 + {0x18, 0x40000008}, 6084 + {0x19, 0x411111f0}, 6085 + {0x1a, 0x411111f0}, 6086 + {0x1b, 0x411111f0}, 6087 + {0x1d, 0x41000001}, 6088 + {0x1e, 0x411111f0}, 6089 + {0x1f, 0x411111f0}), 6090 + SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, 6091 + {0x12, 0x90a60130}, 6092 + {0x14, 0x90170110}, 6093 + {0x15, 0x0321101f}, 6094 + {0x16, 0x40000000}, 6095 + {0x18, 0x411111f0}, 6096 + {0x19, 0x411111f0}, 6097 + {0x1a, 0x411111f0}, 6098 + {0x1b, 0x411111f0}, 6099 + {0x1d, 0x40d6832d}, 6100 + {0x1e, 0x411111f0}, 6101 + {0x1f, 0x411111f0}), 6027 6102 {} 6028 6103 }; 6029 6104
+57 -1
sound/pci/hda/patch_sigmatel.c
··· 122 122 }; 123 123 124 124 enum { 125 + STAC_92HD95_HP_LED, 126 + STAC_92HD95_HP_BASS, 127 + STAC_92HD95_MODELS 128 + }; 129 + 130 + enum { 125 131 STAC_925x_REF, 126 132 STAC_M1, 127 133 STAC_M1_2, ··· 4134 4128 {} /* terminator */ 4135 4129 }; 4136 4130 4131 + static void stac92hd95_fixup_hp_led(struct hda_codec *codec, 4132 + const struct hda_fixup *fix, int action) 4133 + { 4134 + struct sigmatel_spec *spec = codec->spec; 4135 + 4136 + if (action != HDA_FIXUP_ACT_PRE_PROBE) 4137 + return; 4138 + 4139 + if (find_mute_led_cfg(codec, spec->default_polarity)) 4140 + codec_dbg(codec, "mute LED gpio %d polarity %d\n", 4141 + spec->gpio_led, 4142 + spec->gpio_led_polarity); 4143 + } 4144 + 4145 + static const struct hda_fixup stac92hd95_fixups[] = { 4146 + [STAC_92HD95_HP_LED] = { 4147 + .type = HDA_FIXUP_FUNC, 4148 + .v.func = stac92hd95_fixup_hp_led, 4149 + }, 4150 + [STAC_92HD95_HP_BASS] = { 4151 + .type = HDA_FIXUP_VERBS, 4152 + .v.verbs = (const struct hda_verb[]) { 4153 + {0x1a, 0x795, 0x00}, /* HPF to 100Hz */ 4154 + {} 4155 + }, 4156 + .chained = true, 4157 + .chain_id = STAC_92HD95_HP_LED, 4158 + }, 4159 + }; 4160 + 4161 + static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = { 4162 + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS), 4163 + {} /* terminator */ 4164 + }; 4165 + 4166 + static const struct hda_model_fixup stac92hd95_models[] = { 4167 + { .id = STAC_92HD95_HP_LED, .name = "hp-led" }, 4168 + { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" }, 4169 + {} 4170 + }; 4171 + 4172 + 4137 4173 static int stac_parse_auto_config(struct hda_codec *codec) 4138 4174 { 4139 4175 struct sigmatel_spec *spec = codec->spec; ··· 4628 4580 spec->gen.beep_nid = 0x19; /* digital beep */ 4629 4581 spec->pwr_nids = stac92hd95_pwr_nids; 4630 4582 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); 4631 - spec->default_polarity = -1; /* no default cfg */ 4583 + spec->default_polarity = 0; 4632 4584 4633 4585 codec->patch_ops = stac_patch_ops; 4586 + 4587 + snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, 4588 + stac92hd95_fixups); 4589 + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 4590 + 4591 + stac_setup_gpio(codec); 4634 4592 4635 4593 err = stac_parse_auto_config(codec); 4636 4594 if (err < 0) { ··· 4645 4591 } 4646 4592 4647 4593 codec->proc_widget_hook = stac92hd_proc_hook; 4594 + 4595 + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 4648 4596 4649 4597 return 0; 4650 4598 }
+10 -3
sound/usb/card.c
··· 307 307 308 308 static 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 315 mutex_destroy(&chip->mutex); 311 316 kfree(chip); 312 317 return 0; ··· 590 585 struct snd_usb_audio *chip) 591 586 { 592 587 struct snd_card *card; 593 - struct list_head *p, *n; 588 + struct list_head *p; 594 589 595 590 if (chip == (void *)-1L) 596 591 return; ··· 603 598 mutex_lock(&register_mutex); 604 599 chip->num_interfaces--; 605 600 if (chip->num_interfaces <= 0) { 601 + struct snd_usb_endpoint *ep; 602 + 606 603 snd_card_disconnect(card); 607 604 /* release the pcm resources */ 608 605 list_for_each(p, &chip->pcm_list) { 609 606 snd_usb_stream_disconnect(p); 610 607 } 611 608 /* release the endpoint resources */ 612 - list_for_each_safe(p, n, &chip->ep_list) { 613 - snd_usb_endpoint_free(p); 609 + list_for_each_entry(ep, &chip->ep_list, list) { 610 + snd_usb_endpoint_release(ep); 614 611 } 615 612 /* release the midi resources */ 616 613 list_for_each(p, &chip->midi_list) {
+14 -3
sound/usb/endpoint.c
··· 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 + */ 997 + void snd_usb_endpoint_release(struct snd_usb_endpoint *ep) 998 + { 999 + release_urbs(ep, 1); 1000 + } 1001 + 1002 + /** 990 1003 * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint 991 1004 * 992 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 995 - * down all the streaming URBs immediately and free all resources. 1007 + * This free all resources of the given ep. 996 1008 */ 997 1009 void snd_usb_endpoint_free(struct list_head *head) 998 1010 { 999 1011 struct snd_usb_endpoint *ep; 1000 1012 1001 1013 ep = list_entry(head, struct snd_usb_endpoint, list); 1002 - release_urbs(ep, 1); 1003 1014 kfree(ep); 1004 1015 } 1005 1016
+1
sound/usb/endpoint.h
··· 23 23 void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); 24 24 int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); 25 25 void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); 26 + void snd_usb_endpoint_release(struct snd_usb_endpoint *ep); 26 27 void snd_usb_endpoint_free(struct list_head *head); 27 28 28 29 int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);