diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/aoa/core/gpio-pmf.c | 4 | ||||
-rw-r--r-- | sound/core/pcm_lib.c | 75 | ||||
-rw-r--r-- | sound/oss/aedsp16.c | 9 | ||||
-rw-r--r-- | sound/oss/mpu401.c | 2 | ||||
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 18 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctamixer.c | 14 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctsrc.c | 7 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_eld.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 103 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 76 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 19 | ||||
-rw-r--r-- | sound/pci/vx222/vx222_ops.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 11 | ||||
-rw-r--r-- | sound/soc/fsl/efika-audio-fabric.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/pcm030-audio-fabric.c | 2 | ||||
-rw-r--r-- | sound/usb/Kconfig | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/audio.c | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/device.c | 8 | ||||
-rw-r--r-- | sound/usb/caiaq/device.h | 1 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 25 |
23 files changed, 267 insertions, 131 deletions
diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c index 5ca2220eac7d..1dd0c28d1fb7 100644 --- a/sound/aoa/core/gpio-pmf.c +++ b/sound/aoa/core/gpio-pmf.c | |||
@@ -182,6 +182,10 @@ static int pmf_set_notify(struct gpio_runtime *rt, | |||
182 | if (!old && notify) { | 182 | if (!old && notify) { |
183 | irq_client = kzalloc(sizeof(struct pmf_irq_client), | 183 | irq_client = kzalloc(sizeof(struct pmf_irq_client), |
184 | GFP_KERNEL); | 184 | GFP_KERNEL); |
185 | if (!irq_client) { | ||
186 | err = -ENOMEM; | ||
187 | goto out_unlock; | ||
188 | } | ||
185 | irq_client->data = notif; | 189 | irq_client->data = notif; |
186 | irq_client->handler = pmf_handle_notify_irq; | 190 | irq_client->handler = pmf_handle_notify_irq; |
187 | irq_client->owner = THIS_MODULE; | 191 | irq_client->owner = THIS_MODULE; |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 333e4dd29450..9db60d831bb2 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -233,6 +233,18 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
233 | xrun(substream); | 233 | xrun(substream); |
234 | return -EPIPE; | 234 | return -EPIPE; |
235 | } | 235 | } |
236 | if (xrun_debug(substream, 8)) { | ||
237 | char name[16]; | ||
238 | pcm_debug_name(substream, name, sizeof(name)); | ||
239 | snd_printd("period_update: %s: pos=0x%x/0x%x/0x%x, " | ||
240 | "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", | ||
241 | name, (unsigned int)pos, | ||
242 | (unsigned int)runtime->period_size, | ||
243 | (unsigned int)runtime->buffer_size, | ||
244 | (unsigned long)old_hw_ptr, | ||
245 | (unsigned long)runtime->hw_ptr_base, | ||
246 | (unsigned long)runtime->hw_ptr_interrupt); | ||
247 | } | ||
236 | hw_base = runtime->hw_ptr_base; | 248 | hw_base = runtime->hw_ptr_base; |
237 | new_hw_ptr = hw_base + pos; | 249 | new_hw_ptr = hw_base + pos; |
238 | hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; | 250 | hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; |
@@ -244,18 +256,27 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
244 | delta = new_hw_ptr - hw_ptr_interrupt; | 256 | delta = new_hw_ptr - hw_ptr_interrupt; |
245 | } | 257 | } |
246 | if (delta < 0) { | 258 | if (delta < 0) { |
247 | delta += runtime->buffer_size; | 259 | if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr) |
260 | delta += runtime->buffer_size; | ||
248 | if (delta < 0) { | 261 | if (delta < 0) { |
249 | hw_ptr_error(substream, | 262 | hw_ptr_error(substream, |
250 | "Unexpected hw_pointer value " | 263 | "Unexpected hw_pointer value " |
251 | "(stream=%i, pos=%ld, intr_ptr=%ld)\n", | 264 | "(stream=%i, pos=%ld, intr_ptr=%ld)\n", |
252 | substream->stream, (long)pos, | 265 | substream->stream, (long)pos, |
253 | (long)hw_ptr_interrupt); | 266 | (long)hw_ptr_interrupt); |
267 | #if 1 | ||
268 | /* simply skipping the hwptr update seems more | ||
269 | * robust in some cases, e.g. on VMware with | ||
270 | * inaccurate timer source | ||
271 | */ | ||
272 | return 0; /* skip this update */ | ||
273 | #else | ||
254 | /* rebase to interrupt position */ | 274 | /* rebase to interrupt position */ |
255 | hw_base = new_hw_ptr = hw_ptr_interrupt; | 275 | hw_base = new_hw_ptr = hw_ptr_interrupt; |
256 | /* align hw_base to buffer_size */ | 276 | /* align hw_base to buffer_size */ |
257 | hw_base -= hw_base % runtime->buffer_size; | 277 | hw_base -= hw_base % runtime->buffer_size; |
258 | delta = 0; | 278 | delta = 0; |
279 | #endif | ||
259 | } else { | 280 | } else { |
260 | hw_base += runtime->buffer_size; | 281 | hw_base += runtime->buffer_size; |
261 | if (hw_base >= runtime->boundary) | 282 | if (hw_base >= runtime->boundary) |
@@ -344,6 +365,19 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) | |||
344 | xrun(substream); | 365 | xrun(substream); |
345 | return -EPIPE; | 366 | return -EPIPE; |
346 | } | 367 | } |
368 | if (xrun_debug(substream, 16)) { | ||
369 | char name[16]; | ||
370 | pcm_debug_name(substream, name, sizeof(name)); | ||
371 | snd_printd("hw_update: %s: pos=0x%x/0x%x/0x%x, " | ||
372 | "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", | ||
373 | name, (unsigned int)pos, | ||
374 | (unsigned int)runtime->period_size, | ||
375 | (unsigned int)runtime->buffer_size, | ||
376 | (unsigned long)old_hw_ptr, | ||
377 | (unsigned long)runtime->hw_ptr_base, | ||
378 | (unsigned long)runtime->hw_ptr_interrupt); | ||
379 | } | ||
380 | |||
347 | hw_base = runtime->hw_ptr_base; | 381 | hw_base = runtime->hw_ptr_base; |
348 | new_hw_ptr = hw_base + pos; | 382 | new_hw_ptr = hw_base + pos; |
349 | 383 | ||
@@ -909,47 +943,24 @@ static int snd_interval_ratden(struct snd_interval *i, | |||
909 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) | 943 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) |
910 | { | 944 | { |
911 | unsigned int k; | 945 | unsigned int k; |
912 | int changed = 0; | 946 | struct snd_interval list_range; |
913 | 947 | ||
914 | if (!count) { | 948 | if (!count) { |
915 | i->empty = 1; | 949 | i->empty = 1; |
916 | return -EINVAL; | 950 | return -EINVAL; |
917 | } | 951 | } |
952 | snd_interval_any(&list_range); | ||
953 | list_range.min = UINT_MAX; | ||
954 | list_range.max = 0; | ||
918 | for (k = 0; k < count; k++) { | 955 | for (k = 0; k < count; k++) { |
919 | if (mask && !(mask & (1 << k))) | 956 | if (mask && !(mask & (1 << k))) |
920 | continue; | 957 | continue; |
921 | if (i->min == list[k] && !i->openmin) | 958 | if (!snd_interval_test(i, list[k])) |
922 | goto _l1; | ||
923 | if (i->min < list[k]) { | ||
924 | i->min = list[k]; | ||
925 | i->openmin = 0; | ||
926 | changed = 1; | ||
927 | goto _l1; | ||
928 | } | ||
929 | } | ||
930 | i->empty = 1; | ||
931 | return -EINVAL; | ||
932 | _l1: | ||
933 | for (k = count; k-- > 0;) { | ||
934 | if (mask && !(mask & (1 << k))) | ||
935 | continue; | 959 | continue; |
936 | if (i->max == list[k] && !i->openmax) | 960 | list_range.min = min(list_range.min, list[k]); |
937 | goto _l2; | 961 | list_range.max = max(list_range.max, list[k]); |
938 | if (i->max > list[k]) { | ||
939 | i->max = list[k]; | ||
940 | i->openmax = 0; | ||
941 | changed = 1; | ||
942 | goto _l2; | ||
943 | } | ||
944 | } | 962 | } |
945 | i->empty = 1; | 963 | return snd_interval_refine(i, &list_range); |
946 | return -EINVAL; | ||
947 | _l2: | ||
948 | if (snd_interval_checkempty(i)) { | ||
949 | i->empty = 1; | ||
950 | return -EINVAL; | ||
951 | } | ||
952 | return changed; | ||
953 | } | 964 | } |
954 | 965 | ||
955 | EXPORT_SYMBOL(snd_interval_list); | 966 | EXPORT_SYMBOL(snd_interval_list); |
diff --git a/sound/oss/aedsp16.c b/sound/oss/aedsp16.c index 3ee9900ffd7b..35b5912cf3f8 100644 --- a/sound/oss/aedsp16.c +++ b/sound/oss/aedsp16.c | |||
@@ -325,8 +325,9 @@ | |||
325 | /* | 325 | /* |
326 | * Size of character arrays that store name and version of sound card | 326 | * Size of character arrays that store name and version of sound card |
327 | */ | 327 | */ |
328 | #define CARDNAMELEN 15 /* Size of the card's name in chars */ | 328 | #define CARDNAMELEN 15 /* Size of the card's name in chars */ |
329 | #define CARDVERLEN 2 /* Size of the card's version in chars */ | 329 | #define CARDVERLEN 10 /* Size of the card's version in chars */ |
330 | #define CARDVERDIGITS 2 /* Number of digits in the version */ | ||
330 | 331 | ||
331 | #if defined(CONFIG_SC6600) | 332 | #if defined(CONFIG_SC6600) |
332 | /* | 333 | /* |
@@ -410,7 +411,7 @@ | |||
410 | 411 | ||
411 | static int soft_cfg __initdata = 0; /* bitmapped config */ | 412 | static int soft_cfg __initdata = 0; /* bitmapped config */ |
412 | static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */ | 413 | static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */ |
413 | static int ver[CARDVERLEN] __initdata = {0, 0}; /* DSP Ver: | 414 | static int ver[CARDVERDIGITS] __initdata = {0, 0}; /* DSP Ver: |
414 | hi->ver[0] lo->ver[1] */ | 415 | hi->ver[0] lo->ver[1] */ |
415 | 416 | ||
416 | #if defined(CONFIG_SC6600) | 417 | #if defined(CONFIG_SC6600) |
@@ -957,7 +958,7 @@ static int __init aedsp16_dsp_version(int port) | |||
957 | * string is finished. | 958 | * string is finished. |
958 | */ | 959 | */ |
959 | ver[len++] = ret; | 960 | ver[len++] = ret; |
960 | } while (len < CARDVERLEN); | 961 | } while (len < CARDVERDIGITS); |
961 | sprintf(DSPVersion, "%d.%d", ver[0], ver[1]); | 962 | sprintf(DSPVersion, "%d.%d", ver[0], ver[1]); |
962 | 963 | ||
963 | DBG(("success.\n")); | 964 | DBG(("success.\n")); |
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index 1b2316f35b1f..734b8f9e2f78 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c | |||
@@ -1074,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner) | |||
1074 | sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name); | 1074 | sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name); |
1075 | else | 1075 | else |
1076 | sprintf(mpu_synth_info[m].name, | 1076 | sprintf(mpu_synth_info[m].name, |
1077 | "MPU-401 %d.%d%c Midi interface #%d", | 1077 | "MPU-401 %d.%d%c MIDI #%d", |
1078 | (int) (devc->version & 0xf0) >> 4, | 1078 | (int) (devc->version & 0xf0) >> 4, |
1079 | devc->version & 0x0f, | 1079 | devc->version & 0x0f, |
1080 | revision_char, | 1080 | revision_char, |
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index c551006e2920..76d76c08339b 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -310,12 +310,16 @@ static int snd_ali_codec_ready(struct snd_ali *codec, | |||
310 | unsigned int res; | 310 | unsigned int res; |
311 | 311 | ||
312 | end_time = jiffies + msecs_to_jiffies(250); | 312 | end_time = jiffies + msecs_to_jiffies(250); |
313 | do { | 313 | |
314 | for (;;) { | ||
314 | res = snd_ali_5451_peek(codec,port); | 315 | res = snd_ali_5451_peek(codec,port); |
315 | if (!(res & 0x8000)) | 316 | if (!(res & 0x8000)) |
316 | return 0; | 317 | return 0; |
318 | if (!time_after_eq(end_time, jiffies)) | ||
319 | break; | ||
317 | schedule_timeout_uninterruptible(1); | 320 | schedule_timeout_uninterruptible(1); |
318 | } while (time_after_eq(end_time, jiffies)); | 321 | } |
322 | |||
319 | snd_ali_5451_poke(codec, port, res & ~0x8000); | 323 | snd_ali_5451_poke(codec, port, res & ~0x8000); |
320 | snd_printdd("ali_codec_ready: codec is not ready.\n "); | 324 | snd_printdd("ali_codec_ready: codec is not ready.\n "); |
321 | return -EIO; | 325 | return -EIO; |
@@ -327,15 +331,17 @@ static int snd_ali_stimer_ready(struct snd_ali *codec) | |||
327 | unsigned long dwChk1,dwChk2; | 331 | unsigned long dwChk1,dwChk2; |
328 | 332 | ||
329 | dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); | 333 | dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); |
330 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); | ||
331 | |||
332 | end_time = jiffies + msecs_to_jiffies(250); | 334 | end_time = jiffies + msecs_to_jiffies(250); |
333 | do { | 335 | |
336 | for (;;) { | ||
334 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); | 337 | dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); |
335 | if (dwChk2 != dwChk1) | 338 | if (dwChk2 != dwChk1) |
336 | return 0; | 339 | return 0; |
340 | if (!time_after_eq(end_time, jiffies)) | ||
341 | break; | ||
337 | schedule_timeout_uninterruptible(1); | 342 | schedule_timeout_uninterruptible(1); |
338 | } while (time_after_eq(end_time, jiffies)); | 343 | } |
344 | |||
339 | snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); | 345 | snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); |
340 | return -EIO; | 346 | return -EIO; |
341 | } | 347 | } |
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c index a1db51b3ead8..a7f4a671f7b7 100644 --- a/sound/pci/ctxfi/ctamixer.c +++ b/sound/pci/ctxfi/ctamixer.c | |||
@@ -242,13 +242,12 @@ static int get_amixer_rsc(struct amixer_mgr *mgr, | |||
242 | 242 | ||
243 | /* Allocate mem for amixer resource */ | 243 | /* Allocate mem for amixer resource */ |
244 | amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); | 244 | amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); |
245 | if (NULL == amixer) { | 245 | if (!amixer) |
246 | err = -ENOMEM; | 246 | return -ENOMEM; |
247 | return err; | ||
248 | } | ||
249 | 247 | ||
250 | /* Check whether there are sufficient | 248 | /* Check whether there are sufficient |
251 | * amixer resources to meet request. */ | 249 | * amixer resources to meet request. */ |
250 | err = 0; | ||
252 | spin_lock_irqsave(&mgr->mgr_lock, flags); | 251 | spin_lock_irqsave(&mgr->mgr_lock, flags); |
253 | for (i = 0; i < desc->msr; i++) { | 252 | for (i = 0; i < desc->msr; i++) { |
254 | err = mgr_get_resource(&mgr->mgr, 1, &idx); | 253 | err = mgr_get_resource(&mgr->mgr, 1, &idx); |
@@ -397,12 +396,11 @@ static int get_sum_rsc(struct sum_mgr *mgr, | |||
397 | 396 | ||
398 | /* Allocate mem for sum resource */ | 397 | /* Allocate mem for sum resource */ |
399 | sum = kzalloc(sizeof(*sum), GFP_KERNEL); | 398 | sum = kzalloc(sizeof(*sum), GFP_KERNEL); |
400 | if (NULL == sum) { | 399 | if (!sum) |
401 | err = -ENOMEM; | 400 | return -ENOMEM; |
402 | return err; | ||
403 | } | ||
404 | 401 | ||
405 | /* Check whether there are sufficient sum resources to meet request. */ | 402 | /* Check whether there are sufficient sum resources to meet request. */ |
403 | err = 0; | ||
406 | spin_lock_irqsave(&mgr->mgr_lock, flags); | 404 | spin_lock_irqsave(&mgr->mgr_lock, flags); |
407 | for (i = 0; i < desc->msr; i++) { | 405 | for (i = 0; i < desc->msr; i++) { |
408 | err = mgr_get_resource(&mgr->mgr, 1, &idx); | 406 | err = mgr_get_resource(&mgr->mgr, 1, &idx); |
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index e1c145d8b702..df43a5cd3938 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c | |||
@@ -724,12 +724,11 @@ static int get_srcimp_rsc(struct srcimp_mgr *mgr, | |||
724 | 724 | ||
725 | /* Allocate mem for SRCIMP resource */ | 725 | /* Allocate mem for SRCIMP resource */ |
726 | srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL); | 726 | srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL); |
727 | if (NULL == srcimp) { | 727 | if (!srcimp) |
728 | err = -ENOMEM; | 728 | return -ENOMEM; |
729 | return err; | ||
730 | } | ||
731 | 729 | ||
732 | /* Check whether there are sufficient SRCIMP resources. */ | 730 | /* Check whether there are sufficient SRCIMP resources. */ |
731 | err = 0; | ||
733 | spin_lock_irqsave(&mgr->mgr_lock, flags); | 732 | spin_lock_irqsave(&mgr->mgr_lock, flags); |
734 | for (i = 0; i < desc->msr; i++) { | 733 | for (i = 0; i < desc->msr; i++) { |
735 | err = mgr_get_resource(&mgr->mgr, 1, &idx); | 734 | err = mgr_get_resource(&mgr->mgr, 1, &idx); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 88480c0c58a0..c7df01b72cac 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -174,7 +174,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd, | |||
174 | mutex_lock(&bus->cmd_mutex); | 174 | mutex_lock(&bus->cmd_mutex); |
175 | err = bus->ops.command(bus, cmd); | 175 | err = bus->ops.command(bus, cmd); |
176 | if (!err && res) | 176 | if (!err && res) |
177 | *res = bus->ops.get_response(bus); | 177 | *res = bus->ops.get_response(bus, codec->addr); |
178 | mutex_unlock(&bus->cmd_mutex); | 178 | mutex_unlock(&bus->cmd_mutex); |
179 | snd_hda_power_down(codec); | 179 | snd_hda_power_down(codec); |
180 | if (res && *res == -1 && bus->rirb_error) { | 180 | if (res && *res == -1 && bus->rirb_error) { |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index cad79efaabc9..1b75f28ed092 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -568,7 +568,7 @@ struct hda_bus_ops { | |||
568 | /* send a single command */ | 568 | /* send a single command */ |
569 | int (*command)(struct hda_bus *bus, unsigned int cmd); | 569 | int (*command)(struct hda_bus *bus, unsigned int cmd); |
570 | /* get a response from the last command */ | 570 | /* get a response from the last command */ |
571 | unsigned int (*get_response)(struct hda_bus *bus); | 571 | unsigned int (*get_response)(struct hda_bus *bus, unsigned int addr); |
572 | /* free the private data */ | 572 | /* free the private data */ |
573 | void (*private_free)(struct hda_bus *); | 573 | void (*private_free)(struct hda_bus *); |
574 | /* attach a PCM stream */ | 574 | /* attach a PCM stream */ |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index fcad5ec31773..9446a5abea13 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -508,7 +508,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, | |||
508 | char name[64]; | 508 | char name[64]; |
509 | char *sname; | 509 | char *sname; |
510 | long long val; | 510 | long long val; |
511 | int n; | 511 | unsigned int n; |
512 | 512 | ||
513 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 513 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
514 | if (sscanf(line, "%s %llx", name, &val) != 2) | 514 | if (sscanf(line, "%s %llx", name, &val) != 2) |
@@ -539,7 +539,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry, | |||
539 | sname++; | 539 | sname++; |
540 | n = 10 * n + name[4] - '0'; | 540 | n = 10 * n + name[4] - '0'; |
541 | } | 541 | } |
542 | if (n < 0 || n > 31) /* double the CEA limit */ | 542 | if (n >= ELD_MAX_SAD) |
543 | continue; | 543 | continue; |
544 | if (!strcmp(sname, "_coding_type")) | 544 | if (!strcmp(sname, "_coding_type")) |
545 | e->sad[n].format = val; | 545 | e->sad[n].format = val; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 77c1b840ca8b..175f07a381ba 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -253,7 +253,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
253 | 253 | ||
254 | /* STATESTS int mask: S3,SD2,SD1,SD0 */ | 254 | /* STATESTS int mask: S3,SD2,SD1,SD0 */ |
255 | #define AZX_MAX_CODECS 4 | 255 | #define AZX_MAX_CODECS 4 |
256 | #define STATESTS_INT_MASK 0x0f | 256 | #define STATESTS_INT_MASK ((1 << AZX_MAX_CODECS) - 1) |
257 | 257 | ||
258 | /* SD_CTL bits */ | 258 | /* SD_CTL bits */ |
259 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ | 259 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ |
@@ -361,8 +361,8 @@ struct azx_rb { | |||
361 | dma_addr_t addr; /* physical address of CORB/RIRB buffer */ | 361 | dma_addr_t addr; /* physical address of CORB/RIRB buffer */ |
362 | /* for RIRB */ | 362 | /* for RIRB */ |
363 | unsigned short rp, wp; /* read/write pointers */ | 363 | unsigned short rp, wp; /* read/write pointers */ |
364 | int cmds; /* number of pending requests */ | 364 | int cmds[AZX_MAX_CODECS]; /* number of pending requests */ |
365 | u32 res; /* last read value */ | 365 | u32 res[AZX_MAX_CODECS]; /* last read value */ |
366 | }; | 366 | }; |
367 | 367 | ||
368 | struct azx { | 368 | struct azx { |
@@ -418,7 +418,7 @@ struct azx { | |||
418 | unsigned int probing :1; /* codec probing phase */ | 418 | unsigned int probing :1; /* codec probing phase */ |
419 | 419 | ||
420 | /* for debugging */ | 420 | /* for debugging */ |
421 | unsigned int last_cmd; /* last issued command (to sync) */ | 421 | unsigned int last_cmd[AZX_MAX_CODECS]; |
422 | 422 | ||
423 | /* for pending irqs */ | 423 | /* for pending irqs */ |
424 | struct work_struct irq_pending_work; | 424 | struct work_struct irq_pending_work; |
@@ -513,6 +513,7 @@ static int azx_alloc_cmd_io(struct azx *chip) | |||
513 | 513 | ||
514 | static void azx_init_cmd_io(struct azx *chip) | 514 | static void azx_init_cmd_io(struct azx *chip) |
515 | { | 515 | { |
516 | spin_lock_irq(&chip->reg_lock); | ||
516 | /* CORB set up */ | 517 | /* CORB set up */ |
517 | chip->corb.addr = chip->rb.addr; | 518 | chip->corb.addr = chip->rb.addr; |
518 | chip->corb.buf = (u32 *)chip->rb.area; | 519 | chip->corb.buf = (u32 *)chip->rb.area; |
@@ -531,7 +532,8 @@ static void azx_init_cmd_io(struct azx *chip) | |||
531 | /* RIRB set up */ | 532 | /* RIRB set up */ |
532 | chip->rirb.addr = chip->rb.addr + 2048; | 533 | chip->rirb.addr = chip->rb.addr + 2048; |
533 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); | 534 | chip->rirb.buf = (u32 *)(chip->rb.area + 2048); |
534 | chip->rirb.wp = chip->rirb.rp = chip->rirb.cmds = 0; | 535 | chip->rirb.wp = chip->rirb.rp = 0; |
536 | memset(chip->rirb.cmds, 0, sizeof(chip->rirb.cmds)); | ||
535 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); | 537 | azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); |
536 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); | 538 | azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); |
537 | 539 | ||
@@ -543,30 +545,60 @@ static void azx_init_cmd_io(struct azx *chip) | |||
543 | azx_writew(chip, RINTCNT, 1); | 545 | azx_writew(chip, RINTCNT, 1); |
544 | /* enable rirb dma and response irq */ | 546 | /* enable rirb dma and response irq */ |
545 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); | 547 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); |
548 | spin_unlock_irq(&chip->reg_lock); | ||
546 | } | 549 | } |
547 | 550 | ||
548 | static void azx_free_cmd_io(struct azx *chip) | 551 | static void azx_free_cmd_io(struct azx *chip) |
549 | { | 552 | { |
553 | spin_lock_irq(&chip->reg_lock); | ||
550 | /* disable ringbuffer DMAs */ | 554 | /* disable ringbuffer DMAs */ |
551 | azx_writeb(chip, RIRBCTL, 0); | 555 | azx_writeb(chip, RIRBCTL, 0); |
552 | azx_writeb(chip, CORBCTL, 0); | 556 | azx_writeb(chip, CORBCTL, 0); |
557 | spin_unlock_irq(&chip->reg_lock); | ||
558 | } | ||
559 | |||
560 | static unsigned int azx_command_addr(u32 cmd) | ||
561 | { | ||
562 | unsigned int addr = cmd >> 28; | ||
563 | |||
564 | if (addr >= AZX_MAX_CODECS) { | ||
565 | snd_BUG(); | ||
566 | addr = 0; | ||
567 | } | ||
568 | |||
569 | return addr; | ||
570 | } | ||
571 | |||
572 | static unsigned int azx_response_addr(u32 res) | ||
573 | { | ||
574 | unsigned int addr = res & 0xf; | ||
575 | |||
576 | if (addr >= AZX_MAX_CODECS) { | ||
577 | snd_BUG(); | ||
578 | addr = 0; | ||
579 | } | ||
580 | |||
581 | return addr; | ||
553 | } | 582 | } |
554 | 583 | ||
555 | /* send a command */ | 584 | /* send a command */ |
556 | static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) | 585 | static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) |
557 | { | 586 | { |
558 | struct azx *chip = bus->private_data; | 587 | struct azx *chip = bus->private_data; |
588 | unsigned int addr = azx_command_addr(val); | ||
559 | unsigned int wp; | 589 | unsigned int wp; |
560 | 590 | ||
591 | spin_lock_irq(&chip->reg_lock); | ||
592 | |||
561 | /* add command to corb */ | 593 | /* add command to corb */ |
562 | wp = azx_readb(chip, CORBWP); | 594 | wp = azx_readb(chip, CORBWP); |
563 | wp++; | 595 | wp++; |
564 | wp %= ICH6_MAX_CORB_ENTRIES; | 596 | wp %= ICH6_MAX_CORB_ENTRIES; |
565 | 597 | ||
566 | spin_lock_irq(&chip->reg_lock); | 598 | chip->rirb.cmds[addr]++; |
567 | chip->rirb.cmds++; | ||
568 | chip->corb.buf[wp] = cpu_to_le32(val); | 599 | chip->corb.buf[wp] = cpu_to_le32(val); |
569 | azx_writel(chip, CORBWP, wp); | 600 | azx_writel(chip, CORBWP, wp); |
601 | |||
570 | spin_unlock_irq(&chip->reg_lock); | 602 | spin_unlock_irq(&chip->reg_lock); |
571 | 603 | ||
572 | return 0; | 604 | return 0; |
@@ -578,13 +610,14 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) | |||
578 | static void azx_update_rirb(struct azx *chip) | 610 | static void azx_update_rirb(struct azx *chip) |
579 | { | 611 | { |
580 | unsigned int rp, wp; | 612 | unsigned int rp, wp; |
613 | unsigned int addr; | ||
581 | u32 res, res_ex; | 614 | u32 res, res_ex; |
582 | 615 | ||
583 | wp = azx_readb(chip, RIRBWP); | 616 | wp = azx_readb(chip, RIRBWP); |
584 | if (wp == chip->rirb.wp) | 617 | if (wp == chip->rirb.wp) |
585 | return; | 618 | return; |
586 | chip->rirb.wp = wp; | 619 | chip->rirb.wp = wp; |
587 | 620 | ||
588 | while (chip->rirb.rp != wp) { | 621 | while (chip->rirb.rp != wp) { |
589 | chip->rirb.rp++; | 622 | chip->rirb.rp++; |
590 | chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES; | 623 | chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES; |
@@ -592,18 +625,24 @@ static void azx_update_rirb(struct azx *chip) | |||
592 | rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */ | 625 | rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */ |
593 | res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); | 626 | res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); |
594 | res = le32_to_cpu(chip->rirb.buf[rp]); | 627 | res = le32_to_cpu(chip->rirb.buf[rp]); |
628 | addr = azx_response_addr(res_ex); | ||
595 | if (res_ex & ICH6_RIRB_EX_UNSOL_EV) | 629 | if (res_ex & ICH6_RIRB_EX_UNSOL_EV) |
596 | snd_hda_queue_unsol_event(chip->bus, res, res_ex); | 630 | snd_hda_queue_unsol_event(chip->bus, res, res_ex); |
597 | else if (chip->rirb.cmds) { | 631 | else if (chip->rirb.cmds[addr]) { |
598 | chip->rirb.res = res; | 632 | chip->rirb.res[addr] = res; |
599 | smp_wmb(); | 633 | smp_wmb(); |
600 | chip->rirb.cmds--; | 634 | chip->rirb.cmds[addr]--; |
601 | } | 635 | } else |
636 | snd_printk(KERN_ERR SFX "spurious response %#x:%#x, " | ||
637 | "last cmd=%#08x\n", | ||
638 | res, res_ex, | ||
639 | chip->last_cmd[addr]); | ||
602 | } | 640 | } |
603 | } | 641 | } |
604 | 642 | ||
605 | /* receive a response */ | 643 | /* receive a response */ |
606 | static unsigned int azx_rirb_get_response(struct hda_bus *bus) | 644 | static unsigned int azx_rirb_get_response(struct hda_bus *bus, |
645 | unsigned int addr) | ||
607 | { | 646 | { |
608 | struct azx *chip = bus->private_data; | 647 | struct azx *chip = bus->private_data; |
609 | unsigned long timeout; | 648 | unsigned long timeout; |
@@ -616,10 +655,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
616 | azx_update_rirb(chip); | 655 | azx_update_rirb(chip); |
617 | spin_unlock_irq(&chip->reg_lock); | 656 | spin_unlock_irq(&chip->reg_lock); |
618 | } | 657 | } |
619 | if (!chip->rirb.cmds) { | 658 | if (!chip->rirb.cmds[addr]) { |
620 | smp_rmb(); | 659 | smp_rmb(); |
621 | bus->rirb_error = 0; | 660 | bus->rirb_error = 0; |
622 | return chip->rirb.res; /* the last value */ | 661 | return chip->rirb.res[addr]; /* the last value */ |
623 | } | 662 | } |
624 | if (time_after(jiffies, timeout)) | 663 | if (time_after(jiffies, timeout)) |
625 | break; | 664 | break; |
@@ -633,7 +672,8 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
633 | 672 | ||
634 | if (chip->msi) { | 673 | if (chip->msi) { |
635 | snd_printk(KERN_WARNING SFX "No response from codec, " | 674 | snd_printk(KERN_WARNING SFX "No response from codec, " |
636 | "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); | 675 | "disabling MSI: last cmd=0x%08x\n", |
676 | chip->last_cmd[addr]); | ||
637 | free_irq(chip->irq, chip); | 677 | free_irq(chip->irq, chip); |
638 | chip->irq = -1; | 678 | chip->irq = -1; |
639 | pci_disable_msi(chip->pci); | 679 | pci_disable_msi(chip->pci); |
@@ -648,7 +688,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
648 | if (!chip->polling_mode) { | 688 | if (!chip->polling_mode) { |
649 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " | 689 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " |
650 | "switching to polling mode: last cmd=0x%08x\n", | 690 | "switching to polling mode: last cmd=0x%08x\n", |
651 | chip->last_cmd); | 691 | chip->last_cmd[addr]); |
652 | chip->polling_mode = 1; | 692 | chip->polling_mode = 1; |
653 | goto again; | 693 | goto again; |
654 | } | 694 | } |
@@ -672,7 +712,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
672 | 712 | ||
673 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " | 713 | snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " |
674 | "switching to single_cmd mode: last cmd=0x%08x\n", | 714 | "switching to single_cmd mode: last cmd=0x%08x\n", |
675 | chip->last_cmd); | 715 | chip->last_cmd[addr]); |
676 | chip->single_cmd = 1; | 716 | chip->single_cmd = 1; |
677 | bus->response_reset = 0; | 717 | bus->response_reset = 0; |
678 | /* re-initialize CORB/RIRB */ | 718 | /* re-initialize CORB/RIRB */ |
@@ -692,7 +732,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus) | |||
692 | */ | 732 | */ |
693 | 733 | ||
694 | /* receive a response */ | 734 | /* receive a response */ |
695 | static int azx_single_wait_for_response(struct azx *chip) | 735 | static int azx_single_wait_for_response(struct azx *chip, unsigned int addr) |
696 | { | 736 | { |
697 | int timeout = 50; | 737 | int timeout = 50; |
698 | 738 | ||
@@ -700,7 +740,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
700 | /* check IRV busy bit */ | 740 | /* check IRV busy bit */ |
701 | if (azx_readw(chip, IRS) & ICH6_IRS_VALID) { | 741 | if (azx_readw(chip, IRS) & ICH6_IRS_VALID) { |
702 | /* reuse rirb.res as the response return value */ | 742 | /* reuse rirb.res as the response return value */ |
703 | chip->rirb.res = azx_readl(chip, IR); | 743 | chip->rirb.res[addr] = azx_readl(chip, IR); |
704 | return 0; | 744 | return 0; |
705 | } | 745 | } |
706 | udelay(1); | 746 | udelay(1); |
@@ -708,7 +748,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
708 | if (printk_ratelimit()) | 748 | if (printk_ratelimit()) |
709 | snd_printd(SFX "get_response timeout: IRS=0x%x\n", | 749 | snd_printd(SFX "get_response timeout: IRS=0x%x\n", |
710 | azx_readw(chip, IRS)); | 750 | azx_readw(chip, IRS)); |
711 | chip->rirb.res = -1; | 751 | chip->rirb.res[addr] = -1; |
712 | return -EIO; | 752 | return -EIO; |
713 | } | 753 | } |
714 | 754 | ||
@@ -716,6 +756,7 @@ static int azx_single_wait_for_response(struct azx *chip) | |||
716 | static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | 756 | static int azx_single_send_cmd(struct hda_bus *bus, u32 val) |
717 | { | 757 | { |
718 | struct azx *chip = bus->private_data; | 758 | struct azx *chip = bus->private_data; |
759 | unsigned int addr = azx_command_addr(val); | ||
719 | int timeout = 50; | 760 | int timeout = 50; |
720 | 761 | ||
721 | bus->rirb_error = 0; | 762 | bus->rirb_error = 0; |
@@ -728,7 +769,7 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | |||
728 | azx_writel(chip, IC, val); | 769 | azx_writel(chip, IC, val); |
729 | azx_writew(chip, IRS, azx_readw(chip, IRS) | | 770 | azx_writew(chip, IRS, azx_readw(chip, IRS) | |
730 | ICH6_IRS_BUSY); | 771 | ICH6_IRS_BUSY); |
731 | return azx_single_wait_for_response(chip); | 772 | return azx_single_wait_for_response(chip, addr); |
732 | } | 773 | } |
733 | udelay(1); | 774 | udelay(1); |
734 | } | 775 | } |
@@ -739,10 +780,11 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val) | |||
739 | } | 780 | } |
740 | 781 | ||
741 | /* receive a response */ | 782 | /* receive a response */ |
742 | static unsigned int azx_single_get_response(struct hda_bus *bus) | 783 | static unsigned int azx_single_get_response(struct hda_bus *bus, |
784 | unsigned int addr) | ||
743 | { | 785 | { |
744 | struct azx *chip = bus->private_data; | 786 | struct azx *chip = bus->private_data; |
745 | return chip->rirb.res; | 787 | return chip->rirb.res[addr]; |
746 | } | 788 | } |
747 | 789 | ||
748 | /* | 790 | /* |
@@ -757,7 +799,7 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val) | |||
757 | { | 799 | { |
758 | struct azx *chip = bus->private_data; | 800 | struct azx *chip = bus->private_data; |
759 | 801 | ||
760 | chip->last_cmd = val; | 802 | chip->last_cmd[azx_command_addr(val)] = val; |
761 | if (chip->single_cmd) | 803 | if (chip->single_cmd) |
762 | return azx_single_send_cmd(bus, val); | 804 | return azx_single_send_cmd(bus, val); |
763 | else | 805 | else |
@@ -765,13 +807,14 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val) | |||
765 | } | 807 | } |
766 | 808 | ||
767 | /* get a response */ | 809 | /* get a response */ |
768 | static unsigned int azx_get_response(struct hda_bus *bus) | 810 | static unsigned int azx_get_response(struct hda_bus *bus, |
811 | unsigned int addr) | ||
769 | { | 812 | { |
770 | struct azx *chip = bus->private_data; | 813 | struct azx *chip = bus->private_data; |
771 | if (chip->single_cmd) | 814 | if (chip->single_cmd) |
772 | return azx_single_get_response(bus); | 815 | return azx_single_get_response(bus, addr); |
773 | else | 816 | else |
774 | return azx_rirb_get_response(bus); | 817 | return azx_rirb_get_response(bus, addr); |
775 | } | 818 | } |
776 | 819 | ||
777 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 820 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
@@ -1243,10 +1286,12 @@ static int probe_codec(struct azx *chip, int addr) | |||
1243 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; | 1286 | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; |
1244 | unsigned int res; | 1287 | unsigned int res; |
1245 | 1288 | ||
1289 | mutex_lock(&chip->bus->cmd_mutex); | ||
1246 | chip->probing = 1; | 1290 | chip->probing = 1; |
1247 | azx_send_cmd(chip->bus, cmd); | 1291 | azx_send_cmd(chip->bus, cmd); |
1248 | res = azx_get_response(chip->bus); | 1292 | res = azx_get_response(chip->bus, addr); |
1249 | chip->probing = 0; | 1293 | chip->probing = 0; |
1294 | mutex_unlock(&chip->bus->cmd_mutex); | ||
1250 | if (res == -1) | 1295 | if (res == -1) |
1251 | return -EIO; | 1296 | return -EIO; |
1252 | snd_printdd(SFX "codec #%d probed OK\n", addr); | 1297 | snd_printdd(SFX "codec #%d probed OK\n", addr); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index be7d25fa7f35..403588c6e3f6 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3754,7 +3754,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol, | |||
3754 | int mute = (!ucontrol->value.integer.value[0] && | 3754 | int mute = (!ucontrol->value.integer.value[0] && |
3755 | !ucontrol->value.integer.value[1]); | 3755 | !ucontrol->value.integer.value[1]); |
3756 | /* toggle GPIO1 according to the mute state */ | 3756 | /* toggle GPIO1 according to the mute state */ |
3757 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | 3757 | snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, |
3758 | mute ? 0x02 : 0x0); | 3758 | mute ? 0x02 : 0x0); |
3759 | return ret; | 3759 | return ret; |
3760 | } | 3760 | } |
@@ -3835,9 +3835,11 @@ static struct hda_verb ad1884a_laptop_verbs[] = { | |||
3835 | /* Port-F (int speaker) mixer - route only from analog mixer */ | 3835 | /* Port-F (int speaker) mixer - route only from analog mixer */ |
3836 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | 3836 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, |
3837 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | 3837 | {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, |
3838 | /* Port-F pin */ | 3838 | /* Port-F (int speaker) pin */ |
3839 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | 3839 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
3840 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 3840 | {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
3841 | /* required for compaq 6530s/6531s speaker output */ | ||
3842 | {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
3841 | /* Port-C pin - internal mic-in */ | 3843 | /* Port-C pin - internal mic-in */ |
3842 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 3844 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
3843 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ | 3845 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7e99763ca527..6f683e451f2b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -275,13 +275,13 @@ struct alc_spec { | |||
275 | */ | 275 | */ |
276 | unsigned int num_init_verbs; | 276 | unsigned int num_init_verbs; |
277 | 277 | ||
278 | char stream_name_analog[16]; /* analog PCM stream */ | 278 | char stream_name_analog[32]; /* analog PCM stream */ |
279 | struct hda_pcm_stream *stream_analog_playback; | 279 | struct hda_pcm_stream *stream_analog_playback; |
280 | struct hda_pcm_stream *stream_analog_capture; | 280 | struct hda_pcm_stream *stream_analog_capture; |
281 | struct hda_pcm_stream *stream_analog_alt_playback; | 281 | struct hda_pcm_stream *stream_analog_alt_playback; |
282 | struct hda_pcm_stream *stream_analog_alt_capture; | 282 | struct hda_pcm_stream *stream_analog_alt_capture; |
283 | 283 | ||
284 | char stream_name_digital[16]; /* digital PCM stream */ | 284 | char stream_name_digital[32]; /* digital PCM stream */ |
285 | struct hda_pcm_stream *stream_digital_playback; | 285 | struct hda_pcm_stream *stream_digital_playback; |
286 | struct hda_pcm_stream *stream_digital_capture; | 286 | struct hda_pcm_stream *stream_digital_capture; |
287 | 287 | ||
@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol, | |||
559 | 559 | ||
560 | /* Find enumerated value for current pinctl setting */ | 560 | /* Find enumerated value for current pinctl setting */ |
561 | i = alc_pin_mode_min(dir); | 561 | i = alc_pin_mode_min(dir); |
562 | while (alc_pin_mode_values[i] != pinctl && i <= alc_pin_mode_max(dir)) | 562 | while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl) |
563 | i++; | 563 | i++; |
564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); | 564 | *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); |
565 | return 0; | 565 | return 0; |
@@ -10631,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec, | |||
10631 | alc262_lenovo_3000_automute(codec, 1); | 10631 | alc262_lenovo_3000_automute(codec, 1); |
10632 | } | 10632 | } |
10633 | 10633 | ||
10634 | static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid, | ||
10635 | int dir, int idx, long *valp) | ||
10636 | { | ||
10637 | int i, change = 0; | ||
10638 | |||
10639 | for (i = 0; i < 2; i++, valp++) | ||
10640 | change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx, | ||
10641 | HDA_AMP_MUTE, | ||
10642 | *valp ? 0 : HDA_AMP_MUTE); | ||
10643 | return change; | ||
10644 | } | ||
10645 | |||
10634 | /* bind hp and internal speaker mute (with plug check) */ | 10646 | /* bind hp and internal speaker mute (with plug check) */ |
10635 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | 10647 | static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, |
10636 | struct snd_ctl_elem_value *ucontrol) | 10648 | struct snd_ctl_elem_value *ucontrol) |
@@ -10639,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10639 | long *valp = ucontrol->value.integer.value; | 10651 | long *valp = ucontrol->value.integer.value; |
10640 | int change; | 10652 | int change; |
10641 | 10653 | ||
10642 | change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | 10654 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
10643 | HDA_AMP_MUTE, | 10655 | change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10644 | valp ? 0 : HDA_AMP_MUTE); | ||
10645 | change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | ||
10646 | HDA_AMP_MUTE, | ||
10647 | valp ? 0 : HDA_AMP_MUTE); | ||
10648 | |||
10649 | if (change) | 10656 | if (change) |
10650 | alc262_fujitsu_automute(codec, 0); | 10657 | alc262_fujitsu_automute(codec, 0); |
10651 | return change; | 10658 | return change; |
@@ -10680,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol, | |||
10680 | long *valp = ucontrol->value.integer.value; | 10687 | long *valp = ucontrol->value.integer.value; |
10681 | int change; | 10688 | int change; |
10682 | 10689 | ||
10683 | change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, | 10690 | change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp); |
10684 | HDA_AMP_MUTE, | ||
10685 | valp ? 0 : HDA_AMP_MUTE); | ||
10686 | |||
10687 | if (change) | 10691 | if (change) |
10688 | alc262_lenovo_3000_automute(codec, 0); | 10692 | alc262_lenovo_3000_automute(codec, 0); |
10689 | return change; | 10693 | return change; |
@@ -11854,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol, | |||
11854 | long *valp = ucontrol->value.integer.value; | 11858 | long *valp = ucontrol->value.integer.value; |
11855 | int change; | 11859 | int change; |
11856 | 11860 | ||
11857 | change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, | 11861 | change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp); |
11858 | HDA_AMP_MUTE, | ||
11859 | valp[0] ? 0 : HDA_AMP_MUTE); | ||
11860 | change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0, | ||
11861 | HDA_AMP_MUTE, | ||
11862 | valp[1] ? 0 : HDA_AMP_MUTE); | ||
11863 | if (change) | 11862 | if (change) |
11864 | alc268_acer_automute(codec, 0); | 11863 | alc268_acer_automute(codec, 0); |
11865 | return change; | 11864 | return change; |
@@ -12522,8 +12521,6 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
12522 | ALC268_TOSHIBA), | 12521 | ALC268_TOSHIBA), |
12523 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), | 12522 | SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), |
12524 | SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), | 12523 | SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), |
12525 | SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", | ||
12526 | ALC268_TOSHIBA), | ||
12527 | SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), | 12524 | SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), |
12528 | SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), | 12525 | SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), |
12529 | SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), | 12526 | SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), |
@@ -12531,6 +12528,15 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { | |||
12531 | {} | 12528 | {} |
12532 | }; | 12529 | }; |
12533 | 12530 | ||
12531 | /* Toshiba laptops have no unique PCI SSID but only codec SSID */ | ||
12532 | static struct snd_pci_quirk alc268_ssid_cfg_tbl[] = { | ||
12533 | SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO), | ||
12534 | SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO), | ||
12535 | SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05", | ||
12536 | ALC268_TOSHIBA), | ||
12537 | {} | ||
12538 | }; | ||
12539 | |||
12534 | static struct alc_config_preset alc268_presets[] = { | 12540 | static struct alc_config_preset alc268_presets[] = { |
12535 | [ALC267_QUANTA_IL1] = { | 12541 | [ALC267_QUANTA_IL1] = { |
12536 | .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer }, | 12542 | .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer }, |
@@ -12697,6 +12703,10 @@ static int patch_alc268(struct hda_codec *codec) | |||
12697 | alc268_models, | 12703 | alc268_models, |
12698 | alc268_cfg_tbl); | 12704 | alc268_cfg_tbl); |
12699 | 12705 | ||
12706 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) | ||
12707 | board_config = snd_hda_check_board_codec_sid_config(codec, | ||
12708 | ALC882_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl); | ||
12709 | |||
12700 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { | 12710 | if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { |
12701 | printk(KERN_INFO "hda_codec: Unknown model for %s, " | 12711 | printk(KERN_INFO "hda_codec: Unknown model for %s, " |
12702 | "trying auto-probe from BIOS...\n", codec->chip_name); | 12712 | "trying auto-probe from BIOS...\n", codec->chip_name); |
@@ -13564,6 +13574,8 @@ static int patch_alc269(struct hda_codec *codec) | |||
13564 | set_capture_mixer(spec); | 13574 | set_capture_mixer(spec); |
13565 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 13575 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
13566 | 13576 | ||
13577 | spec->vmaster_nid = 0x02; | ||
13578 | |||
13567 | codec->patch_ops = alc_patch_ops; | 13579 | codec->patch_ops = alc_patch_ops; |
13568 | if (board_config == ALC269_AUTO) | 13580 | if (board_config == ALC269_AUTO) |
13569 | spec->init_hook = alc269_auto_init; | 13581 | spec->init_hook = alc269_auto_init; |
@@ -15158,7 +15170,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
15158 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 15170 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
15159 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), | 15171 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), |
15160 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ | 15172 | /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ |
15161 | SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), | 15173 | SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO), |
15162 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), | 15174 | SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), |
15163 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), | 15175 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), |
15164 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), | 15176 | SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), |
@@ -15578,9 +15590,12 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
15578 | spec->stream_digital_playback = &alc861vd_pcm_digital_playback; | 15590 | spec->stream_digital_playback = &alc861vd_pcm_digital_playback; |
15579 | spec->stream_digital_capture = &alc861vd_pcm_digital_capture; | 15591 | spec->stream_digital_capture = &alc861vd_pcm_digital_capture; |
15580 | 15592 | ||
15581 | spec->adc_nids = alc861vd_adc_nids; | 15593 | if (!spec->adc_nids) { |
15582 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); | 15594 | spec->adc_nids = alc861vd_adc_nids; |
15583 | spec->capsrc_nids = alc861vd_capsrc_nids; | 15595 | spec->num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids); |
15596 | } | ||
15597 | if (!spec->capsrc_nids) | ||
15598 | spec->capsrc_nids = alc861vd_capsrc_nids; | ||
15584 | 15599 | ||
15585 | set_capture_mixer(spec); | 15600 | set_capture_mixer(spec); |
15586 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 15601 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
@@ -17497,9 +17512,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
17497 | spec->stream_digital_playback = &alc662_pcm_digital_playback; | 17512 | spec->stream_digital_playback = &alc662_pcm_digital_playback; |
17498 | spec->stream_digital_capture = &alc662_pcm_digital_capture; | 17513 | spec->stream_digital_capture = &alc662_pcm_digital_capture; |
17499 | 17514 | ||
17500 | spec->adc_nids = alc662_adc_nids; | 17515 | if (!spec->adc_nids) { |
17501 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); | 17516 | spec->adc_nids = alc662_adc_nids; |
17502 | spec->capsrc_nids = alc662_capsrc_nids; | 17517 | spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids); |
17518 | } | ||
17519 | if (!spec->capsrc_nids) | ||
17520 | spec->capsrc_nids = alc662_capsrc_nids; | ||
17503 | 17521 | ||
17504 | if (!spec->cap_mixer) | 17522 | if (!spec->cap_mixer) |
17505 | set_capture_mixer(spec); | 17523 | set_capture_mixer(spec); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index da7f9f65c047..6990cfcb6a38 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -76,6 +76,7 @@ enum { | |||
76 | STAC_92HD73XX_AUTO, | 76 | STAC_92HD73XX_AUTO, |
77 | STAC_92HD73XX_NO_JD, /* no jack-detection */ | 77 | STAC_92HD73XX_NO_JD, /* no jack-detection */ |
78 | STAC_92HD73XX_REF, | 78 | STAC_92HD73XX_REF, |
79 | STAC_92HD73XX_INTEL, | ||
79 | STAC_DELL_M6_AMIC, | 80 | STAC_DELL_M6_AMIC, |
80 | STAC_DELL_M6_DMIC, | 81 | STAC_DELL_M6_DMIC, |
81 | STAC_DELL_M6_BOTH, | 82 | STAC_DELL_M6_BOTH, |
@@ -1777,6 +1778,7 @@ static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { | |||
1777 | [STAC_92HD73XX_AUTO] = "auto", | 1778 | [STAC_92HD73XX_AUTO] = "auto", |
1778 | [STAC_92HD73XX_NO_JD] = "no-jd", | 1779 | [STAC_92HD73XX_NO_JD] = "no-jd", |
1779 | [STAC_92HD73XX_REF] = "ref", | 1780 | [STAC_92HD73XX_REF] = "ref", |
1781 | [STAC_92HD73XX_INTEL] = "intel", | ||
1780 | [STAC_DELL_M6_AMIC] = "dell-m6-amic", | 1782 | [STAC_DELL_M6_AMIC] = "dell-m6-amic", |
1781 | [STAC_DELL_M6_DMIC] = "dell-m6-dmic", | 1783 | [STAC_DELL_M6_DMIC] = "dell-m6-dmic", |
1782 | [STAC_DELL_M6_BOTH] = "dell-m6", | 1784 | [STAC_DELL_M6_BOTH] = "dell-m6", |
@@ -1789,6 +1791,10 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
1789 | "DFI LanParty", STAC_92HD73XX_REF), | 1791 | "DFI LanParty", STAC_92HD73XX_REF), |
1790 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, | 1792 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
1791 | "DFI LanParty", STAC_92HD73XX_REF), | 1793 | "DFI LanParty", STAC_92HD73XX_REF), |
1794 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002, | ||
1795 | "Intel DG45ID", STAC_92HD73XX_INTEL), | ||
1796 | SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003, | ||
1797 | "Intel DG45FC", STAC_92HD73XX_INTEL), | ||
1792 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, | 1798 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254, |
1793 | "Dell Studio 1535", STAC_DELL_M6_DMIC), | 1799 | "Dell Studio 1535", STAC_DELL_M6_DMIC), |
1794 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, | 1800 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255, |
@@ -1809,6 +1815,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
1809 | "Dell Studio 1537", STAC_DELL_M6_DMIC), | 1815 | "Dell Studio 1537", STAC_DELL_M6_DMIC), |
1810 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, | 1816 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, |
1811 | "Dell Studio 17", STAC_DELL_M6_DMIC), | 1817 | "Dell Studio 17", STAC_DELL_M6_DMIC), |
1818 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, | ||
1819 | "Dell Studio 1555", STAC_DELL_M6_DMIC), | ||
1812 | {} /* terminator */ | 1820 | {} /* terminator */ |
1813 | }; | 1821 | }; |
1814 | 1822 | ||
@@ -2264,7 +2272,7 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = { | |||
2264 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), | 2272 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), |
2265 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), | 2273 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), |
2266 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), | 2274 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), |
2267 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_3ST), | 2275 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS), |
2268 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), | 2276 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), |
2269 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), | 2277 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), |
2270 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), | 2278 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), |
@@ -4066,7 +4074,7 @@ static int stac92xx_add_jack(struct hda_codec *codec, | |||
4066 | jack->nid = nid; | 4074 | jack->nid = nid; |
4067 | jack->type = type; | 4075 | jack->type = type; |
4068 | 4076 | ||
4069 | sprintf(name, "%s at %s %s Jack", | 4077 | snprintf(name, sizeof(name), "%s at %s %s Jack", |
4070 | snd_hda_get_jack_type(def_conf), | 4078 | snd_hda_get_jack_type(def_conf), |
4071 | snd_hda_get_jack_connectivity(def_conf), | 4079 | snd_hda_get_jack_connectivity(def_conf), |
4072 | snd_hda_get_jack_location(def_conf)); | 4080 | snd_hda_get_jack_location(def_conf)); |
@@ -5643,6 +5651,13 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5643 | /* GPIO2 High = Enable EAPD */ | 5651 | /* GPIO2 High = Enable EAPD */ |
5644 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; | 5652 | spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; |
5645 | spec->gpio_data = 0x04; | 5653 | spec->gpio_data = 0x04; |
5654 | switch (codec->subsystem_id) { | ||
5655 | case 0x1028022f: | ||
5656 | /* correct EAPD to be GPIO0 */ | ||
5657 | spec->eapd_mask = spec->gpio_mask = 0x01; | ||
5658 | spec->gpio_dir = spec->gpio_data = 0x01; | ||
5659 | break; | ||
5660 | }; | ||
5646 | spec->dmic_nids = stac927x_dmic_nids; | 5661 | spec->dmic_nids = stac927x_dmic_nids; |
5647 | spec->num_dmics = STAC927X_NUM_DMICS; | 5662 | spec->num_dmics = STAC927X_NUM_DMICS; |
5648 | 5663 | ||
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 6416d3f0c7be..a69e774d0b13 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c | |||
@@ -885,10 +885,10 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
885 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 885 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
886 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 886 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
887 | if (ucontrol->value.integer.value[0] < 0 || | 887 | if (ucontrol->value.integer.value[0] < 0 || |
888 | ucontrol->value.integer.value[0] < MIC_LEVEL_MAX) | 888 | ucontrol->value.integer.value[0] > MIC_LEVEL_MAX) |
889 | return -EINVAL; | 889 | return -EINVAL; |
890 | if (ucontrol->value.integer.value[1] < 0 || | 890 | if (ucontrol->value.integer.value[1] < 0 || |
891 | ucontrol->value.integer.value[1] < MIC_LEVEL_MAX) | 891 | ucontrol->value.integer.value[1] > MIC_LEVEL_MAX) |
892 | return -EINVAL; | 892 | return -EINVAL; |
893 | mutex_lock(&_chip->mixer_mutex); | 893 | mutex_lock(&_chip->mixer_mutex); |
894 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || | 894 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index ab099f482487..cb0d1bf34b57 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -767,6 +767,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
767 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; | 767 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; |
768 | u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; | 768 | u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; |
769 | u16 pll_d = 1; | 769 | u16 pll_d = 1; |
770 | u8 reg; | ||
770 | 771 | ||
771 | /* select data word length */ | 772 | /* select data word length */ |
772 | data = | 773 | data = |
@@ -801,8 +802,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
801 | pll_q &= 0xf; | 802 | pll_q &= 0xf; |
802 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); | 803 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); |
803 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); | 804 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); |
804 | } else | 805 | /* disable PLL if it is bypassed */ |
806 | reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); | ||
807 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); | ||
808 | |||
809 | } else { | ||
805 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); | 810 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); |
811 | /* enable PLL when it is used */ | ||
812 | reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); | ||
813 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE); | ||
814 | } | ||
806 | 815 | ||
807 | /* Route Left DAC to left channel input and | 816 | /* Route Left DAC to left channel input and |
808 | * right DAC to right channel input */ | 817 | * right DAC to right channel input */ |
diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c index 85b0e7569504..3326e2a1e863 100644 --- a/sound/soc/fsl/efika-audio-fabric.c +++ b/sound/soc/fsl/efika-audio-fabric.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include "mpc5200_psc_ac97.h" | 30 | #include "mpc5200_psc_ac97.h" |
31 | #include "../codecs/stac9766.h" | 31 | #include "../codecs/stac9766.h" |
32 | 32 | ||
33 | #define DRV_NAME "efika-audio-fabric" | ||
34 | |||
33 | static struct snd_soc_device device; | 35 | static struct snd_soc_device device; |
34 | static struct snd_soc_card card; | 36 | static struct snd_soc_card card; |
35 | 37 | ||
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 8766f7a3893d..b928ef7d28eb 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include "mpc5200_psc_ac97.h" | 30 | #include "mpc5200_psc_ac97.h" |
31 | #include "../codecs/wm9712.h" | 31 | #include "../codecs/wm9712.h" |
32 | 32 | ||
33 | #define DRV_NAME "pcm030-audio-fabric" | ||
34 | |||
33 | static struct snd_soc_device device; | 35 | static struct snd_soc_device device; |
34 | static struct snd_soc_card card; | 36 | static struct snd_soc_card card; |
35 | 37 | ||
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig index 523aec188ccf..73525c048e7f 100644 --- a/sound/usb/Kconfig +++ b/sound/usb/Kconfig | |||
@@ -48,6 +48,7 @@ config SND_USB_CAIAQ | |||
48 | * Native Instruments Kore Controller | 48 | * Native Instruments Kore Controller |
49 | * Native Instruments Kore Controller 2 | 49 | * Native Instruments Kore Controller 2 |
50 | * Native Instruments Audio Kontrol 1 | 50 | * Native Instruments Audio Kontrol 1 |
51 | * Native Instruments Audio 2 DJ | ||
51 | * Native Instruments Audio 4 DJ | 52 | * Native Instruments Audio 4 DJ |
52 | * Native Instruments Audio 8 DJ | 53 | * Native Instruments Audio 8 DJ |
53 | * Native Instruments Guitar Rig Session I/O | 54 | * Native Instruments Guitar Rig Session I/O |
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 8f9b60c5d74c..121af0644fd9 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c | |||
@@ -646,6 +646,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) | |||
646 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): | 646 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): |
647 | dev->samplerates |= SNDRV_PCM_RATE_192000; | 647 | dev->samplerates |= SNDRV_PCM_RATE_192000; |
648 | /* fall thru */ | 648 | /* fall thru */ |
649 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO2DJ): | ||
649 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): | 650 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): |
650 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): | 651 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): |
651 | dev->samplerates |= SNDRV_PCM_RATE_88200; | 652 | dev->samplerates |= SNDRV_PCM_RATE_88200; |
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index de38108f0b28..83e6c1312d47 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c | |||
@@ -35,13 +35,14 @@ | |||
35 | #include "input.h" | 35 | #include "input.h" |
36 | 36 | ||
37 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 37 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
38 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.18"); | 38 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19"); |
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," | 40 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," |
41 | "{Native Instruments, RigKontrol3}," | 41 | "{Native Instruments, RigKontrol3}," |
42 | "{Native Instruments, Kore Controller}," | 42 | "{Native Instruments, Kore Controller}," |
43 | "{Native Instruments, Kore Controller 2}," | 43 | "{Native Instruments, Kore Controller 2}," |
44 | "{Native Instruments, Audio Kontrol 1}," | 44 | "{Native Instruments, Audio Kontrol 1}," |
45 | "{Native Instruments, Audio 2 DJ}," | ||
45 | "{Native Instruments, Audio 4 DJ}," | 46 | "{Native Instruments, Audio 4 DJ}," |
46 | "{Native Instruments, Audio 8 DJ}," | 47 | "{Native Instruments, Audio 8 DJ}," |
47 | "{Native Instruments, Session I/O}," | 48 | "{Native Instruments, Session I/O}," |
@@ -121,6 +122,11 @@ static struct usb_device_id snd_usb_id_table[] = { | |||
121 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | 122 | .idVendor = USB_VID_NATIVEINSTRUMENTS, |
122 | .idProduct = USB_PID_AUDIO4DJ | 123 | .idProduct = USB_PID_AUDIO4DJ |
123 | }, | 124 | }, |
125 | { | ||
126 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
127 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | ||
128 | .idProduct = USB_PID_AUDIO2DJ | ||
129 | }, | ||
124 | { /* terminator */ } | 130 | { /* terminator */ } |
125 | }; | 131 | }; |
126 | 132 | ||
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h index ece73514854e..44e3edf88bef 100644 --- a/sound/usb/caiaq/device.h +++ b/sound/usb/caiaq/device.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define USB_PID_KORECONTROLLER 0x4711 | 10 | #define USB_PID_KORECONTROLLER 0x4711 |
11 | #define USB_PID_KORECONTROLLER2 0x4712 | 11 | #define USB_PID_KORECONTROLLER2 0x4712 |
12 | #define USB_PID_AK1 0x0815 | 12 | #define USB_PID_AK1 0x0815 |
13 | #define USB_PID_AUDIO2DJ 0x041c | ||
13 | #define USB_PID_AUDIO4DJ 0x0839 | 14 | #define USB_PID_AUDIO4DJ 0x0839 |
14 | #define USB_PID_AUDIO8DJ 0x1978 | 15 | #define USB_PID_AUDIO8DJ 0x1978 |
15 | #define USB_PID_SESSIONIO 0x1915 | 16 | #define USB_PID_SESSIONIO 0x1915 |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 4bd3a7a0edc1..ec9cdf986928 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -990,20 +990,35 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, | |||
990 | break; | 990 | break; |
991 | } | 991 | } |
992 | 992 | ||
993 | /* quirk for UDA1321/N101 */ | 993 | /* volume control quirks */ |
994 | /* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */ | ||
995 | /* is not very clear from datasheets */ | ||
996 | /* I hope that the min value is -15360 for newer firmware --jk */ | ||
997 | switch (state->chip->usb_id) { | 994 | switch (state->chip->usb_id) { |
998 | case USB_ID(0x0471, 0x0101): | 995 | case USB_ID(0x0471, 0x0101): |
999 | case USB_ID(0x0471, 0x0104): | 996 | case USB_ID(0x0471, 0x0104): |
1000 | case USB_ID(0x0471, 0x0105): | 997 | case USB_ID(0x0471, 0x0105): |
1001 | case USB_ID(0x0672, 0x1041): | 998 | case USB_ID(0x0672, 0x1041): |
999 | /* quirk for UDA1321/N101. | ||
1000 | * note that detection between firmware 2.1.1.7 (N101) | ||
1001 | * and later 2.1.1.21 is not very clear from datasheets. | ||
1002 | * I hope that the min value is -15360 for newer firmware --jk | ||
1003 | */ | ||
1002 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && | 1004 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && |
1003 | cval->min == -15616) { | 1005 | cval->min == -15616) { |
1004 | snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); | 1006 | snd_printk(KERN_INFO |
1007 | "set volume quirk for UDA1321/N101 chip\n"); | ||
1005 | cval->max = -256; | 1008 | cval->max = -256; |
1006 | } | 1009 | } |
1010 | break; | ||
1011 | |||
1012 | case USB_ID(0x046d, 0x09a4): | ||
1013 | if (!strcmp(kctl->id.name, "Mic Capture Volume")) { | ||
1014 | snd_printk(KERN_INFO | ||
1015 | "set volume quirk for QuickCam E3500\n"); | ||
1016 | cval->min = 6080; | ||
1017 | cval->max = 8768; | ||
1018 | cval->res = 192; | ||
1019 | } | ||
1020 | break; | ||
1021 | |||
1007 | } | 1022 | } |
1008 | 1023 | ||
1009 | snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", | 1024 | snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", |