aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-07-25 11:01:14 -0400
committerTakashi Iwai <tiwai@suse.de>2016-07-25 11:01:14 -0400
commitcf81d6b583444cb6f5e656f050e43413b236354e (patch)
tree646567ef019e0bbc5cc9db0e26c464a9fc239481
parent76df52969711ae3725a98f26fbbc6a349803dcbf (diff)
parent275353bb684ecfeb42f7a353fead81d43a01c519 (diff)
Merge branch 'for-next' into for-linus
Merged 4.8 changes.
-rw-r--r--Documentation/sound/alsa/timestamping.txt12
-rw-r--r--sound/core/control.c32
-rw-r--r--sound/core/seq/oss/seq_oss_synth.c10
-rw-r--r--sound/core/seq/seq_timer.c23
-rw-r--r--sound/core/seq/seq_timer.h2
-rw-r--r--sound/hda/hdmi_chmap.c28
-rw-r--r--sound/i2c/other/ak4114.c2
-rw-r--r--sound/i2c/other/ak4117.c2
-rw-r--r--sound/isa/ad1848/ad1848.c13
-rw-r--r--sound/isa/adlib.c13
-rw-r--r--sound/isa/cmi8328.c13
-rw-r--r--sound/isa/cs423x/cs4231.c13
-rw-r--r--sound/isa/galaxy/galaxy.c13
-rw-r--r--sound/isa/gus/gusclassic.c13
-rw-r--r--sound/isa/gus/gusextreme.c13
-rw-r--r--sound/isa/gus/gusmax.c13
-rw-r--r--sound/isa/sb/jazz16.c13
-rw-r--r--sound/isa/sb/sb8.c13
-rw-r--r--sound/isa/sc6000.c13
-rw-r--r--sound/oss/ad1848.c2
-rw-r--r--sound/oss/aedsp16.c14
-rw-r--r--sound/oss/sound_timer.c2
-rw-r--r--sound/oss/sys_timer.c2
-rw-r--r--sound/pci/ctxfi/cthw20k2.c34
-rw-r--r--sound/pci/echoaudio/echoaudio.c6
-rw-r--r--sound/pci/hda/hda_codec.c8
-rw-r--r--sound/pci/hda/hda_generic.c4
-rw-r--r--sound/pci/hda/patch_hdmi.c5
-rw-r--r--sound/pci/hda/patch_realtek.c38
-rw-r--r--sound/pci/mixart/mixart_mixer.c2
-rw-r--r--sound/pci/riptide/riptide.c2
-rw-r--r--sound/ppc/awacs.c1
-rw-r--r--sound/sh/aica.c16
-rw-r--r--sound/usb/mixer_maps.c6
34 files changed, 180 insertions, 216 deletions
diff --git a/Documentation/sound/alsa/timestamping.txt b/Documentation/sound/alsa/timestamping.txt
index 1b6473f393a8..9d579aefbffd 100644
--- a/Documentation/sound/alsa/timestamping.txt
+++ b/Documentation/sound/alsa/timestamping.txt
@@ -14,7 +14,7 @@ provides a refined estimate with a delay.
14event or application query. 14event or application query.
15The difference (tstamp - trigger_tstamp) defines the elapsed time. 15The difference (tstamp - trigger_tstamp) defines the elapsed time.
16 16
17The ALSA API provides reports two basic pieces of information, avail 17The ALSA API provides two basic pieces of information, avail
18and delay, which combined with the trigger and current system 18and delay, which combined with the trigger and current system
19timestamps allow for applications to keep track of the 'fullness' of 19timestamps allow for applications to keep track of the 'fullness' of
20the ring buffer and the amount of queued samples. 20the ring buffer and the amount of queued samples.
@@ -53,21 +53,21 @@ case):
53The analog time is taken at the last stage of the playback, as close 53The analog time is taken at the last stage of the playback, as close
54as possible to the actual transducer 54as possible to the actual transducer
55 55
56The link time is taken at the output of the SOC/chipset as the samples 56The link time is taken at the output of the SoC/chipset as the samples
57are pushed on a link. The link time can be directly measured if 57are pushed on a link. The link time can be directly measured if
58supported in hardware by sample counters or wallclocks (e.g. with 58supported in hardware by sample counters or wallclocks (e.g. with
59HDAudio 24MHz or PTP clock for networked solutions) or indirectly 59HDAudio 24MHz or PTP clock for networked solutions) or indirectly
60estimated (e.g. with the frame counter in USB). 60estimated (e.g. with the frame counter in USB).
61 61
62The DMA time is measured using counters - typically the least reliable 62The DMA time is measured using counters - typically the least reliable
63of all measurements due to the bursty natured of DMA transfers. 63of all measurements due to the bursty nature of DMA transfers.
64 64
65The app time corresponds to the time tracked by an application after 65The app time corresponds to the time tracked by an application after
66writing in the ring buffer. 66writing in the ring buffer.
67 67
68The application can query what the hardware supports, define which 68The application can query the hardware capabilities, define which
69audio time it wants reported by selecting the relevant settings in 69audio time it wants reported by selecting the relevant settings in
70audio_tstamp_config fields, get an estimate of the timestamp 70audio_tstamp_config fields, thus get an estimate of the timestamp
71accuracy. It can also request the delay-to-analog be included in the 71accuracy. It can also request the delay-to-analog be included in the
72measurement. Direct access to the link time is very interesting on 72measurement. Direct access to the link time is very interesting on
73platforms that provide an embedded DSP; measuring directly the link 73platforms that provide an embedded DSP; measuring directly the link
@@ -169,7 +169,7 @@ playback: systime: 938107562 nsec, audio time 938112708 nsec, systime delta -51
169Example 1 shows that the timestamp at the DMA level is close to 1ms 169Example 1 shows that the timestamp at the DMA level is close to 1ms
170ahead of the actual playback time (as a side time this sort of 170ahead of the actual playback time (as a side time this sort of
171measurement can help define rewind safeguards). Compensating for the 171measurement can help define rewind safeguards). Compensating for the
172DMA-link delay in example 2 helps remove the hardware buffering abut 172DMA-link delay in example 2 helps remove the hardware buffering but
173the information is still very jittery, with up to one sample of 173the information is still very jittery, with up to one sample of
174error. In example 3 where the timestamps are measured with the link 174error. In example 3 where the timestamps are measured with the link
175wallclock, the timestamps show a monotonic behavior and a lower 175wallclock, the timestamps show a monotonic behavior and a lower
diff --git a/sound/core/control.c b/sound/core/control.c
index b4fe9b002512..fb096cb20a80 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -807,6 +807,36 @@ static int snd_ctl_elem_list(struct snd_card *card,
807 return 0; 807 return 0;
808} 808}
809 809
810static bool validate_element_member_dimension(struct snd_ctl_elem_info *info)
811{
812 unsigned int members;
813 unsigned int i;
814
815 if (info->dimen.d[0] == 0)
816 return true;
817
818 members = 1;
819 for (i = 0; i < ARRAY_SIZE(info->dimen.d); ++i) {
820 if (info->dimen.d[i] == 0)
821 break;
822 members *= info->dimen.d[i];
823
824 /*
825 * info->count should be validated in advance, to guarantee
826 * calculation soundness.
827 */
828 if (members > info->count)
829 return false;
830 }
831
832 for (++i; i < ARRAY_SIZE(info->dimen.d); ++i) {
833 if (info->dimen.d[i] > 0)
834 return false;
835 }
836
837 return members == info->count;
838}
839
810static int snd_ctl_elem_info(struct snd_ctl_file *ctl, 840static int snd_ctl_elem_info(struct snd_ctl_file *ctl,
811 struct snd_ctl_elem_info *info) 841 struct snd_ctl_elem_info *info)
812{ 842{
@@ -1274,6 +1304,8 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
1274 if (info->count < 1 || 1304 if (info->count < 1 ||
1275 info->count > max_value_counts[info->type]) 1305 info->count > max_value_counts[info->type])
1276 return -EINVAL; 1306 return -EINVAL;
1307 if (!validate_element_member_dimension(info))
1308 return -EINVAL;
1277 private_size = value_sizes[info->type] * info->count; 1309 private_size = value_sizes[info->type] * info->count;
1278 1310
1279 /* 1311 /*
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index b16dbef04174..cd0e0ebbfdb1 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -70,11 +70,11 @@ struct seq_oss_synth {
70static int max_synth_devs; 70static int max_synth_devs;
71static struct seq_oss_synth *synth_devs[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS]; 71static struct seq_oss_synth *synth_devs[SNDRV_SEQ_OSS_MAX_SYNTH_DEVS];
72static struct seq_oss_synth midi_synth_dev = { 72static struct seq_oss_synth midi_synth_dev = {
73 -1, /* seq_device */ 73 .seq_device = -1,
74 SYNTH_TYPE_MIDI, /* synth_type */ 74 .synth_type = SYNTH_TYPE_MIDI,
75 0, /* synth_subtype */ 75 .synth_subtype = 0,
76 16, /* nr_voices */ 76 .nr_voices = 16,
77 "MIDI", /* name */ 77 .name = "MIDI",
78}; 78};
79 79
80static DEFINE_SPINLOCK(register_lock); 80static DEFINE_SPINLOCK(register_lock);
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
index 293104926098..dcc102813aef 100644
--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -165,7 +165,7 @@ static void snd_seq_timer_interrupt(struct snd_timer_instance *timeri,
165 snd_seq_timer_update_tick(&tmr->tick, resolution); 165 snd_seq_timer_update_tick(&tmr->tick, resolution);
166 166
167 /* register actual time of this timer update */ 167 /* register actual time of this timer update */
168 do_gettimeofday(&tmr->last_update); 168 ktime_get_ts64(&tmr->last_update);
169 169
170 spin_unlock_irqrestore(&tmr->lock, flags); 170 spin_unlock_irqrestore(&tmr->lock, flags);
171 171
@@ -392,7 +392,7 @@ static int seq_timer_start(struct snd_seq_timer *tmr)
392 return -EINVAL; 392 return -EINVAL;
393 snd_timer_start(tmr->timeri, tmr->ticks); 393 snd_timer_start(tmr->timeri, tmr->ticks);
394 tmr->running = 1; 394 tmr->running = 1;
395 do_gettimeofday(&tmr->last_update); 395 ktime_get_ts64(&tmr->last_update);
396 return 0; 396 return 0;
397} 397}
398 398
@@ -420,7 +420,7 @@ static int seq_timer_continue(struct snd_seq_timer *tmr)
420 } 420 }
421 snd_timer_start(tmr->timeri, tmr->ticks); 421 snd_timer_start(tmr->timeri, tmr->ticks);
422 tmr->running = 1; 422 tmr->running = 1;
423 do_gettimeofday(&tmr->last_update); 423 ktime_get_ts64(&tmr->last_update);
424 return 0; 424 return 0;
425} 425}
426 426
@@ -444,17 +444,12 @@ snd_seq_real_time_t snd_seq_timer_get_cur_time(struct snd_seq_timer *tmr)
444 spin_lock_irqsave(&tmr->lock, flags); 444 spin_lock_irqsave(&tmr->lock, flags);
445 cur_time = tmr->cur_time; 445 cur_time = tmr->cur_time;
446 if (tmr->running) { 446 if (tmr->running) {
447 struct timeval tm; 447 struct timespec64 tm;
448 int usec; 448
449 do_gettimeofday(&tm); 449 ktime_get_ts64(&tm);
450 usec = (int)(tm.tv_usec - tmr->last_update.tv_usec); 450 tm = timespec64_sub(tm, tmr->last_update);
451 if (usec < 0) { 451 cur_time.tv_nsec = tm.tv_nsec;
452 cur_time.tv_nsec += (1000000 + usec) * 1000; 452 cur_time.tv_sec = tm.tv_sec;
453 cur_time.tv_sec += tm.tv_sec - tmr->last_update.tv_sec - 1;
454 } else {
455 cur_time.tv_nsec += usec * 1000;
456 cur_time.tv_sec += tm.tv_sec - tmr->last_update.tv_sec;
457 }
458 snd_seq_sanity_real_time(&cur_time); 453 snd_seq_sanity_real_time(&cur_time);
459 } 454 }
460 spin_unlock_irqrestore(&tmr->lock, flags); 455 spin_unlock_irqrestore(&tmr->lock, flags);
diff --git a/sound/core/seq/seq_timer.h b/sound/core/seq/seq_timer.h
index 88dfb71805ae..9506b661fe5b 100644
--- a/sound/core/seq/seq_timer.h
+++ b/sound/core/seq/seq_timer.h
@@ -52,7 +52,7 @@ struct snd_seq_timer {
52 unsigned int skew; 52 unsigned int skew;
53 unsigned int skew_base; 53 unsigned int skew_base;
54 54
55 struct timeval last_update; /* time of last clock update, used for interpolation */ 55 struct timespec64 last_update; /* time of last clock update, used for interpolation */
56 56
57 spinlock_t lock; 57 spinlock_t lock;
58}; 58};
diff --git a/sound/hda/hdmi_chmap.c b/sound/hda/hdmi_chmap.c
index c6c75e7e0981..81acc20c2535 100644
--- a/sound/hda/hdmi_chmap.c
+++ b/sound/hda/hdmi_chmap.c
@@ -353,7 +353,8 @@ static void hdmi_std_setup_channel_mapping(struct hdac_chmap *chmap,
353 int hdmi_slot = 0; 353 int hdmi_slot = 0;
354 /* fill actual channel mappings in ALSA channel (i) order */ 354 /* fill actual channel mappings in ALSA channel (i) order */
355 for (i = 0; i < ch_alloc->channels; i++) { 355 for (i = 0; i < ch_alloc->channels; i++) {
356 while (!ch_alloc->speakers[7 - hdmi_slot] && !WARN_ON(hdmi_slot >= 8)) 356 while (!WARN_ON(hdmi_slot >= 8) &&
357 !ch_alloc->speakers[7 - hdmi_slot])
357 hdmi_slot++; /* skip zero slots */ 358 hdmi_slot++; /* skip zero slots */
358 359
359 hdmi_channel_mapping[ca][i] = (i << 4) | hdmi_slot++; 360 hdmi_channel_mapping[ca][i] = (i << 4) | hdmi_slot++;
@@ -430,6 +431,12 @@ static int to_cea_slot(int ordered_ca, unsigned char pos)
430 int mask = snd_hdac_chmap_to_spk_mask(pos); 431 int mask = snd_hdac_chmap_to_spk_mask(pos);
431 int i; 432 int i;
432 433
434 /* Add sanity check to pass klockwork check.
435 * This should never happen.
436 */
437 if (ordered_ca >= ARRAY_SIZE(channel_allocations))
438 return -1;
439
433 if (mask) { 440 if (mask) {
434 for (i = 0; i < 8; i++) { 441 for (i = 0; i < 8; i++) {
435 if (channel_allocations[ordered_ca].speakers[7 - i] == mask) 442 if (channel_allocations[ordered_ca].speakers[7 - i] == mask)
@@ -456,7 +463,15 @@ EXPORT_SYMBOL_GPL(snd_hdac_spk_to_chmap);
456/* from CEA slot to ALSA API channel position */ 463/* from CEA slot to ALSA API channel position */
457static int from_cea_slot(int ordered_ca, unsigned char slot) 464static int from_cea_slot(int ordered_ca, unsigned char slot)
458{ 465{
459 int mask = channel_allocations[ordered_ca].speakers[7 - slot]; 466 int mask;
467
468 /* Add sanity check to pass klockwork check.
469 * This should never happen.
470 */
471 if (slot >= 8)
472 return 0;
473
474 mask = channel_allocations[ordered_ca].speakers[7 - slot];
460 475
461 return snd_hdac_spk_to_chmap(mask); 476 return snd_hdac_spk_to_chmap(mask);
462} 477}
@@ -523,7 +538,8 @@ static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
523 int ordered_ca = get_channel_allocation_order(ca); 538 int ordered_ca = get_channel_allocation_order(ca);
524 539
525 for (i = 0; i < 8; i++) { 540 for (i = 0; i < 8; i++) {
526 if (i < channel_allocations[ordered_ca].channels) 541 if (ordered_ca < ARRAY_SIZE(channel_allocations) &&
542 i < channel_allocations[ordered_ca].channels)
527 map[i] = from_cea_slot(ordered_ca, hdmi_channel_mapping[ca][i] & 0x0f); 543 map[i] = from_cea_slot(ordered_ca, hdmi_channel_mapping[ca][i] & 0x0f);
528 else 544 else
529 map[i] = 0; 545 map[i] = 0;
@@ -551,6 +567,12 @@ int snd_hdac_get_active_channels(int ca)
551{ 567{
552 int ordered_ca = get_channel_allocation_order(ca); 568 int ordered_ca = get_channel_allocation_order(ca);
553 569
570 /* Add sanity check to pass klockwork check.
571 * This should never happen.
572 */
573 if (ordered_ca >= ARRAY_SIZE(channel_allocations))
574 ordered_ca = 0;
575
554 return channel_allocations[ordered_ca].channels; 576 return channel_allocations[ordered_ca].channels;
555} 577}
556EXPORT_SYMBOL_GPL(snd_hdac_get_active_channels); 578EXPORT_SYMBOL_GPL(snd_hdac_get_active_channels);
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index 5a4cf3fab4ae..d53c9bb36281 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -121,7 +121,7 @@ int snd_ak4114_create(struct snd_card *card,
121 121
122 __fail: 122 __fail:
123 snd_ak4114_free(chip); 123 snd_ak4114_free(chip);
124 return err < 0 ? err : -EIO; 124 return err;
125} 125}
126EXPORT_SYMBOL(snd_ak4114_create); 126EXPORT_SYMBOL(snd_ak4114_create);
127 127
diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c
index 48848909a5a9..0702f0552d19 100644
--- a/sound/i2c/other/ak4117.c
+++ b/sound/i2c/other/ak4117.c
@@ -110,7 +110,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t
110 110
111 __fail: 111 __fail:
112 snd_ak4117_free(chip); 112 snd_ak4117_free(chip);
113 return err < 0 ? err : -EIO; 113 return err;
114} 114}
115 115
116void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val) 116void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val)
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index f159da4ec890..a302d1f8d14f 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -170,15 +170,4 @@ static struct isa_driver snd_ad1848_driver = {
170 } 170 }
171}; 171};
172 172
173static int __init alsa_card_ad1848_init(void) 173module_isa_driver(snd_ad1848_driver, SNDRV_CARDS);
174{
175 return isa_register_driver(&snd_ad1848_driver, SNDRV_CARDS);
176}
177
178static void __exit alsa_card_ad1848_exit(void)
179{
180 isa_unregister_driver(&snd_ad1848_driver);
181}
182
183module_init(alsa_card_ad1848_init);
184module_exit(alsa_card_ad1848_exit);
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c
index 120c524bb2a0..8d3060fd7ad7 100644
--- a/sound/isa/adlib.c
+++ b/sound/isa/adlib.c
@@ -112,15 +112,4 @@ static struct isa_driver snd_adlib_driver = {
112 } 112 }
113}; 113};
114 114
115static int __init alsa_card_adlib_init(void) 115module_isa_driver(snd_adlib_driver, SNDRV_CARDS);
116{
117 return isa_register_driver(&snd_adlib_driver, SNDRV_CARDS);
118}
119
120static void __exit alsa_card_adlib_exit(void)
121{
122 isa_unregister_driver(&snd_adlib_driver);
123}
124
125module_init(alsa_card_adlib_init);
126module_exit(alsa_card_adlib_exit);
diff --git a/sound/isa/cmi8328.c b/sound/isa/cmi8328.c
index 2c89d95da674..787475084f46 100644
--- a/sound/isa/cmi8328.c
+++ b/sound/isa/cmi8328.c
@@ -469,15 +469,4 @@ static struct isa_driver snd_cmi8328_driver = {
469 }, 469 },
470}; 470};
471 471
472static int __init alsa_card_cmi8328_init(void) 472module_isa_driver(snd_cmi8328_driver, CMI8328_MAX);
473{
474 return isa_register_driver(&snd_cmi8328_driver, CMI8328_MAX);
475}
476
477static void __exit alsa_card_cmi8328_exit(void)
478{
479 isa_unregister_driver(&snd_cmi8328_driver);
480}
481
482module_init(alsa_card_cmi8328_init)
483module_exit(alsa_card_cmi8328_exit)
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index 282cd75d2235..ef7448e9f813 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -186,15 +186,4 @@ static struct isa_driver snd_cs4231_driver = {
186 } 186 }
187}; 187};
188 188
189static int __init alsa_card_cs4231_init(void) 189module_isa_driver(snd_cs4231_driver, SNDRV_CARDS);
190{
191 return isa_register_driver(&snd_cs4231_driver, SNDRV_CARDS);
192}
193
194static void __exit alsa_card_cs4231_exit(void)
195{
196 isa_unregister_driver(&snd_cs4231_driver);
197}
198
199module_init(alsa_card_cs4231_init);
200module_exit(alsa_card_cs4231_exit);
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c
index 32278847884f..379abe2cbeb2 100644
--- a/sound/isa/galaxy/galaxy.c
+++ b/sound/isa/galaxy/galaxy.c
@@ -634,15 +634,4 @@ static struct isa_driver snd_galaxy_driver = {
634 } 634 }
635}; 635};
636 636
637static int __init alsa_card_galaxy_init(void) 637module_isa_driver(snd_galaxy_driver, SNDRV_CARDS);
638{
639 return isa_register_driver(&snd_galaxy_driver, SNDRV_CARDS);
640}
641
642static void __exit alsa_card_galaxy_exit(void)
643{
644 isa_unregister_driver(&snd_galaxy_driver);
645}
646
647module_init(alsa_card_galaxy_init);
648module_exit(alsa_card_galaxy_exit);
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index f0019715d82e..c169be49ed71 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -229,15 +229,4 @@ static struct isa_driver snd_gusclassic_driver = {
229 } 229 }
230}; 230};
231 231
232static int __init alsa_card_gusclassic_init(void) 232module_isa_driver(snd_gusclassic_driver, SNDRV_CARDS);
233{
234 return isa_register_driver(&snd_gusclassic_driver, SNDRV_CARDS);
235}
236
237static void __exit alsa_card_gusclassic_exit(void)
238{
239 isa_unregister_driver(&snd_gusclassic_driver);
240}
241
242module_init(alsa_card_gusclassic_init);
243module_exit(alsa_card_gusclassic_exit);
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 693d95f46804..77ac2fd723b4 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -358,15 +358,4 @@ static struct isa_driver snd_gusextreme_driver = {
358 } 358 }
359}; 359};
360 360
361static int __init alsa_card_gusextreme_init(void) 361module_isa_driver(snd_gusextreme_driver, SNDRV_CARDS);
362{
363 return isa_register_driver(&snd_gusextreme_driver, SNDRV_CARDS);
364}
365
366static void __exit alsa_card_gusextreme_exit(void)
367{
368 isa_unregister_driver(&snd_gusextreme_driver);
369}
370
371module_init(alsa_card_gusextreme_init);
372module_exit(alsa_card_gusextreme_exit);
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index 8216e8d8f017..dd88c9d33492 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -370,15 +370,4 @@ static struct isa_driver snd_gusmax_driver = {
370 }, 370 },
371}; 371};
372 372
373static int __init alsa_card_gusmax_init(void) 373module_isa_driver(snd_gusmax_driver, SNDRV_CARDS);
374{
375 return isa_register_driver(&snd_gusmax_driver, SNDRV_CARDS);
376}
377
378static void __exit alsa_card_gusmax_exit(void)
379{
380 isa_unregister_driver(&snd_gusmax_driver);
381}
382
383module_init(alsa_card_gusmax_init)
384module_exit(alsa_card_gusmax_exit)
diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c
index 6b4884d052a5..4d909971eedb 100644
--- a/sound/isa/sb/jazz16.c
+++ b/sound/isa/sb/jazz16.c
@@ -387,15 +387,4 @@ static struct isa_driver snd_jazz16_driver = {
387 }, 387 },
388}; 388};
389 389
390static int __init alsa_card_jazz16_init(void) 390module_isa_driver(snd_jazz16_driver, SNDRV_CARDS);
391{
392 return isa_register_driver(&snd_jazz16_driver, SNDRV_CARDS);
393}
394
395static void __exit alsa_card_jazz16_exit(void)
396{
397 isa_unregister_driver(&snd_jazz16_driver);
398}
399
400module_init(alsa_card_jazz16_init)
401module_exit(alsa_card_jazz16_exit)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index b8e2391c33ff..ad42d2364199 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -251,15 +251,4 @@ static struct isa_driver snd_sb8_driver = {
251 }, 251 },
252}; 252};
253 253
254static int __init alsa_card_sb8_init(void) 254module_isa_driver(snd_sb8_driver, SNDRV_CARDS);
255{
256 return isa_register_driver(&snd_sb8_driver, SNDRV_CARDS);
257}
258
259static void __exit alsa_card_sb8_exit(void)
260{
261 isa_unregister_driver(&snd_sb8_driver);
262}
263
264module_init(alsa_card_sb8_init)
265module_exit(alsa_card_sb8_exit)
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index 51cfa7615f72..b61a6633d8f2 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -711,15 +711,4 @@ static struct isa_driver snd_sc6000_driver = {
711}; 711};
712 712
713 713
714static int __init alsa_card_sc6000_init(void) 714module_isa_driver(snd_sc6000_driver, SNDRV_CARDS);
715{
716 return isa_register_driver(&snd_sc6000_driver, SNDRV_CARDS);
717}
718
719static void __exit alsa_card_sc6000_exit(void)
720{
721 isa_unregister_driver(&snd_sc6000_driver);
722}
723
724module_init(alsa_card_sc6000_init)
725module_exit(alsa_card_sc6000_exit)
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index 10c8de1f8d29..6368e5c7d0ba 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -254,7 +254,7 @@ static void ad_write(ad1848_info * devc, int reg, int data)
254 254
255static void wait_for_calibration(ad1848_info * devc) 255static void wait_for_calibration(ad1848_info * devc)
256{ 256{
257 int timeout = 0; 257 int timeout;
258 258
259 /* 259 /*
260 * Wait until the auto calibration process has finished. 260 * Wait until the auto calibration process has finished.
diff --git a/sound/oss/aedsp16.c b/sound/oss/aedsp16.c
index 35b5912cf3f8..bb477d5c8528 100644
--- a/sound/oss/aedsp16.c
+++ b/sound/oss/aedsp16.c
@@ -482,13 +482,13 @@ static struct orVals orDMA[] __initdata = {
482}; 482};
483 483
484static struct aedsp16_info ae_config = { 484static struct aedsp16_info ae_config = {
485 DEF_AEDSP16_IOB, 485 .base_io = DEF_AEDSP16_IOB,
486 DEF_AEDSP16_IRQ, 486 .irq = DEF_AEDSP16_IRQ,
487 DEF_AEDSP16_MRQ, 487 .mpu_irq = DEF_AEDSP16_MRQ,
488 DEF_AEDSP16_DMA, 488 .dma = DEF_AEDSP16_DMA,
489 -1, 489 .mss_base = -1,
490 -1, 490 .mpu_base = -1,
491 INIT_NONE 491 .init = INIT_NONE
492}; 492};
493 493
494/* 494/*
diff --git a/sound/oss/sound_timer.c b/sound/oss/sound_timer.c
index 8021c85f076d..3a444a6f10eb 100644
--- a/sound/oss/sound_timer.c
+++ b/sound/oss/sound_timer.c
@@ -17,7 +17,7 @@
17#include "sound_config.h" 17#include "sound_config.h"
18 18
19static volatile int initialized, opened, tmr_running; 19static volatile int initialized, opened, tmr_running;
20static volatile time_t tmr_offs, tmr_ctr; 20static volatile unsigned int tmr_offs, tmr_ctr;
21static volatile unsigned long ticks_offs; 21static volatile unsigned long ticks_offs;
22static volatile int curr_tempo, curr_timebase; 22static volatile int curr_tempo, curr_timebase;
23static volatile unsigned long curr_ticks; 23static volatile unsigned long curr_ticks;
diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
index 2226dda0eff0..d17019d25b99 100644
--- a/sound/oss/sys_timer.c
+++ b/sound/oss/sys_timer.c
@@ -19,7 +19,7 @@
19#include "sound_config.h" 19#include "sound_config.h"
20 20
21static volatile int opened, tmr_running; 21static volatile int opened, tmr_running;
22static volatile time_t tmr_offs, tmr_ctr; 22static volatile unsigned int tmr_offs, tmr_ctr;
23static volatile unsigned long ticks_offs; 23static volatile unsigned long ticks_offs;
24static volatile int curr_tempo, curr_timebase; 24static volatile int curr_tempo, curr_timebase;
25static volatile unsigned long curr_ticks; 25static volatile unsigned long curr_ticks;
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 9dc2950e1ab7..6414ecf93efa 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -1615,23 +1615,23 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info)
1615 int i; 1615 int i;
1616 struct regs_cs4382 cs_read = {0}; 1616 struct regs_cs4382 cs_read = {0};
1617 struct regs_cs4382 cs_def = { 1617 struct regs_cs4382 cs_def = {
1618 0x00000001, /* Mode Control 1 */ 1618 .mode_control_1 = 0x00000001, /* Mode Control 1 */
1619 0x00000000, /* Mode Control 2 */ 1619 .mode_control_2 = 0x00000000, /* Mode Control 2 */
1620 0x00000084, /* Mode Control 3 */ 1620 .mode_control_3 = 0x00000084, /* Mode Control 3 */
1621 0x00000000, /* Filter Control */ 1621 .filter_control = 0x00000000, /* Filter Control */
1622 0x00000000, /* Invert Control */ 1622 .invert_control = 0x00000000, /* Invert Control */
1623 0x00000024, /* Mixing Control Pair 1 */ 1623 .mix_control_P1 = 0x00000024, /* Mixing Control Pair 1 */
1624 0x00000000, /* Vol Control A1 */ 1624 .vol_control_A1 = 0x00000000, /* Vol Control A1 */
1625 0x00000000, /* Vol Control B1 */ 1625 .vol_control_B1 = 0x00000000, /* Vol Control B1 */
1626 0x00000024, /* Mixing Control Pair 2 */ 1626 .mix_control_P2 = 0x00000024, /* Mixing Control Pair 2 */
1627 0x00000000, /* Vol Control A2 */ 1627 .vol_control_A2 = 0x00000000, /* Vol Control A2 */
1628 0x00000000, /* Vol Control B2 */ 1628 .vol_control_B2 = 0x00000000, /* Vol Control B2 */
1629 0x00000024, /* Mixing Control Pair 3 */ 1629 .mix_control_P3 = 0x00000024, /* Mixing Control Pair 3 */
1630 0x00000000, /* Vol Control A3 */ 1630 .vol_control_A3 = 0x00000000, /* Vol Control A3 */
1631 0x00000000, /* Vol Control B3 */ 1631 .vol_control_B3 = 0x00000000, /* Vol Control B3 */
1632 0x00000024, /* Mixing Control Pair 4 */ 1632 .mix_control_P4 = 0x00000024, /* Mixing Control Pair 4 */
1633 0x00000000, /* Vol Control A4 */ 1633 .vol_control_A4 = 0x00000000, /* Vol Control A4 */
1634 0x00000000 /* Vol Control B4 */ 1634 .vol_control_B4 = 0x00000000 /* Vol Control B4 */
1635 }; 1635 };
1636 1636
1637 if (hw->model == CTSB1270) { 1637 if (hw->model == CTSB1270) {
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 286f5e3686a3..937071760bc4 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1272,11 +1272,11 @@ static int snd_echo_mixer_info(struct snd_kcontrol *kcontrol,
1272 1272
1273 chip = snd_kcontrol_chip(kcontrol); 1273 chip = snd_kcontrol_chip(kcontrol);
1274 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1274 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1275 uinfo->count = 1;
1276 uinfo->value.integer.min = ECHOGAIN_MINOUT; 1275 uinfo->value.integer.min = ECHOGAIN_MINOUT;
1277 uinfo->value.integer.max = ECHOGAIN_MAXOUT; 1276 uinfo->value.integer.max = ECHOGAIN_MAXOUT;
1278 uinfo->dimen.d[0] = num_busses_out(chip); 1277 uinfo->dimen.d[0] = num_busses_out(chip);
1279 uinfo->dimen.d[1] = num_busses_in(chip); 1278 uinfo->dimen.d[1] = num_busses_in(chip);
1279 uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
1280 return 0; 1280 return 0;
1281} 1281}
1282 1282
@@ -1344,11 +1344,11 @@ static int snd_echo_vmixer_info(struct snd_kcontrol *kcontrol,
1344 1344
1345 chip = snd_kcontrol_chip(kcontrol); 1345 chip = snd_kcontrol_chip(kcontrol);
1346 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1346 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1347 uinfo->count = 1;
1348 uinfo->value.integer.min = ECHOGAIN_MINOUT; 1347 uinfo->value.integer.min = ECHOGAIN_MINOUT;
1349 uinfo->value.integer.max = ECHOGAIN_MAXOUT; 1348 uinfo->value.integer.max = ECHOGAIN_MAXOUT;
1350 uinfo->dimen.d[0] = num_busses_out(chip); 1349 uinfo->dimen.d[0] = num_busses_out(chip);
1351 uinfo->dimen.d[1] = num_pipes_out(chip); 1350 uinfo->dimen.d[1] = num_pipes_out(chip);
1351 uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1];
1352 return 0; 1352 return 0;
1353} 1353}
1354 1354
@@ -1728,7 +1728,6 @@ static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
1728 struct snd_ctl_elem_info *uinfo) 1728 struct snd_ctl_elem_info *uinfo)
1729{ 1729{
1730 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1730 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1731 uinfo->count = 96;
1732 uinfo->value.integer.min = ECHOGAIN_MINOUT; 1731 uinfo->value.integer.min = ECHOGAIN_MINOUT;
1733 uinfo->value.integer.max = 0; 1732 uinfo->value.integer.max = 0;
1734#ifdef ECHOCARD_HAS_VMIXER 1733#ifdef ECHOCARD_HAS_VMIXER
@@ -1738,6 +1737,7 @@ static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
1738#endif 1737#endif
1739 uinfo->dimen.d[1] = 16; /* 16 channels */ 1738 uinfo->dimen.d[1] = 16; /* 16 channels */
1740 uinfo->dimen.d[2] = 2; /* 0=level, 1=peak */ 1739 uinfo->dimen.d[2] = 2; /* 0=level, 1=peak */
1740 uinfo->count = uinfo->dimen.d[0] * uinfo->dimen.d[1] * uinfo->dimen.d[2];
1741 return 0; 1741 return 0;
1742} 1742}
1743 1743
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 83741887faa1..9913be8532ab 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3584,6 +3584,12 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
3584 bool reset; 3584 bool reset;
3585 3585
3586 spdif = snd_hda_spdif_out_of_nid(codec, nid); 3586 spdif = snd_hda_spdif_out_of_nid(codec, nid);
3587 /* Add sanity check to pass klockwork check.
3588 * This should never happen.
3589 */
3590 if (WARN_ON(spdif == NULL))
3591 return;
3592
3587 curr_fmt = snd_hda_codec_read(codec, nid, 0, 3593 curr_fmt = snd_hda_codec_read(codec, nid, 0,
3588 AC_VERB_GET_STREAM_FORMAT, 0); 3594 AC_VERB_GET_STREAM_FORMAT, 0);
3589 reset = codec->spdif_status_reset && 3595 reset = codec->spdif_status_reset &&
@@ -3768,7 +3774,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
3768 spdif = snd_hda_spdif_out_of_nid(codec, mout->dig_out_nid); 3774 spdif = snd_hda_spdif_out_of_nid(codec, mout->dig_out_nid);
3769 if (mout->dig_out_nid && mout->share_spdif && 3775 if (mout->dig_out_nid && mout->share_spdif &&
3770 mout->dig_out_used != HDA_DIG_EXCLUSIVE) { 3776 mout->dig_out_used != HDA_DIG_EXCLUSIVE) {
3771 if (chs == 2 && 3777 if (chs == 2 && spdif != NULL &&
3772 snd_hda_is_supported_format(codec, mout->dig_out_nid, 3778 snd_hda_is_supported_format(codec, mout->dig_out_nid,
3773 format) && 3779 format) &&
3774 !(spdif->status & IEC958_AES0_NONAUDIO)) { 3780 !(spdif->status & IEC958_AES0_NONAUDIO)) {
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 79c7b340acc2..e7c8f4f076d5 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -2492,10 +2492,6 @@ static int create_loopback_mixing_ctl(struct hda_codec *codec)
2492 if (!snd_hda_gen_add_kctl(spec, NULL, &loopback_mixing_enum)) 2492 if (!snd_hda_gen_add_kctl(spec, NULL, &loopback_mixing_enum))
2493 return -ENOMEM; 2493 return -ENOMEM;
2494 spec->have_aamix_ctl = 1; 2494 spec->have_aamix_ctl = 1;
2495 /* if no explicit aamix path is present (e.g. for Realtek codecs),
2496 * enable aamix as default -- just for compatibility
2497 */
2498 spec->aamix_mode = !has_aamix_out_paths(spec);
2499 return 0; 2495 return 0;
2500} 2496}
2501 2497
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index d0d5ad8beac5..56e5204ac9c1 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1680,6 +1680,11 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
1680 1680
1681 mutex_lock(&codec->spdif_mutex); 1681 mutex_lock(&codec->spdif_mutex);
1682 spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid); 1682 spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid);
1683 /* Add sanity check to pass klockwork check.
1684 * This should never happen.
1685 */
1686 if (WARN_ON(spdif == NULL))
1687 return true;
1683 non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO); 1688 non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
1684 mutex_unlock(&codec->spdif_mutex); 1689 mutex_unlock(&codec->spdif_mutex);
1685 return non_pcm; 1690 return non_pcm;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index abcb5a6a1cd9..ddd29b9819ba 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3718,6 +3718,9 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
3718 case 0x10ec0295: 3718 case 0x10ec0295:
3719 alc_process_coef_fw(codec, coef0225); 3719 alc_process_coef_fw(codec, coef0225);
3720 break; 3720 break;
3721 case 0x10ec0867:
3722 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
3723 break;
3721 } 3724 }
3722 codec_dbg(codec, "Headset jack set to unplugged mode.\n"); 3725 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
3723} 3726}
@@ -3805,6 +3808,9 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
3805 alc_process_coef_fw(codec, coef0293); 3808 alc_process_coef_fw(codec, coef0293);
3806 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 3809 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
3807 break; 3810 break;
3811 case 0x10ec0867:
3812 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
3813 /* fallthru */
3808 case 0x10ec0662: 3814 case 0x10ec0662:
3809 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 3815 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
3810 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 3816 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
@@ -3899,6 +3905,9 @@ static void alc_headset_mode_default(struct hda_codec *codec)
3899 case 0x10ec0668: 3905 case 0x10ec0668:
3900 alc_process_coef_fw(codec, coef0688); 3906 alc_process_coef_fw(codec, coef0688);
3901 break; 3907 break;
3908 case 0x10ec0867:
3909 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
3910 break;
3902 } 3911 }
3903 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); 3912 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
3904} 3913}
@@ -3989,6 +3998,9 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
3989 case 0x10ec0295: 3998 case 0x10ec0295:
3990 alc_process_coef_fw(codec, coef0225); 3999 alc_process_coef_fw(codec, coef0225);
3991 break; 4000 break;
4001 case 0x10ec0867:
4002 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4003 break;
3992 } 4004 }
3993 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); 4005 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
3994} 4006}
@@ -4166,6 +4178,9 @@ static void alc_determine_headset_type(struct hda_codec *codec)
4166 val = alc_read_coef_idx(codec, 0x46); 4178 val = alc_read_coef_idx(codec, 0x46);
4167 is_ctia = (val & 0x00f0) == 0x00f0; 4179 is_ctia = (val & 0x00f0) == 0x00f0;
4168 break; 4180 break;
4181 case 0x10ec0867:
4182 is_ctia = true;
4183 break;
4169 } 4184 }
4170 4185
4171 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", 4186 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
@@ -6532,6 +6547,8 @@ enum {
6532 ALC668_FIXUP_DELL_XPS13, 6547 ALC668_FIXUP_DELL_XPS13,
6533 ALC662_FIXUP_ASUS_Nx50, 6548 ALC662_FIXUP_ASUS_Nx50,
6534 ALC668_FIXUP_ASUS_Nx51, 6549 ALC668_FIXUP_ASUS_Nx51,
6550 ALC891_FIXUP_HEADSET_MODE,
6551 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
6535}; 6552};
6536 6553
6537static const struct hda_fixup alc662_fixups[] = { 6554static const struct hda_fixup alc662_fixups[] = {
@@ -6787,6 +6804,20 @@ static const struct hda_fixup alc662_fixups[] = {
6787 .chained = true, 6804 .chained = true,
6788 .chain_id = ALC662_FIXUP_BASS_CHMAP, 6805 .chain_id = ALC662_FIXUP_BASS_CHMAP,
6789 }, 6806 },
6807 [ALC891_FIXUP_HEADSET_MODE] = {
6808 .type = HDA_FIXUP_FUNC,
6809 .v.func = alc_fixup_headset_mode,
6810 },
6811 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
6812 .type = HDA_FIXUP_PINS,
6813 .v.pins = (const struct hda_pintbl[]) {
6814 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
6815 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
6816 { }
6817 },
6818 .chained = true,
6819 .chain_id = ALC891_FIXUP_HEADSET_MODE
6820 },
6790}; 6821};
6791 6822
6792static const struct snd_pci_quirk alc662_fixup_tbl[] = { 6823static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -6903,6 +6934,11 @@ static const struct hda_model_fixup alc662_fixup_models[] = {
6903}; 6934};
6904 6935
6905static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 6936static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
6937 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
6938 {0x17, 0x02211010},
6939 {0x18, 0x01a19030},
6940 {0x1a, 0x01813040},
6941 {0x21, 0x01014020}),
6906 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 6942 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
6907 {0x14, 0x01014010}, 6943 {0x14, 0x01014010},
6908 {0x18, 0x01a19020}, 6944 {0x18, 0x01a19020},
@@ -7091,7 +7127,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
7091 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), 7127 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
7092 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), 7128 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
7093 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), 7129 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
7094 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc882), 7130 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
7095 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), 7131 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
7096 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), 7132 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
7097 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), 7133 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
diff --git a/sound/pci/mixart/mixart_mixer.c b/sound/pci/mixart/mixart_mixer.c
index 58fd79ebac20..51e53497f0ad 100644
--- a/sound/pci/mixart/mixart_mixer.c
+++ b/sound/pci/mixart/mixart_mixer.c
@@ -965,7 +965,7 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
965 int err; 965 int err;
966 struct mixart_msg request; 966 struct mixart_msg request;
967 struct mixart_set_out_audio_level audio_level; 967 struct mixart_set_out_audio_level audio_level;
968 u32 resp; 968 u32 resp = 0;
969 969
970 if(chip->pipe_out_ana.status == PIPE_UNDEFINED) 970 if(chip->pipe_out_ana.status == PIPE_UNDEFINED)
971 return -EINVAL; /* no pipe defined */ 971 return -EINVAL; /* no pipe defined */
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 94639d6b5fb5..067a91207d8e 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1496,7 +1496,7 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
1496 f = PAGE_SIZE; 1496 f = PAGE_SIZE;
1497 while ((size + (f >> 1) - 1) <= (f << 7) && (f << 1) > period) 1497 while ((size + (f >> 1) - 1) <= (f << 7) && (f << 1) > period)
1498 f = f >> 1; 1498 f = f >> 1;
1499 pages = (size + f - 1) / f; 1499 pages = DIV_ROUND_UP(size, f);
1500 data->size = size; 1500 data->size = size;
1501 data->pages = pages; 1501 data->pages = pages;
1502 snd_printdd 1502 snd_printdd
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 09da7b52bc2e..1468e4b7bf93 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -991,6 +991,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
991 if (err < 0) 991 if (err < 0)
992 return err; 992 return err;
993 } 993 }
994 master_vol = NULL;
994 if (pm7500) 995 if (pm7500)
995 err = build_mixers(chip, 996 err = build_mixers(chip,
996 ARRAY_SIZE(snd_pmac_awacs_mixers_pmac7500), 997 ARRAY_SIZE(snd_pmac_awacs_mixers_pmac7500),
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index ad3d9ae38034..fbbc25279559 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -63,9 +63,6 @@ MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
63module_param(enable, bool, 0644); 63module_param(enable, bool, 0644);
64MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); 64MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
65 65
66/* Use workqueue */
67static struct workqueue_struct *aica_queue;
68
69/* Simple platform device */ 66/* Simple platform device */
70static struct platform_device *pd; 67static struct platform_device *pd;
71static struct resource aica_memory_space[2] = { 68static struct resource aica_memory_space[2] = {
@@ -327,7 +324,7 @@ static void aica_period_elapsed(unsigned long timer_var)
327 dreamcastcard->current_period = play_period; 324 dreamcastcard->current_period = play_period;
328 if (unlikely(dreamcastcard->dma_check == 0)) 325 if (unlikely(dreamcastcard->dma_check == 0))
329 dreamcastcard->dma_check = 1; 326 dreamcastcard->dma_check = 1;
330 queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); 327 schedule_work(&(dreamcastcard->spu_dma_work));
331} 328}
332 329
333static void spu_begin_dma(struct snd_pcm_substream *substream) 330static void spu_begin_dma(struct snd_pcm_substream *substream)
@@ -337,7 +334,7 @@ static void spu_begin_dma(struct snd_pcm_substream *substream)
337 runtime = substream->runtime; 334 runtime = substream->runtime;
338 dreamcastcard = substream->pcm->private_data; 335 dreamcastcard = substream->pcm->private_data;
339 /*get the queue to do the work */ 336 /*get the queue to do the work */
340 queue_work(aica_queue, &(dreamcastcard->spu_dma_work)); 337 schedule_work(&(dreamcastcard->spu_dma_work));
341 /* Timer may already be running */ 338 /* Timer may already be running */
342 if (unlikely(dreamcastcard->timer.data)) { 339 if (unlikely(dreamcastcard->timer.data)) {
343 mod_timer(&dreamcastcard->timer, jiffies + 4); 340 mod_timer(&dreamcastcard->timer, jiffies + 4);
@@ -381,7 +378,7 @@ static int snd_aicapcm_pcm_close(struct snd_pcm_substream
381 *substream) 378 *substream)
382{ 379{
383 struct snd_card_aica *dreamcastcard = substream->pcm->private_data; 380 struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
384 flush_workqueue(aica_queue); 381 flush_work(&(dreamcastcard->spu_dma_work));
385 if (dreamcastcard->timer.data) 382 if (dreamcastcard->timer.data)
386 del_timer(&dreamcastcard->timer); 383 del_timer(&dreamcastcard->timer);
387 kfree(dreamcastcard->channel); 384 kfree(dreamcastcard->channel);
@@ -633,9 +630,6 @@ static int snd_aica_probe(struct platform_device *devptr)
633 if (unlikely(err < 0)) 630 if (unlikely(err < 0))
634 goto freedreamcast; 631 goto freedreamcast;
635 platform_set_drvdata(devptr, dreamcastcard); 632 platform_set_drvdata(devptr, dreamcastcard);
636 aica_queue = create_workqueue(CARD_NAME);
637 if (unlikely(!aica_queue))
638 goto freedreamcast;
639 snd_printk 633 snd_printk
640 ("ALSA Driver for Yamaha AICA Super Intelligent Sound Processor\n"); 634 ("ALSA Driver for Yamaha AICA Super Intelligent Sound Processor\n");
641 return 0; 635 return 0;
@@ -671,10 +665,6 @@ static int __init aica_init(void)
671 665
672static void __exit aica_exit(void) 666static void __exit aica_exit(void)
673{ 667{
674 /* Destroy the aica kernel thread *
675 * being extra cautious to check if it exists*/
676 if (likely(aica_queue))
677 destroy_workqueue(aica_queue);
678 platform_device_unregister(pd); 668 platform_device_unregister(pd);
679 platform_driver_unregister(&snd_aica_driver); 669 platform_driver_unregister(&snd_aica_driver);
680 /* Kill any sound still playing and reset ARM7 to safe state */ 670 /* Kill any sound still playing and reset ARM7 to safe state */
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index 1f8fb0d904e0..9038b2e7df73 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -107,8 +107,10 @@ static struct usbmix_name_map extigy_map[] = {
107 * e.g. no Master and fake PCM volume 107 * e.g. no Master and fake PCM volume
108 * Pavel Mihaylov <bin@bash.info> 108 * Pavel Mihaylov <bin@bash.info>
109 */ 109 */
110static struct usbmix_dB_map mp3plus_dB_1 = {-4781, 0}; /* just guess */ 110static struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0};
111static struct usbmix_dB_map mp3plus_dB_2 = {-1781, 618}; /* just guess */ 111 /* just guess */
112static struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618};
113 /* just guess */
112 114
113static struct usbmix_name_map mp3plus_map[] = { 115static struct usbmix_name_map mp3plus_map[] = {
114 /* 1: IT pcm */ 116 /* 1: IT pcm */