Changeset 711
- Timestamp:
- Aug 5, 2022, 4:38:17 AM (3 years ago)
- Location:
- GPL/branches/uniaud32-next
- Files:
-
- 62 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/alsa-kernel/core/init.c
r710 r711 214 214 * is added automatically. In that way, the resource disconnection is assured 215 215 * at first, then released in the expected order. 216 * 217 * If an error happens at the probe before snd_card_register() is called and 218 * there have been other devres resources, you'd need to free the card manually 219 * via snd_card_free() call in the error; otherwise it may lead to UAF due to 220 * devres call orders. You can use snd_card_free_on_error() helper for 221 * handling it more easily. 216 222 */ 217 223 int snd_devm_card_new(struct device *parent, int idx, const char *xid, … … 239 245 } 240 246 EXPORT_SYMBOL_GPL(snd_devm_card_new); 247 248 /** 249 * snd_card_free_on_error - a small helper for handling devm probe errors 250 * @dev: the managed device object 251 * @ret: the return code from the probe callback 252 * 253 * This function handles the explicit snd_card_free() call at the error from 254 * the probe callback. It's just a small helper for simplifying the error 255 * handling with the managed devices. 256 */ 257 int snd_card_free_on_error(struct device *dev, int ret) 258 { 259 struct snd_card *card; 260 261 if (!ret) 262 return 0; 263 card = devres_find(dev, __snd_card_release, NULL, NULL); 264 if (card) 265 snd_card_free(card); 266 return ret; 267 } 268 EXPORT_SYMBOL_GPL(snd_card_free_on_error); 241 269 242 270 static int snd_card_init(struct snd_card *card, struct device *parent, -
GPL/branches/uniaud32-next/alsa-kernel/core/jack.c
r693 r711 43 43 struct snd_jack *jack = device->device_data; 44 44 45 if (!jack->input_dev) 45 mutex_lock(&jack->input_dev_lock); 46 if (!jack->input_dev) { 47 mutex_unlock(&jack->input_dev_lock); 46 48 return 0; 49 } 47 50 48 51 /* If the input device is registered with the input subsystem … … 53 56 input_free_device(jack->input_dev); 54 57 jack->input_dev = NULL; 58 mutex_unlock(&jack->input_dev_lock); 55 59 #endif /* CONFIG_SND_JACK_INPUT_DEV */ 56 60 return 0; … … 63 67 struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl; 64 68 69 down_write(&card->controls_rwsem); 65 70 list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list, struct snd_jack_kctl) { 66 71 list_del_init(&jack_kctl->list); 67 72 snd_ctl_remove(card, jack_kctl->kctl); 68 73 } 74 up_write(&card->controls_rwsem); 75 69 76 if (jack->private_free) 70 77 jack->private_free(jack); … … 88 95 card->shortname, jack->id); 89 96 90 if (!jack->input_dev) 97 mutex_lock(&jack->input_dev_lock); 98 if (!jack->input_dev) { 99 mutex_unlock(&jack->input_dev_lock); 91 100 return 0; 101 } 92 102 93 103 jack->input_dev->name = jack->name; … … 114 124 jack->registered = 1; 115 125 126 mutex_unlock(&jack->input_dev_lock); 116 127 return err; 117 128 } … … 510 521 511 522 jack->id = kstrdup(id, GFP_KERNEL); 512 513 /* don't creat input device for phantom jack */ 523 if (jack->id == NULL) { 524 kfree(jack); 525 return -ENOMEM; 526 } 527 528 #ifdef CONFIG_SND_JACK_INPUT_DEV 529 mutex_init(&jack->input_dev_lock); 530 531 /* don't create input device for phantom jack */ 514 532 if (!phantom_jack) { 515 #ifdef CONFIG_SND_JACK_INPUT_DEV516 533 int i; 517 534 … … 531 548 jack_switch_types[i]); 532 549 550 } 533 551 #endif /* CONFIG_SND_JACK_INPUT_DEV */ 534 }535 552 536 553 err = snd_device_new(card, SNDRV_DEV_JACK, jack, &ops); … … 572 589 { 573 590 WARN_ON(jack->registered); 574 if (!jack->input_dev) 591 mutex_lock(&jack->input_dev_lock); 592 if (!jack->input_dev) { 593 mutex_unlock(&jack->input_dev_lock); 575 594 return; 595 } 576 596 577 597 jack->input_dev->dev.parent = parent; 598 mutex_unlock(&jack->input_dev_lock); 578 599 } 579 600 EXPORT_SYMBOL(snd_jack_set_parent); … … 623 644 /** 624 645 * snd_jack_report - Report the current status of a jack 646 * Note: This function uses mutexes and should be called from a 647 * context which can sleep (such as a workqueue). 625 648 * 626 649 * @jack: The jack to report status for … … 648 671 649 672 #ifdef CONFIG_SND_JACK_INPUT_DEV 650 if (!jack->input_dev) 673 mutex_lock(&jack->input_dev_lock); 674 if (!jack->input_dev) { 675 mutex_unlock(&jack->input_dev_lock); 651 676 return; 677 } 652 678 653 679 for (i = 0; i < ARRAY_SIZE(jack->key); i++) { … … 669 695 670 696 input_sync(jack->input_dev); 697 mutex_unlock(&jack->input_dev_lock); 671 698 #endif /* CONFIG_SND_JACK_INPUT_DEV */ 672 699 } -
GPL/branches/uniaud32-next/alsa-kernel/core/misc.c
r629 r711 113 113 const struct snd_pci_quirk *q; 114 114 115 for (q = list; q->subvendor ; q++) {115 for (q = list; q->subvendor || q->subdevice; q++) { 116 116 if (q->subvendor != vendor) 117 117 continue; -
GPL/branches/uniaud32-next/alsa-kernel/core/oss/pcm_oss.c
r697 r711 152 152 * Return the maximum value for field PAR. 153 153 */ 154 static unsignedint154 static int 155 155 snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, 156 156 snd_pcm_hw_param_t var, int *dir) … … 691 691 struct snd_pcm_hw_params *slave_params) 692 692 { 693 size_t s; 694 size_t oss_buffer_size, oss_period_size, oss_periods; 695 size_t min_period_size, max_period_size; 693 ssize_t s; 694 ssize_t oss_buffer_size; 695 ssize_t oss_period_size, oss_periods; 696 ssize_t min_period_size, max_period_size; 696 697 struct snd_pcm_runtime *runtime = substream->runtime; 697 698 size_t oss_frame_size; … … 700 701 params_channels(oss_params) / 8; 701 702 703 oss_buffer_size = snd_pcm_hw_param_value_max(slave_params, 704 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 705 NULL); 706 if (oss_buffer_size <= 0) 707 return -EINVAL; 702 708 oss_buffer_size = snd_pcm_plug_client_size(substream, 703 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size;704 if ( !oss_buffer_size)709 oss_buffer_size * oss_frame_size); 710 if (oss_buffer_size <= 0) 705 711 return -EINVAL; 706 712 oss_buffer_size = rounddown_pow_of_two(oss_buffer_size); … … 739 745 min_period_size = snd_pcm_plug_client_size(substream, 740 746 snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 741 if (min_period_size ) {747 if (min_period_size > 0) { 742 748 min_period_size *= oss_frame_size; 743 749 min_period_size = roundup_pow_of_two(min_period_size); … … 748 754 max_period_size = snd_pcm_plug_client_size(substream, 749 755 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 750 if (max_period_size ) {756 if (max_period_size > 0) { 751 757 max_period_size *= oss_frame_size; 752 758 max_period_size = rounddown_pow_of_two(max_period_size); … … 762 768 763 769 s = snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, NULL); 764 if ( runtime->oss.maxfrags && s > runtime->oss.maxfrags)770 if (s > 0 && runtime->oss.maxfrags && s > runtime->oss.maxfrags) 765 771 s = runtime->oss.maxfrags; 766 772 if (oss_periods > s) … … 778 784 if (oss_period_size < 16) 779 785 return -EINVAL; 786 787 /* don't allocate too large period; 1MB period must be enough */ 788 if (oss_period_size > 1024 * 1024) 789 return -ENOMEM; 790 780 791 runtime->oss.period_bytes = oss_period_size; 781 792 runtime->oss.period_frames = 1; … … 888 899 goto failure; 889 900 } 890 choose_rate(substream, sparams, runtime->oss.rate); 891 snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL); 901 902 err = choose_rate(substream, sparams, runtime->oss.rate); 903 if (err < 0) 904 goto failure; 905 err = snd_pcm_hw_param_near(substream, sparams, 906 SNDRV_PCM_HW_PARAM_CHANNELS, 907 runtime->oss.channels, NULL); 908 if (err < 0) 909 goto failure; 892 910 893 911 format = snd_pcm_oss_format_from(runtime->oss.format); … … 1040 1058 } 1041 1059 #endif 1042 oss_period_size *= oss_frame_size; 1043 1044 oss_buffer_size = oss_period_size * runtime->oss.periods; 1045 if (oss_buffer_size < 0) { 1060 oss_period_size = array_size(oss_period_size, oss_frame_size); 1061 oss_buffer_size = array_size(oss_period_size, runtime->oss.periods); 1062 if (oss_buffer_size <= 0) { 1046 1063 err = -EINVAL; 1047 1064 goto failure; … … 1970 1987 return -EINVAL; 1971 1988 fragshift = val & 0xffff; 1972 if (fragshift >= 31)1989 if (fragshift >= 25) /* should be large enough */ 1973 1990 return -EINVAL; 1974 1991 runtime->oss.fragshift = fragshift; … … 2066 2083 2067 2084 #ifdef OSS_DEBUG 2068 p cm_dbg(substream->pcm,"pcm_oss: trigger = 0x%x\n", trigger);2085 pr_debug("pcm_oss: trigger = 0x%x\n", trigger); 2069 2086 #endif 2070 2087 -
GPL/branches/uniaud32-next/alsa-kernel/core/pcm.c
r697 r711 818 818 { 819 819 if (pstr->chmap_kctl) { 820 snd_ctl_remove(pstr->pcm->card, pstr->chmap_kctl); 820 struct snd_card *card = pstr->pcm->card; 821 822 down_write(&card->controls_rwsem); 823 snd_ctl_remove(card, pstr->chmap_kctl); 824 up_write(&card->controls_rwsem); 821 825 pstr->chmap_kctl = NULL; 822 826 } … … 973 977 974 978 runtime->status->state = SNDRV_PCM_STATE_OPEN; 979 mutex_init(&runtime->buffer_mutex); 980 atomic_set(&runtime->buffer_accessing, 0); 975 981 976 982 substream->runtime = runtime; … … 1006 1012 substream->runtime = NULL; 1007 1013 } 1014 mutex_destroy(&runtime->buffer_mutex); 1008 1015 kfree(runtime); 1009 1016 put_pid(substream->pid); -
GPL/branches/uniaud32-next/alsa-kernel/core/pcm_lib.c
r697 r711 2303 2303 goto _end_unlock; 2304 2304 } 2305 #ifndef TARGET_OS2 2306 if (!atomic_inc_unless_negative(&runtime->buffer_accessing)) { 2307 err = -EBUSY; 2308 goto _end_unlock; 2309 } 2310 #endif 2305 2311 snd_pcm_stream_unlock_irq(substream); 2306 2312 err = writer(substream, appl_ofs, data, offset, frames, 2307 2313 transfer); 2308 2314 snd_pcm_stream_lock_irq(substream); 2315 #ifndef TARGET_OS2 2316 atomic_dec(&runtime->buffer_accessing); 2317 #endif 2309 2318 if (err < 0) 2310 2319 goto _end_unlock; -
GPL/branches/uniaud32-next/alsa-kernel/core/pcm_memory.c
r710 r711 159 159 struct snd_dma_buffer new_dmab; 160 160 161 mutex_lock(&substream->pcm->open_mutex); 161 162 if (substream->runtime) { 162 163 buffer->error = -EBUSY; 163 return;164 goto unlock; 164 165 } 165 166 if (!snd_info_get_line(buffer, line, sizeof(line))) { … … 168 169 if ((size != 0 && size < 8192) || size > substream->dma_max) { 169 170 buffer->error = -EINVAL; 170 return;171 goto unlock; 171 172 } 172 173 if (substream->dma_buffer.bytes == size) 173 return;174 goto unlock; 174 175 memset(&new_dmab, 0, sizeof(new_dmab)); 175 176 new_dmab.dev = substream->dma_buffer.dev; … … 184 185 substream->stream ? 'c' : 'p', substream->number, 185 186 substream->pcm->name, size); 186 return;187 goto unlock; 187 188 } 188 189 substream->buffer_bytes_max = size; … … 196 197 buffer->error = -EINVAL; 197 198 } 199 unlock: 200 mutex_unlock(&substream->pcm->open_mutex); 198 201 } 199 202 … … 444 447 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) 445 448 { 446 struct snd_card *card = substream->pcm->card;447 449 struct snd_pcm_runtime *runtime; 448 450 … … 453 455 return 0; 454 456 if (runtime->dma_buffer_p != &substream->dma_buffer) { 457 struct snd_card *card = substream->pcm->card; 458 455 459 /* it's a newly allocated buffer. release it now. */ 456 460 do_free_pages(card, runtime->dma_buffer_p); -
GPL/branches/uniaud32-next/alsa-kernel/core/pcm_misc.c
r697 r711 434 434 width = pcm_formats[(INT)format].phys; /* physical width */ 435 435 pat = pcm_formats[(INT)format].silence; 436 if (! width)436 if (!width || !pat) 437 437 return -EINVAL; 438 438 /* signed or 1 byte data */ -
GPL/branches/uniaud32-next/alsa-kernel/core/pcm_native.c
r710 r711 677 677 } 678 678 679 #ifndef TARGET_OS2 680 /* acquire buffer_mutex; if it's in r/w operation, return -EBUSY, otherwise 681 * block the further r/w operations 682 */ 683 static int snd_pcm_buffer_access_lock(struct snd_pcm_runtime *runtime) 684 { 685 if (!atomic_dec_unless_positive(&runtime->buffer_accessing)) 686 return -EBUSY; 687 mutex_lock(&runtime->buffer_mutex); 688 return 0; /* keep buffer_mutex, unlocked by below */ 689 } 690 #endif 691 692 /* release buffer_mutex and clear r/w access flag */ 693 static void snd_pcm_buffer_access_unlock(struct snd_pcm_runtime *runtime) 694 { 695 mutex_unlock(&runtime->buffer_mutex); 696 atomic_inc(&runtime->buffer_accessing); 697 } 698 699 #if IS_ENABLED(CONFIG_SND_PCM_OSS) 700 #define is_oss_stream(substream) ((substream)->oss.oss) 701 #else 702 #define is_oss_stream(substream) false 703 #endif 704 679 705 static int snd_pcm_hw_params(struct snd_pcm_substream *substream, 680 706 struct snd_pcm_hw_params *params) … … 688 714 return -ENXIO; 689 715 runtime = substream->runtime; 716 #ifndef TARGET_OS2 717 err = snd_pcm_buffer_access_lock(runtime); 718 if (err < 0) 719 return err; 720 #endif 690 721 snd_pcm_stream_lock_irq(substream); 691 722 switch (runtime->status->state) { … … 693 724 case SNDRV_PCM_STATE_SETUP: 694 725 case SNDRV_PCM_STATE_PREPARED: 726 if (!is_oss_stream(substream) && 727 atomic_read(&substream->mmap_count)) 728 err = -EBADFD; 695 729 break; 696 730 default: 697 snd_pcm_stream_unlock_irq(substream);698 return -EBADFD;731 err = -EBADFD; 732 break; 699 733 } 700 734 snd_pcm_stream_unlock_irq(substream); 701 #if IS_ENABLED(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS) 702 if (!substream->oss.oss) 703 #endif 704 if (atomic_read(&substream->mmap_count)) 705 return -EBADFD; 735 if (err) 736 goto unlock; 706 737 707 738 snd_pcm_sync_stop(substream, true); … … 791 822 cpu_latency_qos_add_request(&substream->latency_pm_qos_req, 792 823 usecs); 793 return0;824 err = 0; 794 825 _error: 795 /* hardware might be unusable from this time, 796 so we force application to retry to set 797 the correct hardware parameter settings */ 798 snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); 799 if (substream->ops->hw_free != NULL) 800 substream->ops->hw_free(substream); 801 if (substream->managed_buffer_alloc) 802 snd_pcm_lib_free_pages(substream); 826 if (err) { 827 /* hardware might be unusable from this time, 828 * so we force application to retry to set 829 * the correct hardware parameter settings 830 */ 831 snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); 832 if (substream->ops->hw_free != NULL) 833 substream->ops->hw_free(substream); 834 if (substream->managed_buffer_alloc) 835 snd_pcm_lib_free_pages(substream); 836 } 837 unlock: 838 snd_pcm_buffer_access_unlock(runtime); 803 839 return err; 804 840 } … … 840 876 { 841 877 struct snd_pcm_runtime *runtime; 842 int result ;878 int result = 0; 843 879 844 880 if (PCM_RUNTIME_CHECK(substream)) 845 881 return -ENXIO; 846 882 runtime = substream->runtime; 883 #ifndef TARGET_OS2 884 result = snd_pcm_buffer_access_lock(runtime); 885 if (result < 0) 886 return result; 887 #endif 847 888 snd_pcm_stream_lock_irq(substream); 848 889 switch (runtime->status->state) { 849 890 case SNDRV_PCM_STATE_SETUP: 850 891 case SNDRV_PCM_STATE_PREPARED: 892 if (atomic_read(&substream->mmap_count)) 893 result = -EBADFD; 851 894 break; 852 895 default: 853 snd_pcm_stream_unlock_irq(substream);854 return -EBADFD;896 result = -EBADFD; 897 break; 855 898 } 856 899 snd_pcm_stream_unlock_irq(substream); 857 if ( atomic_read(&substream->mmap_count))858 return -EBADFD;900 if (result) 901 goto unlock; 859 902 result = do_hw_free(substream); 860 903 snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); 861 904 cpu_latency_qos_remove_request(&substream->latency_pm_qos_req); 905 unlock: 906 snd_pcm_buffer_access_unlock(runtime); 862 907 return result; 863 908 } … … 1186 1231 struct snd_pcm_substream *substream, 1187 1232 snd_pcm_state_t state, 1188 bool do_lock)1233 bool stream_lock) 1189 1234 { 1190 1235 struct snd_pcm_substream *s = NULL; … … 1193 1238 1194 1239 snd_pcm_group_for_each_entry(s, substream) { 1195 if (do_lock && s != substream) { 1196 if (s->pcm->nonatomic) 1240 if (s != substream) { 1241 if (!stream_lock) 1242 mutex_lock_nested(&s->runtime->buffer_mutex, depth); 1243 else if (s->pcm->nonatomic) 1197 1244 mutex_lock_nested(&s->self_group.mutex, depth); 1198 1245 else … … 1222 1269 } 1223 1270 _unlock: 1224 if (do_lock) { 1225 /* unlock streams */ 1226 snd_pcm_group_for_each_entry(s1, substream) { 1227 if (s1 != substream) { 1228 if (s1->pcm->nonatomic) 1229 mutex_unlock(&s1->self_group.mutex); 1230 else 1231 spin_unlock(&s1->self_group.lock); 1232 } 1233 if (s1 == s) /* end */ 1234 break; 1271 /* unlock streams */ 1272 snd_pcm_group_for_each_entry(s1, substream) { 1273 if (s1 != substream) { 1274 if (!stream_lock) 1275 mutex_unlock(&s1->runtime->buffer_mutex); 1276 else if (s1->pcm->nonatomic) 1277 mutex_unlock(&s1->self_group.mutex); 1278 else 1279 spin_unlock(&s1->self_group.lock); 1235 1280 } 1281 if (s1 == s) /* end */ 1282 break; 1236 1283 } 1237 1284 return res; … … 1363 1410 /* Guarantee the group members won't change during non-atomic action */ 1364 1411 down_read(&snd_pcm_link_rwsem); 1412 #ifndef TARGET_OS2 1413 res = snd_pcm_buffer_access_lock(substream->runtime); 1414 if (res < 0) 1415 goto unlock; 1416 #endif 1365 1417 if (snd_pcm_stream_linked(substream)) 1366 1418 res = snd_pcm_action_group(ops, substream, state, false); 1367 1419 else 1368 1420 res = snd_pcm_action_single(ops, substream, state); 1421 snd_pcm_buffer_access_unlock(substream->runtime); 1422 unlock: 1369 1423 up_read(&snd_pcm_link_rwsem); 1370 1424 return res; … … 1856 1910 if (err < 0) 1857 1911 return err; 1912 snd_pcm_stream_lock_irq(substream); 1858 1913 runtime->hw_ptr_base = 0; 1859 1914 runtime->hw_ptr_interrupt = runtime->status->hw_ptr - … … 1861 1916 runtime->silence_start = runtime->status->hw_ptr; 1862 1917 runtime->silence_filled = 0; 1918 snd_pcm_stream_unlock_irq(substream); 1863 1919 return 0; 1864 1920 } … … 1868 1924 { 1869 1925 struct snd_pcm_runtime *runtime = substream->runtime; 1926 snd_pcm_stream_lock_irq(substream); 1870 1927 runtime->control->appl_ptr = runtime->status->hw_ptr; 1871 1928 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 1872 1929 runtime->silence_size > 0) 1873 1930 snd_pcm_playback_silence(substream, ULONG_MAX); 1931 snd_pcm_stream_unlock_irq(substream); 1874 1932 } 1875 1933 -
GPL/branches/uniaud32-next/alsa-kernel/core/rawmidi.c
r710 r711 465 465 goto __error; 466 466 } 467 rawmidi_file->user_pversion = 0; 467 468 init_waitqueue_entry(&wait, current); 468 469 add_wait_queue(&rmidi->open_wait, &wait); -
GPL/branches/uniaud32-next/alsa-kernel/core/seq/seq_queue.c
r697 r711 236 236 /* -------------------------------------------------------- */ 237 237 238 #define MAX_CELL_PROCESSES_IN_QUEUE 1000 239 238 240 void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop) 239 241 { … … 242 244 snd_seq_tick_time_t cur_tick; 243 245 snd_seq_real_time_t cur_time; 246 int processed = 0; 244 247 245 248 if (q == NULL) … … 264 267 break; 265 268 snd_seq_dispatch_event(cell, atomic, hop); 269 if (++processed >= MAX_CELL_PROCESSES_IN_QUEUE) 270 goto out; /* the rest processed at the next batch */ 266 271 } 267 272 … … 273 278 break; 274 279 snd_seq_dispatch_event(cell, atomic, hop); 275 } 276 280 if (++processed >= MAX_CELL_PROCESSES_IN_QUEUE) 281 goto out; /* the rest processed at the next batch */ 282 } 283 284 out: 277 285 /* free lock */ 278 286 spin_lock_irqsave(&q->check_lock, flags); 279 287 if (q->check_again) { 280 288 q->check_again = 0; 281 spin_unlock_irqrestore(&q->check_lock, flags); 282 goto __again; 289 if (processed < MAX_CELL_PROCESSES_IN_QUEUE) { 290 spin_unlock_irqrestore(&q->check_lock, flags); 291 goto __again; 292 } 283 293 } 284 294 q->check_blocked = 0; -
GPL/branches/uniaud32-next/alsa-kernel/core/timer.c
r693 r711 626 626 return -EINVAL; 627 627 spin_lock_irqsave(&timer->lock, flags); 628 list_del_init(&timeri->ack_list); 629 list_del_init(&timeri->active_list); 628 630 if (!(timeri->flags & (SNDRV_TIMER_IFLG_RUNNING | 629 631 SNDRV_TIMER_IFLG_START))) { … … 631 633 goto unlock; 632 634 } 633 list_del_init(&timeri->ack_list);634 list_del_init(&timeri->active_list);635 635 if (timer->card && timer->card->shutdown) 636 636 goto unlock; … … 667 667 { 668 668 unsigned long flags; 669 bool running; 669 670 670 671 spin_lock_irqsave(&slave_active_lock, flags); 671 if (!(timeri->flags & SNDRV_TIMER_IFLG_RUNNING)) { 672 spin_unlock_irqrestore(&slave_active_lock, flags); 673 return -EBUSY; 674 } 672 running = timeri->flags & SNDRV_TIMER_IFLG_RUNNING; 675 673 timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING; 676 674 if (timeri->timer) { … … 678 676 list_del_init(&timeri->ack_list); 679 677 list_del_init(&timeri->active_list); 680 snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP : 681 SNDRV_TIMER_EVENT_PAUSE); 678 if (running) 679 snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP : 680 SNDRV_TIMER_EVENT_PAUSE); 682 681 spin_unlock(&timeri->timer->lock); 683 682 } 684 683 spin_unlock_irqrestore(&slave_active_lock, flags); 685 return 0;684 return running ? 0 : -EBUSY; 686 685 } 687 686 -
GPL/branches/uniaud32-next/alsa-kernel/drivers/opl3/opl3_midi.c
r697 r711 401 401 if (instr_4op) { 402 402 vp2 = &opl3->voices[voice + 3]; 403 if (vp ->state > 0) {403 if (vp2->state > 0) { 404 404 opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + 405 405 voice_offset + 3); -
GPL/branches/uniaud32-next/alsa-kernel/hda/ext/hdac_ext_stream.c
r693 r711 107 107 EXPORT_SYMBOL_GPL(snd_hdac_stream_free_all); 108 108 109 /** 110 * snd_hdac_ext_stream_decouple - decouple the hdac stream 111 * @bus: HD-audio core bus 112 * @stream: HD-audio ext core stream object to initialize 113 * @decouple: flag to decouple 114 */ 115 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, 116 struct hdac_ext_stream *stream, bool decouple) 109 void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus, 110 struct hdac_ext_stream *stream, 111 bool decouple) 117 112 { 118 113 struct hdac_stream *hstream = &stream->hstream; … … 120 115 int mask = AZX_PPCTL_PROCEN(hstream->index); 121 116 122 spin_lock_irq(&bus->reg_lock);123 117 val = readw(bus->ppcap + AZX_REG_PP_PPCTL) & mask; 124 118 … … 129 123 130 124 stream->decoupled = decouple; 125 } 126 EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_decouple_locked); 127 128 /** 129 * snd_hdac_ext_stream_decouple - decouple the hdac stream 130 * @bus: HD-audio core bus 131 * @stream: HD-audio ext core stream object to initialize 132 * @decouple: flag to decouple 133 */ 134 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, 135 struct hdac_ext_stream *stream, bool decouple) 136 { 137 spin_lock_irq(&bus->reg_lock); 138 snd_hdac_ext_stream_decouple_locked(bus, stream, decouple); 131 139 spin_unlock_irq(&bus->reg_lock); 132 140 } … … 253 261 } 254 262 263 spin_lock_irq(&bus->reg_lock); 255 264 list_for_each_entry(stream, &bus->stream_list, list) { 256 265 struct hdac_ext_stream *hstream = container_of(stream, … … 267 276 268 277 if (!hstream->link_locked) { 269 snd_hdac_ext_stream_decouple (bus, hstream, true);278 snd_hdac_ext_stream_decouple_locked(bus, hstream, true); 270 279 res = hstream; 271 280 break; … … 273 282 } 274 283 if (res) { 275 spin_lock_irq(&bus->reg_lock);276 284 res->link_locked = 1; 277 285 res->link_substream = substream; 278 spin_unlock_irq(&bus->reg_lock);279 }286 } 287 spin_unlock_irq(&bus->reg_lock); 280 288 return res; 281 289 } … … 293 301 } 294 302 303 spin_lock_irq(&bus->reg_lock); 295 304 list_for_each_entry(stream, &bus->stream_list, list) { 296 305 struct hdac_ext_stream *hstream = container_of(stream, … … 302 311 if (!stream->opened) { 303 312 if (!hstream->decoupled) 304 snd_hdac_ext_stream_decouple (bus, hstream, true);313 snd_hdac_ext_stream_decouple_locked(bus, hstream, true); 305 314 res = hstream; 306 315 break; … … 308 317 } 309 318 if (res) { 310 spin_lock_irq(&bus->reg_lock);311 319 res->hstream.opened = 1; 312 320 res->hstream.running = 0; 313 321 res->hstream.substream = substream; 314 spin_unlock_irq(&bus->reg_lock);315 }322 } 323 spin_unlock_irq(&bus->reg_lock); 316 324 317 325 return res; … … 379 387 380 388 case HDAC_EXT_STREAM_TYPE_HOST: 389 spin_lock_irq(&bus->reg_lock); 381 390 if (stream->decoupled && !stream->link_locked) 382 snd_hdac_ext_stream_decouple(bus, stream, false); 391 snd_hdac_ext_stream_decouple_locked(bus, stream, false); 392 spin_unlock_irq(&bus->reg_lock); 383 393 snd_hdac_stream_release(&stream->hstream); 384 394 break; 385 395 386 396 case HDAC_EXT_STREAM_TYPE_LINK: 397 spin_lock_irq(&bus->reg_lock); 387 398 if (stream->decoupled && !stream->hstream.opened) 388 snd_hdac_ext_stream_decouple(bus, stream, false); 389 spin_lock_irq(&bus->reg_lock); 399 snd_hdac_ext_stream_decouple_locked(bus, stream, false); 390 400 stream->link_locked = 0; 391 401 stream->link_substream = NULL; -
GPL/branches/uniaud32-next/alsa-kernel/hda/hdac_device.c
r629 r711 675 675 { 0x17e8, "Chrontel" }, 676 676 { 0x1854, "LG" }, 677 { 0x19e5, "Huawei" }, 677 678 { 0x1aec, "Wolfson Microelectronics" }, 678 679 { 0x1af4, "QEMU" }, -
GPL/branches/uniaud32-next/alsa-kernel/hda/hdac_stream.c
r694 r711 302 302 (substream->stream + 1); 303 303 304 spin_lock_irq(&bus->reg_lock); 304 305 list_for_each_entry(azx_dev, &bus->stream_list, list, struct hdac_stream) { 305 306 if (azx_dev->direction != substream->stream) … … 315 316 } 316 317 if (res) { 317 spin_lock_irq(&bus->reg_lock);318 318 res->opened = 1; 319 319 res->running = 0; 320 320 res->assigned_key = key; 321 321 res->substream = substream; 322 spin_unlock_irq(&bus->reg_lock);323 }322 } 323 spin_unlock_irq(&bus->reg_lock); 324 324 return res; 325 325 } … … 539 539 cc->mask = CLOCKSOURCE_MASK(32); 540 540 541 #ifndef TARGET_OS2 542 /* 543 * Calculate the optimal mult/shift values. The counter wraps 544 * around after ~178.9 seconds. 545 */ 546 clocks_calc_mult_shift(&cc->mult, &cc->shift, 24000000, 547 NSEC_PER_SEC, 178); 548 #else 541 549 /* 542 550 * Converting from 24 MHz to ns means applying a 125/3 factor. … … 551 559 cc->mult = 125; /* saturation after 195 years */ 552 560 cc->shift = 0; 553 561 #endif 554 562 nsec = 0; /* audio time is elapsed time since trigger */ 555 563 timecounter_init(tc, cc, nsec); -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/core.h
r710 r711 288 288 int snd_card_free(struct snd_card *card); 289 289 int snd_card_free_when_closed(struct snd_card *card); 290 int snd_card_free_on_error(struct device *dev, int ret); 290 291 void snd_card_set_id(struct snd_card *card, const char *id); 291 292 int snd_card_register(struct snd_card *card); -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/hda_codec.h
r710 r711 9 9 #define __SOUND_HDA_CODEC_H 10 10 11 #include <linux/ kref.h>11 #include <linux/refcount.h> 12 12 #include <linux/mod_devicetable.h> 13 13 #include <sound/info.h> … … 167 167 /* private: */ 168 168 struct hda_codec *codec; 169 struct kref kref;170 169 struct list_head list; 170 unsigned int disconnected:1; 171 171 }; 172 172 … … 188 188 /* PCM to create, set by patch_ops.build_pcms callback */ 189 189 struct list_head pcm_list_head; 190 refcount_t pcm_ref; 191 wait_queue_head_t remove_sleep; 190 192 191 193 /* codec specific info */ … … 423 425 static inline void snd_hda_codec_pcm_get(struct hda_pcm *pcm) 424 426 { 425 kref_get(&pcm->kref);427 refcount_inc(&pcm->codec->pcm_ref); 426 428 } 427 429 void snd_hda_codec_pcm_put(struct hda_pcm *pcm); -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/hdaudio_ext.h
r710 r711 89 89 int type); 90 90 void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type); 91 void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus, 92 struct hdac_ext_stream *azx_dev, bool decouple); 91 93 void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, 92 94 struct hdac_ext_stream *azx_dev, bool decouple); -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/jack.h
r693 r711 63 63 #ifdef CONFIG_SND_JACK_INPUT_DEV 64 64 struct input_dev *input_dev; 65 struct mutex input_dev_lock; 65 66 int registered; 66 67 int type; -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/pcm.h
r710 r711 399 399 struct fasync_struct *fasync; 400 400 bool stop_operating; /* sync_stop will be called */ 401 struct mutex buffer_mutex; /* protect for buffer changes */ 402 atomic_t buffer_accessing; /* >0: in r/w operation, <0: blocked */ 401 403 402 404 /* -- private section -- */ -
GPL/branches/uniaud32-next/alsa-kernel/include/sound/soc-topology.h
r697 r711 189 189 #else 190 190 191 static inline int snd_soc_tplg_component_remove(struct snd_soc_component *comp, 192 u32 index) 191 static inline int snd_soc_tplg_component_remove(struct snd_soc_component *comp) 193 192 { 194 193 return 0; -
GPL/branches/uniaud32-next/alsa-kernel/include/uapi/sound/asound.h
r710 r711 81 81 ****************************************************************************/ 82 82 83 #define AES_IEC958_STATUS_SIZE 24 84 83 85 struct snd_aes_iec958 { 84 unsigned char status[ 24];/* AES/IEC958 channel status bits */86 unsigned char status[AES_IEC958_STATUS_SIZE]; /* AES/IEC958 channel status bits */ 85 87 unsigned char subcode[147]; /* AES/IEC958 subcode bits */ 86 88 unsigned char pad; /* nothing */ -
GPL/branches/uniaud32-next/alsa-kernel/pci/ac97/ac97_codec.c
r697 r711 947 947 948 948 mutex_lock(&ac97->page_mutex); 949 ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31);950 ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31);949 ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31); 950 ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31); 951 951 mutex_unlock(&ac97->page_mutex); 952 952 return 0; -
GPL/branches/uniaud32-next/alsa-kernel/pci/ali5451/ali5451.c
r710 r711 2132 2132 } 2133 2133 2134 static int snd_ali_probe(struct pci_dev *pci,2135 const struct pci_device_id *pci_id)2134 static int __snd_ali_probe(struct pci_dev *pci, 2135 const struct pci_device_id *pci_id) 2136 2136 { 2137 2137 struct snd_card *card; … … 2176 2176 pci_set_drvdata(pci, card); 2177 2177 return 0; 2178 } 2179 2180 static int snd_ali_probe(struct pci_dev *pci, 2181 const struct pci_device_id *pci_id) 2182 { 2183 return snd_card_free_on_error(&pci->dev, __snd_ali_probe(pci, pci_id)); 2178 2184 } 2179 2185 -
GPL/branches/uniaud32-next/alsa-kernel/pci/als4000.c
r710 r711 810 810 } 811 811 812 static int snd_card_als4000_probe(struct pci_dev *pci,813 const struct pci_device_id *pci_id)812 static int __snd_card_als4000_probe(struct pci_dev *pci, 813 const struct pci_device_id *pci_id) 814 814 { 815 815 static int dev; … … 934 934 } 935 935 936 static int snd_card_als4000_probe(struct pci_dev *pci, 937 const struct pci_device_id *pci_id) 938 { 939 return snd_card_free_on_error(&pci->dev, __snd_card_als4000_probe(pci, pci_id)); 940 } 941 936 942 #ifdef CONFIG_PM_SLEEP 937 943 static int snd_als4000_suspend(struct device *dev) -
GPL/branches/uniaud32-next/alsa-kernel/pci/atiixp.c
r710 r711 1601 1601 1602 1602 1603 static int snd_atiixp_probe(struct pci_dev *pci,1604 const struct pci_device_id *pci_id)1603 static int __snd_atiixp_probe(struct pci_dev *pci, 1604 const struct pci_device_id *pci_id) 1605 1605 { 1606 1606 struct snd_card *card; … … 1656 1656 } 1657 1657 1658 static int snd_atiixp_probe(struct pci_dev *pci, 1659 const struct pci_device_id *pci_id) 1660 { 1661 return snd_card_free_on_error(&pci->dev, __snd_atiixp_probe(pci, pci_id)); 1662 } 1663 1658 1664 static struct pci_driver atiixp_driver = { 1659 1665 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/au88x0/au88x0.c
r710 r711 194 194 // constructor -- see "Constructor" sub-section 195 195 static int 196 snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)196 __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 197 197 { 198 198 static int dev; … … 311 311 } 312 312 313 static int 314 snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 315 { 316 return snd_card_free_on_error(&pci->dev, __snd_vortex_probe(pci, pci_id)); 317 } 318 313 319 // pci_driver definition 314 320 static struct pci_driver vortex_driver = { -
GPL/branches/uniaud32-next/alsa-kernel/pci/bt87x.c
r710 r711 824 824 } 825 825 826 static int snd_bt87x_probe(struct pci_dev *pci,827 const struct pci_device_id *pci_id)826 static int __snd_bt87x_probe(struct pci_dev *pci, 827 const struct pci_device_id *pci_id) 828 828 { 829 829 static int dev; … … 908 908 } 909 909 910 static int snd_bt87x_probe(struct pci_dev *pci, 911 const struct pci_device_id *pci_id) 912 { 913 return snd_card_free_on_error(&pci->dev, __snd_bt87x_probe(pci, pci_id)); 914 } 915 910 916 /* default entries for all Bt87x cards - it's not exported */ 911 917 /* driver_data is set to 0 to call detection */ -
GPL/branches/uniaud32-next/alsa-kernel/pci/ca0106/ca0106_main.c
r710 r711 1737 1737 1738 1738 1739 static int snd_ca0106_probe(struct pci_dev *pci,1740 1739 static int __snd_ca0106_probe(struct pci_dev *pci, 1740 const struct pci_device_id *pci_id) 1741 1741 { 1742 1742 static int dev; … … 1796 1796 dev++; 1797 1797 return 0; 1798 } 1799 1800 static int snd_ca0106_probe(struct pci_dev *pci, 1801 const struct pci_device_id *pci_id) 1802 { 1803 return snd_card_free_on_error(&pci->dev, __snd_ca0106_probe(pci, pci_id)); 1798 1804 } 1799 1805 -
GPL/branches/uniaud32-next/alsa-kernel/pci/cmipci.c
r710 r711 308 308 #define CM_MICGAINZ_SHIFT 0 309 309 310 #define CM_REG_MIXER3 0x24311 310 #define CM_REG_AUX_VOL 0x26 312 311 #define CM_VAUXL_MASK 0xf0 … … 3280 3279 err = snd_cmipci_create(card, pci, dev); 3281 3280 if (err < 0) 3282 return err;3281 goto error; 3283 3282 3284 3283 err = snd_card_register(card); 3285 3284 if (err < 0) 3286 return err;3285 goto error; 3287 3286 3288 3287 pci_set_drvdata(pci, card); 3289 3288 dev++; 3290 3289 return 0; 3290 3291 error: 3292 snd_card_free(card); 3293 return err; 3291 3294 } 3292 3295 … … 3297 3300 static const unsigned char saved_regs[] = { 3298 3301 CM_REG_FUNCTRL1, CM_REG_CHFORMAT, CM_REG_LEGACY_CTRL, CM_REG_MISC_CTRL, 3299 CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_ MIXER3, CM_REG_PLL,3302 CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_AUX_VOL, CM_REG_PLL, 3300 3303 CM_REG_CH0_FRAME1, CM_REG_CH0_FRAME2, 3301 3304 CM_REG_CH1_FRAME1, CM_REG_CH1_FRAME2, CM_REG_EXT_MISC, -
GPL/branches/uniaud32-next/alsa-kernel/pci/cs4281.c
r710 r711 1850 1850 } 1851 1851 1852 static int snd_cs4281_probe(struct pci_dev *pci,1853 const struct pci_device_id *pci_id)1852 static int __snd_cs4281_probe(struct pci_dev *pci, 1853 const struct pci_device_id *pci_id) 1854 1854 { 1855 1855 static int dev; … … 1911 1911 } 1912 1912 1913 static int snd_cs4281_probe(struct pci_dev *pci, 1914 const struct pci_device_id *pci_id) 1915 { 1916 return snd_card_free_on_error(&pci->dev, __snd_cs4281_probe(pci, pci_id)); 1917 } 1918 1913 1919 /* 1914 1920 * Power Management -
GPL/branches/uniaud32-next/alsa-kernel/pci/cs46xx/cs46xx.c
r710 r711 82 82 external_amp[dev], thinkpad[dev]); 83 83 if (err < 0) 84 return err;84 goto error; 85 85 card->private_data = chip; 86 86 chip->accept_valid = mmap_valid[dev]; 87 87 err = snd_cs46xx_pcm(chip, 0); 88 88 if (err < 0) 89 return err;89 goto error; 90 90 #ifdef CONFIG_SND_CS46XX_NEW_DSP 91 91 err = snd_cs46xx_pcm_rear(chip, 1); 92 92 if (err < 0) 93 return err;93 goto error; 94 94 err = snd_cs46xx_pcm_iec958(chip, 2); 95 95 if (err < 0) 96 return err;96 goto error; 97 97 #endif 98 98 err = snd_cs46xx_mixer(chip, 2); 99 99 if (err < 0) 100 return err;100 goto error; 101 101 #ifdef CONFIG_SND_CS46XX_NEW_DSP 102 102 if (chip->nr_ac97_codecs ==2) { 103 103 err = snd_cs46xx_pcm_center_lfe(chip, 3); 104 104 if (err < 0) 105 return err;105 goto error; 106 106 } 107 107 #endif 108 108 err = snd_cs46xx_midi(chip, 0); 109 109 if (err < 0) 110 return err;110 goto error; 111 111 err = snd_cs46xx_start_dsp(chip); 112 112 if (err < 0) 113 return err;113 goto error; 114 114 115 115 snd_cs46xx_gameport(chip); … … 125 125 err = snd_card_register(card); 126 126 if (err < 0) 127 return err;127 goto error; 128 128 129 129 pci_set_drvdata(pci, card); 130 130 dev++; 131 131 return 0; 132 133 error: 134 snd_card_free(card); 135 return err; 132 136 } 133 137 -
GPL/branches/uniaud32-next/alsa-kernel/pci/cs5535audio/cs5535audio.c
r710 r711 286 286 } 287 287 288 static int snd_cs5535audio_probe(struct pci_dev *pci,289 const struct pci_device_id *pci_id)288 static int __snd_cs5535audio_probe(struct pci_dev *pci, 289 const struct pci_device_id *pci_id) 290 290 { 291 291 static int dev; … … 334 334 dev++; 335 335 return 0; 336 } 337 338 static int snd_cs5535audio_probe(struct pci_dev *pci, 339 const struct pci_device_id *pci_id) 340 { 341 return snd_card_free_on_error(&pci->dev, __snd_cs5535audio_probe(pci, pci_id)); 336 342 } 337 343 -
GPL/branches/uniaud32-next/alsa-kernel/pci/emu10k1/emu10k1x.c
r710 r711 1499 1499 } 1500 1500 1501 static int snd_emu10k1x_probe(struct pci_dev *pci,1502 1501 static int __snd_emu10k1x_probe(struct pci_dev *pci, 1502 const struct pci_device_id *pci_id) 1503 1503 { 1504 1504 static int dev; … … 1562 1562 } 1563 1563 1564 static int snd_emu10k1x_probe(struct pci_dev *pci, 1565 const struct pci_device_id *pci_id) 1566 { 1567 return snd_card_free_on_error(&pci->dev, __snd_emu10k1x_probe(pci, pci_id)); 1568 } 1569 1564 1570 // PCI IDs 1565 1571 static const struct pci_device_id snd_emu10k1x_ids[] = { -
GPL/branches/uniaud32-next/alsa-kernel/pci/ens1370.c
r710 r711 2330 2330 } 2331 2331 2332 static int snd_audiopci_probe(struct pci_dev *pci,2333 2332 static int __snd_audiopci_probe(struct pci_dev *pci, 2333 const struct pci_device_id *pci_id) 2334 2334 { 2335 2335 static int dev; … … 2395 2395 } 2396 2396 2397 static int snd_audiopci_probe(struct pci_dev *pci, 2398 const struct pci_device_id *pci_id) 2399 { 2400 return snd_card_free_on_error(&pci->dev, __snd_audiopci_probe(pci, pci_id)); 2401 } 2402 2397 2403 static struct pci_driver ens137x_driver = { 2398 2404 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/es1938.c
r710 r711 1752 1752 1753 1753 1754 static int snd_es1938_probe(struct pci_dev *pci,1755 const struct pci_device_id *pci_id)1754 static int __snd_es1938_probe(struct pci_dev *pci, 1755 const struct pci_device_id *pci_id) 1756 1756 { 1757 1757 static int dev; … … 1832 1832 } 1833 1833 1834 static int snd_es1938_probe(struct pci_dev *pci, 1835 const struct pci_device_id *pci_id) 1836 { 1837 return snd_card_free_on_error(&pci->dev, __snd_es1938_probe(pci, pci_id)); 1838 } 1839 1834 1840 static struct pci_driver es1938_driver = { 1835 1841 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/es1968.c
r710 r711 2791 2791 /* 2792 2792 */ 2793 static int snd_es1968_probe(struct pci_dev *pci,2794 const struct pci_device_id *pci_id)2793 static int __snd_es1968_probe(struct pci_dev *pci, 2794 const struct pci_device_id *pci_id) 2795 2795 { 2796 2796 static int dev; … … 2898 2898 } 2899 2899 2900 static int snd_es1968_probe(struct pci_dev *pci, 2901 const struct pci_device_id *pci_id) 2902 { 2903 return snd_card_free_on_error(&pci->dev, __snd_es1968_probe(pci, pci_id)); 2904 } 2905 2900 2906 static struct pci_driver es1968_driver = { 2901 2907 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/fm801.c
r710 r711 1292 1292 } 1293 1293 1294 static int snd_card_fm801_probe(struct pci_dev *pci,1295 const struct pci_device_id *pci_id)1294 static int __snd_card_fm801_probe(struct pci_dev *pci, 1295 const struct pci_device_id *pci_id) 1296 1296 { 1297 1297 static int dev; … … 1355 1355 dev++; 1356 1356 return 0; 1357 } 1358 1359 static int snd_card_fm801_probe(struct pci_dev *pci, 1360 const struct pci_device_id *pci_id) 1361 { 1362 return snd_card_free_on_error(&pci->dev, __snd_card_fm801_probe(pci, pci_id)); 1357 1363 } 1358 1364 -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_auto_parser.c
r710 r711 828 828 } 829 829 830 static voidapply_fixup(struct hda_codec *codec, int id, int action, int depth)830 void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth) 831 831 { 832 832 const char *modelname = codec->fixup_name; … … 838 838 break; 839 839 if (fix->chained_before) 840 apply_fixup(codec, fix->chain_id, action, depth + 1);840 __snd_hda_apply_fixup(codec, fix->chain_id, action, depth + 1); 841 841 842 842 switch (fix->type) { … … 879 879 } 880 880 } 881 EXPORT_SYMBOL_GPL(__snd_hda_apply_fixup); 881 882 882 883 /** … … 888 889 { 889 890 if (codec->fixup_list) 890 apply_fixup(codec, codec->fixup_id, action, 0);891 __snd_hda_apply_fixup(codec, codec->fixup_id, action, 0); 891 892 } 892 893 EXPORT_SYMBOL_GPL(snd_hda_apply_fixup); … … 990 991 const char *name = NULL; 991 992 const char *type = NULL; 992 int vendor, device;993 unsigned int vendor, device; 993 994 994 995 if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET) -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_bind.c
r710 r711 158 158 return codec->bus->core.ext_ops->hdev_detach(&codec->core); 159 159 } 160 161 refcount_dec(&codec->pcm_ref); 162 snd_hda_codec_disconnect_pcms(codec); 163 wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref)); 164 snd_power_sync_ref(codec->bus->card); 160 165 161 166 if (codec->patch_ops.free) -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_codec.c
r710 r711 712 712 * PCM device 713 713 */ 714 static void release_pcm(struct kref *kref)715 {716 struct hda_pcm *pcm = container_of(kref, struct hda_pcm, kref);717 #ifndef TARGET_OS2718 /* don't do this on OS/2 - results in the device being free'd and can't be re-opened */719 if (pcm->pcm)720 snd_device_free(pcm->codec->card, pcm->pcm);721 #endif722 clear_bit(pcm->device, pcm->codec->bus->pcm_dev_bits);723 kfree(pcm->name);724 kfree(pcm);725 }726 714 727 715 void snd_hda_codec_pcm_put(struct hda_pcm *pcm) 728 716 { 729 kref_put(&pcm->kref, release_pcm); 717 if (refcount_dec_and_test(&pcm->codec->pcm_ref)) 718 wake_up(&pcm->codec->remove_sleep); 730 719 } 731 720 EXPORT_SYMBOL_GPL(snd_hda_codec_pcm_put); … … 742 731 743 732 pcm->codec = codec; 744 kref_init(&pcm->kref);745 733 va_start(args, fmt); 746 734 pcm->name = kvasprintf(GFP_KERNEL, fmt, args); … … 752 740 753 741 list_add_tail(&pcm->list, &codec->pcm_list_head); 742 refcount_inc(&codec->pcm_ref); 754 743 return pcm; 755 744 } … … 759 748 * codec destructor 760 749 */ 761 static void codec_release_pcms(struct hda_codec *codec) 762 { 763 struct hda_pcm *pcm, *n; 764 765 list_for_each_entry_safe(pcm, n, &codec->pcm_list_head, list, struct hda_pcm) { 766 list_del_init(&pcm->list); 750 void snd_hda_codec_disconnect_pcms(struct hda_codec *codec) 751 { 752 struct hda_pcm *pcm; 753 754 list_for_each_entry(pcm, &codec->pcm_list_head, list, struct hda_pcm) { 755 if (pcm->disconnected) 756 continue; 767 757 if (pcm->pcm) 768 758 snd_device_disconnect(codec->card, pcm->pcm); 769 759 snd_hda_codec_pcm_put(pcm); 760 pcm->disconnected = 1; 761 } 762 } 763 764 static void codec_release_pcms(struct hda_codec *codec) 765 { 766 struct hda_pcm *pcm, *n; 767 768 list_for_each_entry_safe(pcm, n, &codec->pcm_list_head, list, struct hda_pcm) { 769 list_del(&pcm->list); 770 if (pcm->pcm) 771 snd_device_free(pcm->codec->card, pcm->pcm); 772 clear_bit(pcm->device, pcm->codec->bus->pcm_dev_bits); 773 kfree(pcm->name); 774 kfree(pcm); 770 775 } 771 776 } … … 780 785 } 781 786 787 snd_hda_codec_disconnect_pcms(codec); 782 788 cancel_delayed_work_sync(&codec->jackpoll_work); 783 789 if (!codec->in_freeing) … … 803 809 snd_hdac_regmap_exit(&codec->core); 804 810 codec->configured = 0; 811 refcount_set(&codec->pcm_ref, 1); /* reset refcount */ 805 812 } 806 813 EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_for_unbind); … … 969 976 INIT_LIST_HEAD(&codec->conn_list); 970 977 INIT_LIST_HEAD(&codec->pcm_list_head); 978 refcount_set(&codec->pcm_ref, 1); 979 init_waitqueue_head(&codec->remove_sleep); 971 980 972 981 INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); … … 1738 1747 int i; 1739 1748 struct hda_nid_item *items = codec->mixers.list; 1749 1750 down_write(&codec->card->controls_rwsem); 1740 1751 for (i = 0; i < codec->mixers.used; i++) 1741 1752 snd_ctl_remove(codec->card, items[i].kctl); 1753 up_write(&codec->card->controls_rwsem); 1742 1754 snd_array_free(&codec->mixers); 1743 1755 snd_array_free(&codec->nids); … … 3004 3016 { 3005 3017 struct hda_pcm *cpcm; 3018 3019 /* Skip the shutdown if codec is not registered */ 3020 if (!codec->registered) 3021 return; 3006 3022 3007 3023 list_for_each_entry(cpcm, &codec->pcm_list_head, list, struct hda_pcm) -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_controller.c
r710 r711 524 524 525 525 nsec = timecounter_read(&azx_dev->core.tc); 526 nsec = div_u64(nsec, 3); /* can be optimized */527 526 if (audio_tstamp_config->report_delay) 528 527 nsec = azx_adjust_codec_delay(substream, nsec); -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_generic.c
r710 r711 95 95 snd_array_free(&spec->paths); 96 96 snd_array_free(&spec->loopback_list); 97 #ifdef CONFIG_SND_HDA_GENERIC_LEDS 98 if (spec->led_cdevs[LED_AUDIO_MUTE]) 99 led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MUTE]); 100 if (spec->led_cdevs[LED_AUDIO_MICMUTE]) 101 led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MICMUTE]); 102 #endif 97 103 } 98 104 … … 3934 3940 bool micmute) 3935 3941 { 3942 struct hda_gen_spec *spec = codec->spec; 3936 3943 struct led_classdev *cdev; 3944 int idx = micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE; 3945 int err; 3937 3946 3938 3947 cdev = devm_kzalloc(&codec->core.dev, sizeof(*cdev), GFP_KERNEL); … … 3944 3953 cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute"; 3945 3954 cdev->brightness_set_blocking = callback; 3946 cdev->brightness = ledtrig_audio_get( micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE);3955 cdev->brightness = ledtrig_audio_get(idx); 3947 3956 cdev->flags = LED_CORE_SUSPENDRESUME; 3948 3957 3949 return devm_led_classdev_register(&codec->core.dev, cdev); 3958 err = led_classdev_register(&codec->core.dev, cdev); 3959 if (err < 0) 3960 return err; 3961 spec->led_cdevs[idx] = cdev; 3962 return 0; 3950 3963 } 3951 3964 -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_generic.h
r710 r711 295 295 void (*mic_autoswitch_hook)(struct hda_codec *codec, 296 296 struct hda_jack_callback *cb); 297 298 /* leds */ 299 struct led_classdev *led_cdevs[NUM_AUDIO_LEDS]; 297 300 }; 298 301 -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_intel.c
r710 r711 354 354 ((pci)->device == 0x0d0c) || \ 355 355 ((pci)->device == 0x160c) || \ 356 ((pci)->device == 0x490d)) 356 ((pci)->device == 0x490d) || \ 357 ((pci)->device == 0x4f90) || \ 358 ((pci)->device == 0x4f91) || \ 359 ((pci)->device == 0x4f92)) 357 360 358 361 #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) … … 657 660 * data is processed. So, we need to process it afterwords in a 658 661 * workqueue. 662 * 663 * Returns 1 if OK to proceed, 0 for delay handling, -1 for skipping update 659 664 */ 660 665 static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) 661 666 { 662 667 struct snd_pcm_substream *substream = azx_dev->core.substream; 668 struct snd_pcm_runtime *runtime = substream->runtime; 663 669 int stream = substream->stream; 664 670 u32 wallclk; 665 671 unsigned int pos; 672 snd_pcm_uframes_t hwptr, target; 666 673 667 674 wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk; … … 707 714 return chip->bdl_pos_adj ? 0 : -1; 708 715 azx_dev->core.start_wallclk += wallclk; 716 717 if (azx_dev->core.no_period_wakeup) 718 return 1; /* OK, no need to check period boundary */ 719 720 if (runtime->hw_ptr_base != runtime->hw_ptr_interrupt) 721 return 1; /* OK, already in hwptr updating process */ 722 723 /* check whether the period gets really elapsed */ 724 pos = bytes_to_frames(runtime, pos); 725 hwptr = runtime->hw_ptr_base + pos; 726 if (hwptr < runtime->status->hw_ptr) 727 hwptr += runtime->buffer_size; 728 target = runtime->hw_ptr_interrupt + runtime->period_size; 729 if (hwptr < target) { 730 /* too early wakeup, process it later */ 731 return chip->bdl_pos_adj ? 0 : -1; 732 } 733 709 734 return 1; /* OK, it's fine */ 710 735 } … … 883 908 /* just read back the calculated value in the above */ 884 909 return substream->runtime->delay; 885 }886 887 static unsigned int azx_skl_get_dpib_pos(struct azx *chip,888 struct azx_dev *azx_dev)889 {890 return _snd_hdac_chip_readl(azx_bus(chip),891 AZX_REG_VS_SDXDPIB_XBASE +892 (AZX_REG_VS_SDXDPIB_XINTERVAL *893 azx_dev->core.index));894 }895 896 /* get the current DMA position with correction on SKL+ chips */897 static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev)898 {899 /* DPIB register gives a more accurate position for playback */900 if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK)901 return azx_skl_get_dpib_pos(chip, azx_dev);902 903 /* For capture, we need to read posbuf, but it requires a delay904 * for the possible boundary overlap; the read of DPIB fetches the905 * actual posbuf906 */907 udelay(20);908 azx_skl_get_dpib_pos(chip, azx_dev);909 return azx_get_pos_posbuf(chip, azx_dev);910 910 } 911 911 … … 1607 1607 [POS_FIX_VIACOMBO] = azx_via_get_position, 1608 1608 [POS_FIX_COMBO] = azx_get_pos_lpib, 1609 [POS_FIX_SKL] = azx_get_pos_ skl,1609 [POS_FIX_SKL] = azx_get_pos_posbuf, 1610 1610 [POS_FIX_FIFO] = azx_get_pos_fifo, 1611 1611 }; … … 1645 1645 SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103), 1646 1646 SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103), 1647 SND_PCI_QUIRK(0x1558, 0x0351, "Schenker Dock 15", 0x105), 1647 1648 /* WinFast VP200 H (Teradici) user reported broken communication */ 1648 1649 SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101), … … 1832 1833 assign_position_fix(chip, check_position_fix(chip, position_fix[dev])); 1833 1834 1834 check_probe_mask(chip, dev);1835 1836 1835 if (single_cmd < 0) /* allow fallback to single_cmd at errors */ 1837 1836 chip->fallback_to_single_cmd = 1; … … 1858 1857 chip->bus.core.needs_damn_long_delay = 1; 1859 1858 } 1859 1860 check_probe_mask(chip, dev); 1860 1861 1861 1862 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); … … 2383 2384 out_free: 2384 2385 if (err < 0) { 2385 azx_free(chip); 2386 pci_set_drvdata(pci, NULL); 2387 snd_card_free(chip->card); 2386 2388 return err; 2387 2389 } … … 2526 2528 /* DG1 */ 2527 2529 { PCI_DEVICE(0x8086, 0x490d), 2530 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2531 /* DG2 */ 2532 { PCI_DEVICE(0x8086, 0x4f90), 2533 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2534 { PCI_DEVICE(0x8086, 0x4f91), 2535 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2536 { PCI_DEVICE(0x8086, 0x4f92), 2528 2537 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2529 2538 /* Alderlake-S */ -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/hda_local.h
r710 r711 138 138 void snd_hda_codec_register(struct hda_codec *codec); 139 139 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec); 140 void snd_hda_codec_disconnect_pcms(struct hda_codec *codec); 140 141 141 142 #define snd_hda_regmap_sync(codec) snd_hdac_regmap_sync(&(codec)->core) … … 364 365 const struct hda_pintbl *cfg); 365 366 void snd_hda_apply_fixup(struct hda_codec *codec, int action); 367 void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth); 366 368 void snd_hda_pick_fixup(struct hda_codec *codec, 367 369 const struct hda_model_fixup *models, … … 452 454 #define for_each_hda_codec_node(nid, codec) \ 453 455 for ((nid) = (codec)->core.start_nid; (nid) < (codec)->core.end_nid; (nid)++) 456 457 /* Set the codec power_state flag to indicate to allow unsol event handling; 458 * see hda_codec_unsol_event() in hda_bind.c. Calling this might confuse the 459 * state tracking, so use with care. 460 */ 461 static inline void snd_hda_codec_allow_unsol_events(struct hda_codec *codec) 462 { 463 codec->core.dev.power.power_state = PMSG_ON; 464 } 454 465 455 466 /* -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/patch_conexant.c
r710 r711 1005 1005 SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1006 1006 SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1007 SND_PCI_QUIRK(0x103c, 0x82b4, "HP ProDesk 600 G3", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1007 1008 SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), 1008 1009 SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO), … … 1113 1114 cxt5051_fixups, cxt_fixups); 1114 1115 break; 1116 case 0x14f15098: 1117 codec->pin_amp_workaround = 1; 1118 spec->gen.mixer_nid = 0x22; 1119 spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; 1120 snd_hda_pick_fixup(codec, cxt5066_fixup_models, 1121 cxt5066_fixups, cxt_fixups); 1122 break; 1115 1123 case 0x14f150f2: 1116 1124 codec->power_save_node = 1; … … 1133 1141 goto error; 1134 1142 1135 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);1143 err = cx_auto_parse_beep(codec); 1136 1144 if (err < 0) 1137 1145 goto error; 1138 1146 1139 err = cx_auto_parse_beep(codec);1147 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); 1140 1148 if (err < 0) 1141 1149 goto error; -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/patch_hdmi.c
r710 r711 1400 1400 last_try: 1401 1401 /* the last try; check the empty slots in pins */ 1402 for (i = 0; i < spec-> num_nids; i++) {1402 for (i = 0; i < spec->pcm_used; i++) { 1403 1403 if (!test_bit(i, &spec->pcm_bitmap)) 1404 1404 return i; … … 1630 1630 struct hdmi_spec *spec = codec->spec; 1631 1631 struct hdmi_eld *eld = &spec->temp_eld; 1632 struct device *dev = hda_codec_dev(codec); 1632 1633 hda_nid_t pin_nid = per_pin->pin_nid; 1633 1634 int dev_id = per_pin->dev_id; … … 1643 1644 int ret; 1644 1645 1646 #ifdef CONFIG_PM 1647 if (dev->power.runtime_status == RPM_SUSPENDING) 1648 return; 1649 #endif 1650 1645 1651 ret = snd_hda_power_up_pm(codec); 1646 if (ret < 0 && pm_runtime_suspended( hda_codec_dev(codec)))1652 if (ret < 0 && pm_runtime_suspended(dev)) 1647 1653 goto out; 1648 1654 … … 2270 2276 */ 2271 2277 2272 if (codec->mst_no_extra_pcms) 2278 if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms) 2279 pcm_num = spec->num_cvts; 2280 else if (codec->mst_no_extra_pcms) 2273 2281 pcm_num = spec->num_nids; 2274 2282 else … … 2964 2972 /* Intel Haswell and onwards; audio component with eld notifier */ 2965 2973 static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, 2966 const int *port_map, int port_num, int dev_num) 2974 const int *port_map, int port_num, int dev_num, 2975 bool send_silent_stream) 2967 2976 { 2968 2977 struct hdmi_spec *spec; … … 2997 3006 * module param or Kconfig option 2998 3007 */ 2999 if ( enable_silent_stream)3008 if (send_silent_stream) 3000 3009 spec->send_silent_stream = true; 3001 3010 … … 3005 3014 static int patch_i915_hsw_hdmi(struct hda_codec *codec) 3006 3015 { 3007 return intel_hsw_common_init(codec, 0x08, NULL, 0, 3); 3016 return intel_hsw_common_init(codec, 0x08, NULL, 0, 3, 3017 enable_silent_stream); 3008 3018 } 3009 3019 3010 3020 static int patch_i915_glk_hdmi(struct hda_codec *codec) 3011 3021 { 3012 return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3); 3022 /* 3023 * Silent stream calls audio component .get_power() from 3024 * .pin_eld_notify(). On GLK this will deadlock in i915 due 3025 * to the audio vs. CDCLK workaround. 3026 */ 3027 return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3, false); 3013 3028 } 3014 3029 … … 3021 3036 static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb}; 3022 3037 3023 return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3); 3038 return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3, 3039 enable_silent_stream); 3024 3040 } 3025 3041 … … 3033 3049 int ret; 3034 3050 3035 ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4); 3051 ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4, 3052 enable_silent_stream); 3036 3053 if (!ret) { 3037 3054 struct hdmi_spec *spec = codec->spec; … … 4397 4414 HDA_CODEC_ENTRY(0x80862814, "DG1 HDMI", patch_i915_tgl_hdmi), 4398 4415 HDA_CODEC_ENTRY(0x80862815, "Alderlake HDMI", patch_i915_tgl_hdmi), 4399 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_tgl_hdmi),4400 4416 HDA_CODEC_ENTRY(0x80862816, "Rocketlake HDMI", patch_i915_tgl_hdmi), 4417 HDA_CODEC_ENTRY(0x80862819, "DG2 HDMI", patch_i915_tgl_hdmi), 4401 4418 HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI", patch_i915_icl_hdmi), 4402 4419 HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI", patch_i915_icl_hdmi), 4420 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_tgl_hdmi), 4403 4421 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), 4404 4422 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/patch_realtek.c
r710 r711 103 103 struct alc_coef_led mute_led_coef; 104 104 struct alc_coef_led mic_led_coef; 105 struct mutex coef_mutex; 105 106 106 107 hda_nid_t headset_mic_pin; … … 138 139 */ 139 140 140 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 141 unsigned int coef_idx) 141 static void coef_mutex_lock(struct hda_codec *codec) 142 { 143 struct alc_spec *spec = codec->spec; 144 145 snd_hda_power_up_pm(codec); 146 mutex_lock(&spec->coef_mutex); 147 } 148 149 static void coef_mutex_unlock(struct hda_codec *codec) 150 { 151 struct alc_spec *spec = codec->spec; 152 153 mutex_unlock(&spec->coef_mutex); 154 snd_hda_power_down_pm(codec); 155 } 156 157 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 158 unsigned int coef_idx) 142 159 { 143 160 unsigned int val; … … 148 165 } 149 166 167 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 168 unsigned int coef_idx) 169 { 170 unsigned int val; 171 172 coef_mutex_lock(codec); 173 val = __alc_read_coefex_idx(codec, nid, coef_idx); 174 coef_mutex_unlock(codec); 175 return val; 176 } 177 150 178 #define alc_read_coef_idx(codec, coef_idx) \ 151 179 alc_read_coefex_idx(codec, 0x20, coef_idx) 152 180 181 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 182 unsigned int coef_idx, unsigned int coef_val) 183 { 184 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 185 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); 186 } 187 153 188 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 154 189 unsigned int coef_idx, unsigned int coef_val) 155 190 { 156 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 157 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); 191 coef_mutex_lock(codec); 192 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); 193 coef_mutex_unlock(codec); 158 194 } 159 195 160 196 #define alc_write_coef_idx(codec, coef_idx, coef_val) \ 161 197 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) 198 199 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 200 unsigned int coef_idx, unsigned int mask, 201 unsigned int bits_set) 202 { 203 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx); 204 205 if (val != -1) 206 __alc_write_coefex_idx(codec, nid, coef_idx, 207 (val & ~mask) | bits_set); 208 } 162 209 163 210 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, … … 165 212 unsigned int bits_set) 166 213 { 167 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); 168 169 if (val != -1) 170 alc_write_coefex_idx(codec, nid, coef_idx, 171 (val & ~mask) | bits_set); 214 coef_mutex_lock(codec); 215 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); 216 coef_mutex_unlock(codec); 172 217 } 173 218 … … 202 247 const struct coef_fw *fw) 203 248 { 249 coef_mutex_lock(codec); 204 250 for (; fw->nid; fw++) { 205 251 if (fw->mask == (unsigned short)-1) 206 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);252 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); 207 253 else 208 alc_update_coefex_idx(codec, fw->nid, fw->idx, 209 fw->mask, fw->val); 210 } 254 __alc_update_coefex_idx(codec, fw->nid, fw->idx, 255 fw->mask, fw->val); 256 } 257 coef_mutex_unlock(codec); 211 258 } 212 259 … … 399 446 case 0x10ec0255: 400 447 case 0x10ec0256: 448 case 0x19e58326: 401 449 case 0x10ec0257: 402 450 case 0x10ec0282: … … 536 584 case 0x10ec0236: 537 585 case 0x10ec0256: 586 case 0x19e58326: 538 587 case 0x10ec0283: 539 588 case 0x10ec0286: … … 894 943 } 895 944 945 #define alc_free snd_hda_gen_free 946 947 #ifdef CONFIG_PM 896 948 static inline void alc_shutup(struct hda_codec *codec) 897 949 { … … 907 959 } 908 960 909 #define alc_free snd_hda_gen_free910 911 #ifdef CONFIG_PM912 961 static void alc_power_eapd(struct hda_codec *codec) 913 962 { … … 923 972 return 0; 924 973 } 925 #endif 926 927 #ifdef CONFIG_PM 974 928 975 static int alc_resume(struct hda_codec *codec) 929 976 { … … 1157 1204 codec->forced_resume = 1; 1158 1205 codec->patch_ops = alc_patch_ops; 1206 mutex_init(&spec->coef_mutex); 1159 1207 1160 1208 err = alc_codec_rename_from_preset(codec); … … 2285 2333 ALC887_FIXUP_BASS_CHMAP, 2286 2334 ALC1220_FIXUP_GB_DUAL_CODECS, 2335 ALC1220_FIXUP_GB_X570, 2287 2336 ALC1220_FIXUP_CLEVO_P950, 2288 2337 ALC1220_FIXUP_CLEVO_PB51ED, … … 2290 2339 ALC887_FIXUP_ASUS_AUDIO, 2291 2340 ALC887_FIXUP_ASUS_HMIC, 2341 ALCS1200A_FIXUP_MIC_VREF, 2292 2342 }; 2293 2343 … … 2470 2520 "Rear-Panel Capture Switch" : 2471 2521 "Front-Panel Capture Switch"); 2522 break; 2523 } 2524 } 2525 2526 static void alc1220_fixup_gb_x570(struct hda_codec *codec, 2527 const struct hda_fixup *fix, 2528 int action) 2529 { 2530 static const hda_nid_t conn1[] = { 0x0c }; 2531 static const struct coef_fw gb_x570_coefs[] = { 2532 WRITE_COEF(0x07, 0x03c0), 2533 WRITE_COEF(0x1a, 0x01c1), 2534 WRITE_COEF(0x1b, 0x0202), 2535 WRITE_COEF(0x43, 0x3005), 2536 {0} 2537 }; 2538 2539 switch (action) { 2540 case HDA_FIXUP_ACT_PRE_PROBE: 2541 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2542 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2543 break; 2544 case HDA_FIXUP_ACT_INIT: 2545 alc_process_coef_fw(codec, gb_x570_coefs); 2472 2546 break; 2473 2547 } … … 2962 3036 .v.func = alc1220_fixup_gb_dual_codecs, 2963 3037 }, 3038 [ALC1220_FIXUP_GB_X570] = { 3039 .type = HDA_FIXUP_FUNC, 3040 .v.func = alc1220_fixup_gb_x570, 3041 }, 2964 3042 [ALC1220_FIXUP_CLEVO_P950] = { 2965 3043 .type = HDA_FIXUP_FUNC, … … 2995 3073 .chain_id = ALC887_FIXUP_ASUS_AUDIO, 2996 3074 }, 3075 #ifdef TARGET_OS2xxx 3076 [ALCS1200A_FIXUP_MIC_VREF] = { 3077 .type = HDA_FIXUP_PINCTLS, 3078 .v.pins = (const struct hda_pintbl[]) { 3079 { 0x18, PIN_VREF50 }, /* rear mic */ 3080 { 0x19, PIN_VREF50 }, /* front mic */ 3081 {} 3082 } 3083 }, 3084 #endif 2997 3085 }; 2998 3086 … … 3032 3120 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), 3033 3121 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), 3122 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF), 3034 3123 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), 3035 3124 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), … … 3066 3155 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 3067 3156 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 3068 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), 3069 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), 3157 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), 3158 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570), 3159 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570), 3070 3160 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), 3071 3161 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), … … 3085 3175 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3086 3176 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3177 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3087 3178 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3088 3179 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3089 3180 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3181 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3182 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3090 3183 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 3091 3184 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), … … 3141 3234 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, 3142 3235 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, 3236 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"}, 3143 3237 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, 3144 3238 {0} … … 3689 3783 ALC269_TYPE_ALC215, 3690 3784 ALC269_TYPE_ALC225, 3785 ALC269_TYPE_ALC245, 3691 3786 ALC269_TYPE_ALC287, 3692 3787 ALC269_TYPE_ALC294, … … 3726 3821 case ALC269_TYPE_ALC215: 3727 3822 case ALC269_TYPE_ALC225: 3823 case ALC269_TYPE_ALC245: 3728 3824 case ALC269_TYPE_ALC287: 3729 3825 case ALC269_TYPE_ALC294: … … 3795 3891 case 0x10ec0236: 3796 3892 case 0x10ec0256: 3893 case 0x19e58326: 3797 3894 alc_write_coef_idx(codec, 0x48, 0x0); 3798 3895 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); … … 3823 3920 case 0x10ec0236: 3824 3921 case 0x10ec0256: 3922 case 0x19e58326: 3825 3923 alc_write_coef_idx(codec, 0x48, 0xd011); 3826 3924 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); … … 4176 4274 * when booting with headset plugged. So skip setting it for the codec alc257 4177 4275 */ 4178 if ( spec->codec_variant != ALC269_TYPE_ALC257&&4179 spec->codec_variant != ALC269_TYPE_ALC256)4276 if (codec->core.vendor_id != 0x10ec0236 && 4277 codec->core.vendor_id != 0x10ec0257) 4180 4278 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 4181 4279 … … 4255 4353 bool hp1_pin_sense, hp2_pin_sense; 4256 4354 4257 if (spec->codec_variant != ALC269_TYPE_ALC287) 4355 if (spec->codec_variant != ALC269_TYPE_ALC287 && 4356 spec->codec_variant != ALC269_TYPE_ALC245) 4258 4357 /* required only at boot or S3 and S4 resume time */ 4259 4358 #ifndef TARGET_OS2 … … 5018 5117 { 5019 5118 alc_fixup_hp_gpio_led(codec, action, 0x10, 0); 5119 } 5120 5121 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, 5122 const struct hda_fixup *fix, int action) 5123 { 5124 struct alc_spec *spec = codec->spec; 5125 5126 if (action == HDA_FIXUP_ACT_PRE_PROBE) 5127 spec->micmute_led_polarity = 1; 5128 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 5020 5129 } 5021 5130 … … 5494 5603 case 0x10ec0236: 5495 5604 case 0x10ec0256: 5605 case 0x19e58326: 5496 5606 alc_process_coef_fw(codec, coef0256); 5497 5607 break; … … 5609 5719 case 0x10ec0236: 5610 5720 case 0x10ec0256: 5721 case 0x19e58326: 5611 5722 alc_write_coef_idx(codec, 0x45, 0xc489); 5612 5723 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); … … 5759 5870 case 0x10ec0236: 5760 5871 case 0x10ec0256: 5872 case 0x19e58326: 5761 5873 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5762 5874 alc_write_coef_idx(codec, 0x45, 0xc089); … … 5858 5970 case 0x10ec0236: 5859 5971 case 0x10ec0256: 5972 case 0x19e58326: 5860 5973 alc_process_coef_fw(codec, coef0256); 5861 5974 break; … … 5972 6085 case 0x10ec0236: 5973 6086 case 0x10ec0256: 6087 case 0x19e58326: 5974 6088 alc_process_coef_fw(codec, coef0256); 5975 6089 break; … … 6073 6187 case 0x10ec0236: 6074 6188 case 0x10ec0256: 6189 case 0x19e58326: 6075 6190 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 6076 6191 alc_write_coef_idx(codec, 0x06, 0x6104); … … 6369 6484 case 0x10ec0236: 6370 6485 case 0x10ec0256: 6486 case 0x19e58326: 6371 6487 alc_process_coef_fw(codec, alc256fw); 6372 6488 break; … … 6972 7088 case 0x10ec0255: 6973 7089 case 0x10ec0256: 7090 case 0x19e58326: 6974 7091 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ 6975 7092 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); … … 7188 7305 #include "ideapad_s740_helper.c" 7189 7306 7190 static void alc256_fixup_tongfang_reset_persistent_settings(struct hda_codec *codec, 7191 const struct hda_fixup *fix, 7192 int action) 7307 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = { 7308 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000), 7309 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000), 7310 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089), 7311 {0} 7312 }; 7313 7314 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec, 7315 const struct hda_fixup *fix, 7316 int action) 7193 7317 { 7194 7318 /* 7195 * A certain other OS sets these coeffs to different values. On at least one TongFang 7196 * barebone these settings might survive even a cold reboot. So to restore a clean slate the 7197 * values are explicitly reset to default here. Without this, the external microphone is 7198 * always in a plugged-in state, while the internal microphone is always in an unplugged 7199 * state, breaking the ability to use the internal microphone. 7200 */ 7201 alc_write_coef_idx(codec, 0x24, 0x0000); 7202 alc_write_coef_idx(codec, 0x26, 0x0000); 7203 alc_write_coef_idx(codec, 0x29, 0x3000); 7204 alc_write_coef_idx(codec, 0x37, 0xfe05); 7205 alc_write_coef_idx(codec, 0x45, 0x5089); 7319 * A certain other OS sets these coeffs to different values. On at least 7320 * one TongFang barebone these settings might survive even a cold 7321 * reboot. So to restore a clean slate the values are explicitly reset 7322 * to default here. Without this, the external microphone is always in a 7323 * plugged-in state, while the internal microphone is always in an 7324 * unplugged state, breaking the ability to use the internal microphone. 7325 */ 7326 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs); 7327 } 7328 7329 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { 7330 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06), 7331 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074), 7332 WRITE_COEF(0x49, 0x0149), 7333 {0} 7334 }; 7335 7336 static void alc233_fixup_no_audio_jack(struct hda_codec *codec, 7337 const struct hda_fixup *fix, 7338 int action) 7339 { 7340 /* 7341 * The audio jack input and output is not detected on the ASRock NUC Box 7342 * 1100 series when cold booting without this fix. Warm rebooting from a 7343 * certain other OS makes the audio functional, as COEF settings are 7344 * preserved in this case. This fix sets these altered COEF values as 7345 * the default. 7346 */ 7347 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); 7348 } 7349 7350 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, 7351 const struct hda_fixup *fix, 7352 int action) 7353 { 7354 /* 7355 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, 7356 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec 7357 * needs an additional quirk for sound working after suspend and resume. 7358 */ 7359 if (codec->core.vendor_id == 0x10ec0256) { 7360 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 7361 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); 7362 } else { 7363 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); 7364 } 7206 7365 } 7207 7366 … … 7319 7478 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, 7320 7479 ALC269_FIXUP_ATIV_BOOK_8, 7480 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE, 7321 7481 ALC221_FIXUP_HP_MIC_NO_PRESENCE, 7322 7482 ALC256_FIXUP_ASUS_HEADSET_MODE, … … 7380 7540 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 7381 7541 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7542 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7382 7543 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 7383 7544 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, … … 7405 7566 ALC287_FIXUP_HP_GPIO_LED, 7406 7567 ALC256_FIXUP_HP_HEADSET_MIC, 7568 ALC245_FIXUP_HP_GPIO_LED, 7407 7569 ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 7408 7570 ALC282_FIXUP_ACER_DISABLE_LINEOUT, … … 7421 7583 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, 7422 7584 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, 7585 ALC298_FIXUP_LENOVO_C940_DUET7, 7423 7586 ALC287_FIXUP_13S_GEN2_SPEAKERS, 7424 ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS, 7425 }; 7587 ALC256_FIXUP_SET_COEF_DEFAULTS, 7588 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 7589 ALC233_FIXUP_NO_AUDIO_JACK, 7590 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, 7591 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, 7592 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 7593 }; 7594 7595 /* A special fixup for Lenovo C940 and Yoga Duet 7; 7596 * both have the very same PCI SSID, and we need to apply different fixups 7597 * depending on the codec ID 7598 */ 7599 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec, 7600 const struct hda_fixup *fix, 7601 int action) 7602 { 7603 int id; 7604 7605 if (codec->core.vendor_id == 0x10ec0298) 7606 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */ 7607 else 7608 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */ 7609 __snd_hda_apply_fixup(codec, id, action, 0); 7610 } 7426 7611 7427 7612 #ifdef TARGET_OS2 … … 8316 8501 .type = HDA_FIXUP_FUNC, 8317 8502 .v.func = alc245_fixup_hp_x360_amp, 8503 .chained = true, 8504 .chain_id = ALC245_FIXUP_HP_GPIO_LED 8318 8505 }, 8319 8506 [ALC288_FIXUP_DELL_HEADSET_MODE] = { … … 8517 8704 }, 8518 8705 #ifdef TARGET_OS2xxx 8706 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = { 8707 .type = HDA_FIXUP_PINS, 8708 .v.pins = (const struct hda_pintbl[]) { 8709 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8710 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */ 8711 { } 8712 }, 8713 .chained = true, 8714 .chain_id = ALC269_FIXUP_HEADSET_MODE 8715 }, 8519 8716 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { 8520 8717 .type = HDA_FIXUP_PINS, … … 9016 9213 }, 9017 9214 }, 9215 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 9216 .type = HDA_FIXUP_VERBS, 9217 .v.verbs = (const struct hda_verb[]) { 9218 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 9219 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf}, 9220 { } 9221 }, 9222 }, 9018 9223 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { 9019 9224 .type = HDA_FIXUP_PINS, … … 9328 9533 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 9329 9534 }, 9535 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = { 9536 .type = HDA_FIXUP_FUNC, 9537 .v.func = alc285_fixup_ideapad_s740_coef, 9538 .chained = true, 9539 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 9540 }, 9541 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = { 9542 .type = HDA_FIXUP_FUNC, 9543 .v.func = alc287_fixup_legion_15imhg05_speakers, 9544 .chained = true, 9545 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 9546 }, 9330 9547 #ifdef TARGET_OS2xxx 9331 9548 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { … … 9415 9632 .chained = true, 9416 9633 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9634 }, 9635 [ALC298_FIXUP_LENOVO_C940_DUET7] = { 9636 .type = HDA_FIXUP_FUNC, 9637 .v.func = alc298_fixup_lenovo_c940_duet7, 9417 9638 }, 9418 9639 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { … … 9439 9660 }, 9440 9661 #endif 9441 [ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS] = { 9442 .type = HDA_FIXUP_FUNC, 9443 .v.func = alc256_fixup_tongfang_reset_persistent_settings, 9662 [ALC256_FIXUP_SET_COEF_DEFAULTS] = { 9663 .type = HDA_FIXUP_FUNC, 9664 .v.func = alc256_fixup_set_coef_defaults, 9665 }, 9666 #ifdef TARGET_OS2xxx 9667 [ALC245_FIXUP_HP_GPIO_LED] = { 9668 .type = HDA_FIXUP_FUNC, 9669 .v.func = alc245_fixup_hp_gpio_led, 9670 }, 9671 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 9672 .type = HDA_FIXUP_PINS, 9673 .v.pins = (const struct hda_pintbl[]) { 9674 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */ 9675 { } 9676 }, 9677 .chained = true, 9678 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 9679 }, 9680 #endif 9681 [ALC233_FIXUP_NO_AUDIO_JACK] = { 9682 .type = HDA_FIXUP_FUNC, 9683 .v.func = alc233_fixup_no_audio_jack, 9684 }, 9685 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = { 9686 .type = HDA_FIXUP_FUNC, 9687 .v.func = alc256_fixup_mic_no_presence_and_resume, 9688 .chained = true, 9689 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9444 9690 }, 9445 9691 }; … … 9475 9721 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 9476 9722 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), 9723 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 9477 9724 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 9478 9725 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 9479 9726 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 9480 9727 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 9728 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 9481 9729 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 9482 9730 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 9483 9731 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 9484 9732 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 9733 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), 9485 9734 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), 9486 9735 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), … … 9537 9786 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 9538 9787 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 9788 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), 9539 9789 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 9540 9790 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), … … 9596 9846 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 9597 9847 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 9848 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE), 9598 9849 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 9599 9850 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), … … 9612 9863 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 9613 9864 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 9865 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9614 9866 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9615 9867 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), … … 9618 9870 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9619 9871 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), 9872 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED), 9620 9873 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), 9621 9874 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9875 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9622 9876 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9623 9877 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), … … 9628 9882 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", 9629 9883 ALC285_FIXUP_HP_GPIO_AMP_INIT), 9884 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 9885 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 9630 9886 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), 9631 9887 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), … … 9654 9910 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9655 9911 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 9912 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED), 9913 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED), 9914 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9915 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9916 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), 9917 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), 9918 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED), 9919 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED), 9656 9920 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 9657 9921 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), … … 9679 9943 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 9680 9944 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), 9945 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), 9681 9946 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), 9682 9947 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), … … 9694 9959 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), 9695 9960 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 9961 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), 9962 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 9696 9963 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), 9697 9964 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), … … 9726 9993 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 9727 9994 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 9995 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 9728 9996 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 9729 9997 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), … … 9742 10010 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9743 10011 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10012 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10013 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9744 10014 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9745 10015 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9747 10017 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9748 10018 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10019 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10020 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9749 10021 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9750 10022 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9761 10033 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9762 10034 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10035 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10036 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9763 10037 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9764 10038 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9772 10046 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 9773 10047 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10048 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10049 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10050 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9774 10051 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9775 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC2 93_FIXUP_SYSTEM76_MIC_NO_PRESENCE),10052 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), 9776 10053 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9777 10054 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 9839 10116 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 9840 10117 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 9841 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), 10118 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10119 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 10120 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), 10121 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), 10122 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10123 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 9842 10124 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 10125 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10126 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 9843 10127 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), 9844 SND_PCI_QUIRK(0x17aa, 0x38 13, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),10128 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 9845 10129 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 9846 10130 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 9847 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),9848 10131 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 9849 10132 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), … … 9865 10148 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9866 10149 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10150 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 9867 10151 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 9868 10152 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9869 10153 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9870 10154 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 10155 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 9871 10156 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 9872 10157 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), … … 9876 10161 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 9877 10162 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 9878 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS), 10163 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 10164 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), 10165 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP), 10166 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10167 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10168 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10169 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10170 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10171 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP), 9879 10172 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 9880 10173 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), 9881 10174 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 10175 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 9882 10176 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 9883 10177 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), … … 10057 10351 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, 10058 10352 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, 10353 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"}, 10059 10354 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, 10060 10355 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, … … 10066 10361 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, 10067 10362 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, 10363 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, 10068 10364 {0} 10069 10365 }; … … 10661 10957 case 0x10ec0236: 10662 10958 case 0x10ec0256: 10959 case 0x19e58326: 10663 10960 spec->codec_variant = ALC269_TYPE_ALC256; 10664 10961 spec->shutup = alc256_shutup; … … 10676 10973 case 0x10ec0285: 10677 10974 case 0x10ec0289: 10678 spec->codec_variant = ALC269_TYPE_ALC215; 10975 if (alc_get_coef0(codec) & 0x0010) 10976 spec->codec_variant = ALC269_TYPE_ALC245; 10977 else 10978 spec->codec_variant = ALC269_TYPE_ALC215; 10679 10979 spec->shutup = alc225_shutup; 10680 10980 spec->init_hook = alc225_init; … … 11218 11518 alc_write_coef_idx(codec, 0x19, 0xa054); 11219 11519 break; 11520 } 11521 } 11522 11523 static void alc897_hp_automute_hook(struct hda_codec *codec, 11524 struct hda_jack_callback *jack) 11525 { 11526 struct alc_spec *spec = codec->spec; 11527 int vref; 11528 11529 snd_hda_gen_hp_automute(codec, jack); 11530 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP; 11531 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 11532 vref); 11533 } 11534 11535 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, 11536 const struct hda_fixup *fix, int action) 11537 { 11538 struct alc_spec *spec = codec->spec; 11539 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 11540 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 11220 11541 } 11221 11542 } … … 11301 11622 ALC668_FIXUP_HEADSET_MIC, 11302 11623 ALC668_FIXUP_MIC_DET_COEF, 11624 ALC897_FIXUP_LENOVO_HEADSET_MIC, 11625 ALC897_FIXUP_HEADSET_MIC_PIN, 11626 ALC897_FIXUP_HP_HSMIC_VERB, 11303 11627 }; 11304 11628 … … 11891 12215 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, 11892 12216 {} 12217 }, 12218 }, 12219 #endif 12220 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = { 12221 .type = HDA_FIXUP_FUNC, 12222 .v.func = alc897_fixup_lenovo_headset_mic, 12223 }, 12224 #ifdef TARGET_OS2xxx 12225 [ALC897_FIXUP_HEADSET_MIC_PIN] = { 12226 .type = HDA_FIXUP_PINS, 12227 .v.pins = (const struct hda_pintbl[]) { 12228 { 0x1a, 0x03a11050 }, 12229 { } 12230 }, 12231 .chained = true, 12232 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC 12233 }, 12234 [ALC897_FIXUP_HP_HSMIC_VERB] = { 12235 .type = HDA_FIXUP_PINS, 12236 .v.pins = (const struct hda_pintbl[]) { 12237 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 12238 { } 11893 12239 }, 11894 12240 }, … … 11919 12265 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 11920 12266 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 12267 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 11921 12268 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), 12269 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2), 12270 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2), 11922 12271 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), 11923 12272 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), … … 11938 12287 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), 11939 12288 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), 12289 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN), 12290 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN), 12291 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN), 12292 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), 12293 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), 11940 12294 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 11941 12295 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), … … 12296 12650 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), 12297 12651 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), 12652 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269), 12298 12653 {0} /* terminator */ 12299 12654 }; -
GPL/branches/uniaud32-next/alsa-kernel/pci/hda/patch_via.c
r696 r711 529 529 return err; 530 530 531 err = auto_parse_beep(codec); 532 if (err < 0) 533 return err; 534 531 535 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); 532 if (err < 0)533 return err;534 535 err = auto_parse_beep(codec);536 536 if (err < 0) 537 537 return err; -
GPL/branches/uniaud32-next/alsa-kernel/pci/intel8x0.c
r710 r711 3143 3143 } 3144 3144 3145 static int snd_intel8x0_probe(struct pci_dev *pci,3146 3145 static int __snd_intel8x0_probe(struct pci_dev *pci, 3146 const struct pci_device_id *pci_id) 3147 3147 { 3148 3148 struct snd_card *card; … … 3223 3223 } 3224 3224 3225 static int snd_intel8x0_probe(struct pci_dev *pci, 3226 const struct pci_device_id *pci_id) 3227 { 3228 return snd_card_free_on_error(&pci->dev, __snd_intel8x0_probe(pci, pci_id)); 3229 } 3230 3225 3231 static struct pci_driver intel8x0_driver = { 3226 3232 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/korg1212/korg1212.c
r710 r711 2356 2356 err = snd_korg1212_create(card, pci); 2357 2357 if (err < 0) 2358 return err;2358 goto error; 2359 2359 2360 2360 strcpy(card->driver, "korg1212"); … … 2367 2367 err = snd_card_register(card); 2368 2368 if (err < 0) 2369 return err;2369 goto error; 2370 2370 pci_set_drvdata(pci, card); 2371 2371 dev++; 2372 2372 return 0; 2373 2374 error: 2375 snd_card_free(card); 2376 return err; 2373 2377 } 2374 2378 -
GPL/branches/uniaud32-next/alsa-kernel/pci/maestro3.c
r710 r711 2662 2662 */ 2663 2663 static int 2664 snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)2664 __snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2665 2665 { 2666 2666 static int dev; … … 2727 2727 } 2728 2728 2729 static int 2730 snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2731 { 2732 return snd_card_free_on_error(&pci->dev, __snd_m3_probe(pci, pci_id)); 2733 } 2734 2729 2735 static struct pci_driver m3_driver = { 2730 2736 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/pci/nm256/nm256.c
r710 r711 1578 1578 1579 1579 snd_nm256_init_chip(chip); 1580 card->private_free = snd_nm256_free;1581 1580 1582 1581 // pci_set_master(pci); /* needed? */ … … 1685 1684 if (err < 0) 1686 1685 return err; 1686 card->private_free = snd_nm256_free; 1687 1687 1688 1688 pci_set_drvdata(pci, card); -
GPL/branches/uniaud32-next/alsa-kernel/pci/rme9652/hdsp.c
r710 r711 469 469 u32 io_loopback; /* output loopback channel states*/ 470 470 471 struct snd_dma_buffer *capture_dma_buf; 472 struct snd_dma_buffer *playback_dma_buf; 471 /* DMA buffers; those are copied instances from the original snd_dma_buf 472 * objects (which are managed via devres) for the address alignments 473 */ 474 struct snd_dma_buffer capture_dma_buf; 475 struct snd_dma_buffer playback_dma_buf; 473 476 unsigned char *capture_buffer; /* suitably aligned address */ 474 477 unsigned char *playback_buffer; /* suitably aligned address */ … … 3765 3768 static int snd_hdsp_initialize_memory(struct hdsp *hdsp) 3766 3769 { 3767 unsigned long pb_bus, cb_bus; 3768 3769 hdsp->capture_dma_buf = 3770 snd_hammerfall_get_buffer(hdsp->pci, HDSP_DMA_AREA_BYTES); 3771 hdsp->playback_dma_buf = 3772 snd_hammerfall_get_buffer(hdsp->pci, HDSP_DMA_AREA_BYTES); 3773 if (!hdsp->capture_dma_buf || !hdsp->playback_dma_buf) { 3770 struct snd_dma_buffer *capture_dma, *playback_dma; 3771 3772 capture_dma = snd_hammerfall_get_buffer(hdsp->pci, HDSP_DMA_AREA_BYTES); 3773 playback_dma = snd_hammerfall_get_buffer(hdsp->pci, HDSP_DMA_AREA_BYTES); 3774 if (!capture_dma || !playback_dma) { 3774 3775 dev_err(hdsp->card->dev, 3775 3776 "%s: no buffers available\n", hdsp->card_name); … … 3777 3778 } 3778 3779 3780 /* copy to the own data for alignment */ 3781 hdsp->capture_dma_buf = *capture_dma; 3782 hdsp->playback_dma_buf = *playback_dma; 3783 3779 3784 /* Align to bus-space 64K boundary */ 3780 3781 cb_bus = ALIGN(hdsp->capture_dma_buf->addr, 0x10000ul); 3782 pb_bus = ALIGN(hdsp->playback_dma_buf->addr, 0x10000ul); 3785 hdsp->capture_dma_buf.addr = ALIGN(capture_dma->addr, 0x10000ul); 3786 hdsp->playback_dma_buf.addr = ALIGN(playback_dma->addr, 0x10000ul); 3783 3787 3784 3788 /* Tell the card where it is */ 3785 3786 hdsp_write(hdsp, HDSP_inputBufferAddress, cb_bus); 3787 hdsp_write(hdsp, HDSP_outputBufferAddress, pb_bus); 3788 3789 hdsp->capture_buffer = hdsp->capture_dma_buf->area + (cb_bus - hdsp->capture_dma_buf->addr); 3790 hdsp->playback_buffer = hdsp->playback_dma_buf->area + (pb_bus - hdsp->playback_dma_buf->addr); 3789 hdsp_write(hdsp, HDSP_inputBufferAddress, hdsp->capture_dma_buf.addr); 3790 hdsp_write(hdsp, HDSP_outputBufferAddress, hdsp->playback_dma_buf.addr); 3791 3792 hdsp->capture_dma_buf.area += hdsp->capture_dma_buf.addr - capture_dma->addr; 3793 hdsp->playback_dma_buf.area += hdsp->playback_dma_buf.addr - playback_dma->addr; 3794 hdsp->capture_buffer = hdsp->capture_dma_buf.area; 3795 hdsp->playback_buffer = hdsp->playback_dma_buf.area; 3791 3796 3792 3797 return 0; … … 4508 4513 4509 4514 runtime->hw = snd_hdsp_playback_subinfo; 4510 snd_pcm_set_runtime_buffer(substream, hdsp->playback_dma_buf);4515 snd_pcm_set_runtime_buffer(substream, &hdsp->playback_dma_buf); 4511 4516 4512 4517 hdsp->playback_pid = current->pid; … … 4584 4589 4585 4590 runtime->hw = snd_hdsp_capture_subinfo; 4586 snd_pcm_set_runtime_buffer(substream, hdsp->capture_dma_buf);4591 snd_pcm_set_runtime_buffer(substream, &hdsp->capture_dma_buf); 4587 4592 4588 4593 hdsp->capture_pid = current->pid; … … 5440 5445 err = snd_hdsp_create(card, hdsp); 5441 5446 if (err) 5442 return err;5447 goto error; 5443 5448 5444 5449 strcpy(card->shortname, "Hammerfall DSP"); … … 5447 5452 err = snd_card_register(card); 5448 5453 if (err) 5449 return err;5454 goto error; 5450 5455 pci_set_drvdata(pci, card); 5451 5456 dev++; 5452 5457 return 0; 5458 5459 error: 5460 snd_card_free(card); 5461 return err; 5453 5462 } 5454 5463 -
GPL/branches/uniaud32-next/alsa-kernel/pci/rme9652/hdspm.c
r710 r711 6896 6896 err = snd_hdspm_create(card, hdspm); 6897 6897 if (err < 0) 6898 return err;6898 goto error; 6899 6899 6900 6900 if (hdspm->io_type != MADIface) { … … 6915 6915 err = snd_card_register(card); 6916 6916 if (err < 0) 6917 return err;6917 goto error; 6918 6918 6919 6919 pci_set_drvdata(pci, card); … … 6921 6921 dev++; 6922 6922 return 0; 6923 6924 error: 6925 snd_card_free(card); 6926 return err; 6923 6927 } 6924 6928 -
GPL/branches/uniaud32-next/alsa-kernel/pci/rme9652/rme9652.c
r710 r711 209 209 unsigned char ss_channels; /* different for hammerfall/hammerfall-light */ 210 210 211 struct snd_dma_buffer *playback_dma_buf; 212 struct snd_dma_buffer *capture_dma_buf; 211 /* DMA buffers; those are copied instances from the original snd_dma_buf 212 * objects (which are managed via devres) for the address alignments 213 */ 214 struct snd_dma_buffer playback_dma_buf; 215 struct snd_dma_buffer capture_dma_buf; 213 216 214 217 unsigned char *capture_buffer; /* suitably aligned address */ … … 1720 1723 static int snd_rme9652_initialize_memory(struct snd_rme9652 *rme9652) 1721 1724 { 1722 unsigned long pb_bus, cb_bus; 1723 1724 rme9652->capture_dma_buf = 1725 snd_hammerfall_get_buffer(rme9652->pci, RME9652_DMA_AREA_BYTES); 1726 rme9652->playback_dma_buf = 1727 snd_hammerfall_get_buffer(rme9652->pci, RME9652_DMA_AREA_BYTES); 1728 if (!rme9652->capture_dma_buf || !rme9652->playback_dma_buf) { 1725 struct snd_dma_buffer *capture_dma, *playback_dma; 1726 1727 capture_dma = snd_hammerfall_get_buffer(rme9652->pci, RME9652_DMA_AREA_BYTES); 1728 playback_dma = snd_hammerfall_get_buffer(rme9652->pci, RME9652_DMA_AREA_BYTES); 1729 if (!capture_dma || !playback_dma) { 1729 1730 dev_err(rme9652->card->dev, 1730 1731 "%s: no buffers available\n", rme9652->card_name); … … 1732 1733 } 1733 1734 1735 /* copy to the own data for alignment */ 1736 rme9652->capture_dma_buf = *capture_dma; 1737 rme9652->playback_dma_buf = *playback_dma; 1738 1734 1739 /* Align to bus-space 64K boundary */ 1735 1736 cb_bus = ALIGN(rme9652->capture_dma_buf->addr, 0x10000ul); 1737 pb_bus = ALIGN(rme9652->playback_dma_buf->addr, 0x10000ul); 1740 rme9652->capture_dma_buf.addr = ALIGN(capture_dma->addr, 0x10000ul); 1741 rme9652->playback_dma_buf.addr = ALIGN(playback_dma->addr, 0x10000ul); 1738 1742 1739 1743 /* Tell the card where it is */ 1740 1741 rme9652_write(rme9652, RME9652_rec_buffer, cb_bus); 1742 rme9652_write(rme9652, RME9652_play_buffer, pb_bus); 1743 1744 rme9652->capture_buffer = rme9652->capture_dma_buf->area + (cb_bus - rme9652->capture_dma_buf->addr); 1745 rme9652->playback_buffer = rme9652->playback_dma_buf->area + (pb_bus - rme9652->playback_dma_buf->addr); 1744 rme9652_write(rme9652, RME9652_rec_buffer, rme9652->capture_dma_buf.addr); 1745 rme9652_write(rme9652, RME9652_play_buffer, rme9652->playback_dma_buf.addr); 1746 1747 rme9652->capture_dma_buf.area += rme9652->capture_dma_buf.addr - capture_dma->addr; 1748 rme9652->playback_dma_buf.area += rme9652->playback_dma_buf.addr - playback_dma->addr; 1749 rme9652->capture_buffer = rme9652->capture_dma_buf.area; 1750 rme9652->playback_buffer = rme9652->playback_dma_buf.area; 1746 1751 1747 1752 return 0; … … 2260 2265 2261 2266 runtime->hw = snd_rme9652_playback_subinfo; 2262 snd_pcm_set_runtime_buffer(substream, rme9652->playback_dma_buf);2267 snd_pcm_set_runtime_buffer(substream, &rme9652->playback_dma_buf); 2263 2268 2264 2269 if (rme9652->capture_substream == NULL) { … … 2319 2324 2320 2325 runtime->hw = snd_rme9652_capture_subinfo; 2321 snd_pcm_set_runtime_buffer(substream, rme9652->capture_dma_buf);2326 snd_pcm_set_runtime_buffer(substream, &rme9652->capture_dma_buf); 2322 2327 2323 2328 if (rme9652->playback_substream == NULL) { … … 2568 2573 err = snd_rme9652_create(card, rme9652, precise_ptr[dev]); 2569 2574 if (err) 2570 return err;2575 goto error; 2571 2576 2572 2577 strcpy(card->shortname, rme9652->card_name); … … 2576 2581 err = snd_card_register(card); 2577 2582 if (err) 2578 return err;2583 goto error; 2579 2584 pci_set_drvdata(pci, card); 2580 2585 dev++; 2581 2586 return 0; 2587 2588 error: 2589 snd_card_free(card); 2590 return err; 2582 2591 } 2583 2592 -
GPL/branches/uniaud32-next/alsa-kernel/pci/via82xx.c
r710 r711 2479 2479 }; 2480 2480 2481 static int snd_via82xx_probe(struct pci_dev *pci,2482 const struct pci_device_id *pci_id)2481 static int __snd_via82xx_probe(struct pci_dev *pci, 2482 const struct pci_device_id *pci_id) 2483 2483 { 2484 2484 struct snd_card *card; … … 2590 2590 } 2591 2591 2592 static int snd_via82xx_probe(struct pci_dev *pci, 2593 const struct pci_device_id *pci_id) 2594 { 2595 return snd_card_free_on_error(&pci->dev, __snd_via82xx_probe(pci, pci_id)); 2596 } 2597 2592 2598 static struct pci_driver via82xx_driver = { 2593 2599 .name = KBUILD_MODNAME, -
GPL/branches/uniaud32-next/alsa-kernel/synth/emux/emux.c
r697 r711 95 95 emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), 96 96 GFP_KERNEL); 97 if (emu-> voices == NULL)97 if (emu->name == NULL || emu->voices == NULL) 98 98 return -ENOMEM; 99 99 -
GPL/branches/uniaud32-next/include/linux/leds.h
r647 r711 20 20 }; 21 21 22 enum led_audio { 23 LED_AUDIO_MUTE, /* master mute LED */ 24 LED_AUDIO_MICMUTE, /* mic mute LED */ 25 NUM_AUDIO_LEDS 26 }; 22 27 #endif /* _LINUX_LEDS_H */ -
GPL/branches/uniaud32-next/include/linux/pm.h
r686 r711 246 246 struct device * pm_parent; 247 247 struct list_head entry; 248 enum rpm_status runtime_status; 248 249 }; 249 250
Note:
See TracChangeset
for help on using the changeset viewer.