diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:52:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:52:13 -0500 |
commit | 78f1ae193d1662c22cfebb916e788e1ca896c0fe (patch) | |
tree | 0cca2c3d68c8ea48786cd3e9912f822fee7d1e17 /sound | |
parent | fa395aaec823b9d1a5800913a6b5d0e6d1c5ced2 (diff) | |
parent | 84194883bcf89383ea4230116bb0195af5ec5829 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume
ALSA: hda/realtek: quirk for D945GCLF2 mainboard
ALSA: hda - Terradici HDA controllers does not support 64-bit mode
ALSA: document: Add direct git link to grub hda-analyzer
ALSA: radio/sound/miro: fix build, cleanup depends/selects
ALSA: hda - Generalize EAPD inversion check in patch_analog.c
ASoC: Wrong variable returned on error
ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII
ALSA: hda - Exclude unusable ADCs for ALC88x
ALSA: hda - Add missing Line-Out and PCM switches as slave
ALSA: hda - iMac 9,1 sound patch.
ALSA: opti93x: set MC indirect registers base from PnP data
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 112 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 17 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 127 | ||||
-rw-r--r-- | sound/pci/ice1712/aureon.c | 31 | ||||
-rw-r--r-- | sound/soc/imx/mx1_mx2-pcm.c | 6 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.c | 28 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.h | 2 |
8 files changed, 241 insertions, 87 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d622d2906862..106be6e471f7 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -135,6 +135,8 @@ struct snd_opti9xx { | |||
135 | unsigned long mc_base_size; | 135 | unsigned long mc_base_size; |
136 | #ifdef OPTi93X | 136 | #ifdef OPTi93X |
137 | unsigned long mc_indir_index; | 137 | unsigned long mc_indir_index; |
138 | unsigned long mc_indir_size; | ||
139 | struct resource *res_mc_indir; | ||
138 | struct snd_wss *codec; | 140 | struct snd_wss *codec; |
139 | #endif /* OPTi93X */ | 141 | #endif /* OPTi93X */ |
140 | unsigned long pwd_reg; | 142 | unsigned long pwd_reg; |
@@ -231,7 +233,10 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, | |||
231 | case OPTi9XX_HW_82C931: | 233 | case OPTi9XX_HW_82C931: |
232 | case OPTi9XX_HW_82C933: | 234 | case OPTi9XX_HW_82C933: |
233 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; | 235 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; |
234 | chip->mc_indir_index = 0xe0e; | 236 | if (!chip->mc_indir_index) { |
237 | chip->mc_indir_index = 0xe0e; | ||
238 | chip->mc_indir_size = 2; | ||
239 | } | ||
235 | chip->password = 0xe4; | 240 | chip->password = 0xe4; |
236 | chip->pwd_reg = 0; | 241 | chip->pwd_reg = 0; |
237 | break; | 242 | break; |
@@ -560,57 +565,69 @@ static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id) | |||
560 | 565 | ||
561 | #endif /* OPTi93X */ | 566 | #endif /* OPTi93X */ |
562 | 567 | ||
563 | static int __devinit snd_card_opti9xx_detect(struct snd_card *card, | 568 | static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip) |
564 | struct snd_opti9xx *chip) | ||
565 | { | 569 | { |
566 | int i, err; | 570 | unsigned char value; |
571 | #ifdef OPTi93X | ||
572 | unsigned long flags; | ||
573 | #endif | ||
567 | 574 | ||
575 | chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, | ||
576 | "OPTi9xx MC"); | ||
577 | if (chip->res_mc_base == NULL) | ||
578 | return -EBUSY; | ||
568 | #ifndef OPTi93X | 579 | #ifndef OPTi93X |
569 | for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) { | 580 | value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)); |
570 | unsigned char value; | 581 | if (value != 0xff && value != inb(chip->mc_base + OPTi9XX_MC_REG(1))) |
582 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) | ||
583 | return 0; | ||
584 | #else /* OPTi93X */ | ||
585 | chip->res_mc_indir = request_region(chip->mc_indir_index, | ||
586 | chip->mc_indir_size, | ||
587 | "OPTi93x MC"); | ||
588 | if (chip->res_mc_indir == NULL) | ||
589 | return -EBUSY; | ||
571 | 590 | ||
572 | if ((err = snd_opti9xx_init(chip, i)) < 0) | 591 | spin_lock_irqsave(&chip->lock, flags); |
573 | return err; | 592 | outb(chip->password, chip->mc_base + chip->pwd_reg); |
593 | outb(((chip->mc_indir_index & 0x1f0) >> 4), chip->mc_base); | ||
594 | spin_unlock_irqrestore(&chip->lock, flags); | ||
574 | 595 | ||
575 | if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) | 596 | value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)); |
576 | continue; | 597 | snd_opti9xx_write(chip, OPTi9XX_MC_REG(7), 0xff - value); |
598 | if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value) | ||
599 | return 0; | ||
577 | 600 | ||
578 | value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)); | 601 | release_and_free_resource(chip->res_mc_indir); |
579 | if ((value != 0xff) && (value != inb(chip->mc_base + 1))) | 602 | chip->res_mc_indir = NULL; |
580 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) | 603 | #endif /* OPTi93X */ |
581 | return 1; | 604 | release_and_free_resource(chip->res_mc_base); |
605 | chip->res_mc_base = NULL; | ||
582 | 606 | ||
583 | release_and_free_resource(chip->res_mc_base); | 607 | return -ENODEV; |
584 | chip->res_mc_base = NULL; | 608 | } |
585 | 609 | ||
586 | } | 610 | static int __devinit snd_card_opti9xx_detect(struct snd_card *card, |
587 | #else /* OPTi93X */ | 611 | struct snd_opti9xx *chip) |
588 | for (i = OPTi9XX_HW_82C931; i >= OPTi9XX_HW_82C930; i--) { | 612 | { |
589 | unsigned long flags; | 613 | int i, err; |
590 | unsigned char value; | ||
591 | 614 | ||
592 | if ((err = snd_opti9xx_init(chip, i)) < 0) | 615 | #ifndef OPTi93X |
616 | for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) { | ||
617 | #else | ||
618 | for (i = OPTi9XX_HW_82C931; i >= OPTi9XX_HW_82C930; i--) { | ||
619 | #endif | ||
620 | err = snd_opti9xx_init(chip, i); | ||
621 | if (err < 0) | ||
593 | return err; | 622 | return err; |
594 | 623 | ||
595 | if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) | 624 | err = snd_opti9xx_read_check(chip); |
596 | continue; | 625 | if (err == 0) |
597 | |||
598 | spin_lock_irqsave(&chip->lock, flags); | ||
599 | outb(chip->password, chip->mc_base + chip->pwd_reg); | ||
600 | outb(((chip->mc_indir_index & (1 << 8)) >> 4) | | ||
601 | ((chip->mc_indir_index & 0xf0) >> 4), chip->mc_base); | ||
602 | spin_unlock_irqrestore(&chip->lock, flags); | ||
603 | |||
604 | value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)); | ||
605 | snd_opti9xx_write(chip, OPTi9XX_MC_REG(7), 0xff - value); | ||
606 | if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value) | ||
607 | return 1; | 626 | return 1; |
608 | 627 | #ifdef OPTi93X | |
609 | release_and_free_resource(chip->res_mc_base); | 628 | chip->mc_indir_index = 0; |
610 | chip->res_mc_base = NULL; | 629 | #endif |
611 | } | 630 | } |
612 | #endif /* OPTi93X */ | ||
613 | |||
614 | return -ENODEV; | 631 | return -ENODEV; |
615 | } | 632 | } |
616 | 633 | ||
@@ -639,6 +656,8 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
639 | #ifdef OPTi93X | 656 | #ifdef OPTi93X |
640 | port = pnp_port_start(pdev, 0) - 4; | 657 | port = pnp_port_start(pdev, 0) - 4; |
641 | fm_port = pnp_port_start(pdev, 1) + 8; | 658 | fm_port = pnp_port_start(pdev, 1) + 8; |
659 | chip->mc_indir_index = pnp_port_start(pdev, 3) + 2; | ||
660 | chip->mc_indir_size = pnp_port_len(pdev, 3) - 2; | ||
642 | #else | 661 | #else |
643 | if (pid->driver_data != 0x0924) | 662 | if (pid->driver_data != 0x0924) |
644 | port = pnp_port_start(pdev, 1); | 663 | port = pnp_port_start(pdev, 1); |
@@ -669,7 +688,7 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
669 | static void snd_card_opti9xx_free(struct snd_card *card) | 688 | static void snd_card_opti9xx_free(struct snd_card *card) |
670 | { | 689 | { |
671 | struct snd_opti9xx *chip = card->private_data; | 690 | struct snd_opti9xx *chip = card->private_data; |
672 | 691 | ||
673 | if (chip) { | 692 | if (chip) { |
674 | #ifdef OPTi93X | 693 | #ifdef OPTi93X |
675 | struct snd_wss *codec = chip->codec; | 694 | struct snd_wss *codec = chip->codec; |
@@ -677,6 +696,7 @@ static void snd_card_opti9xx_free(struct snd_card *card) | |||
677 | disable_irq(codec->irq); | 696 | disable_irq(codec->irq); |
678 | free_irq(codec->irq, codec); | 697 | free_irq(codec->irq, codec); |
679 | } | 698 | } |
699 | release_and_free_resource(chip->res_mc_indir); | ||
680 | #endif | 700 | #endif |
681 | release_and_free_resource(chip->res_mc_base); | 701 | release_and_free_resource(chip->res_mc_base); |
682 | } | 702 | } |
@@ -696,11 +716,6 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card) | |||
696 | struct snd_rawmidi *rmidi; | 716 | struct snd_rawmidi *rmidi; |
697 | struct snd_hwdep *synth; | 717 | struct snd_hwdep *synth; |
698 | 718 | ||
699 | if (! chip->res_mc_base && | ||
700 | (chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, | ||
701 | "OPTi9xx MC")) == NULL) | ||
702 | return -ENOMEM; | ||
703 | |||
704 | #if defined(CS4231) || defined(OPTi93X) | 719 | #if defined(CS4231) || defined(OPTi93X) |
705 | xdma2 = dma2; | 720 | xdma2 = dma2; |
706 | #else | 721 | #else |
@@ -954,6 +969,13 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard, | |||
954 | } | 969 | } |
955 | if (hw <= OPTi9XX_HW_82C930) | 970 | if (hw <= OPTi9XX_HW_82C930) |
956 | chip->mc_base -= 0x80; | 971 | chip->mc_base -= 0x80; |
972 | |||
973 | error = snd_opti9xx_read_check(chip); | ||
974 | if (error) { | ||
975 | snd_printk(KERN_ERR "OPTI chip not found\n"); | ||
976 | snd_card_free(card); | ||
977 | return error; | ||
978 | } | ||
957 | snd_card_set_dev(card, &pcard->card->dev); | 979 | snd_card_set_dev(card, &pcard->card->dev); |
958 | if ((error = snd_opti9xx_probe(card)) < 0) { | 980 | if ((error = snd_opti9xx_probe(card)) < 0) { |
959 | snd_card_free(card); | 981 | snd_card_free(card); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index d822bfc6cad6..efcc4f7c57f2 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2450,6 +2450,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
2450 | } | 2450 | } |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | /* disable 64bit DMA address for Teradici */ | ||
2454 | /* it does not work with device 6549:1200 subsys e4a2:040b */ | ||
2455 | if (chip->driver_type == AZX_DRIVER_TERA) | ||
2456 | gcap &= ~ICH6_GCAP_64OK; | ||
2457 | |||
2453 | /* allow 64bit DMA address if supported by H/W */ | 2458 | /* allow 64bit DMA address if supported by H/W */ |
2454 | if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) | 2459 | if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) |
2455 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64)); | 2460 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64)); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 455a0494f907..447eda1f6770 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -72,7 +72,8 @@ struct ad198x_spec { | |||
72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; | 72 | hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; |
73 | 73 | ||
74 | unsigned int jack_present :1; | 74 | unsigned int jack_present :1; |
75 | unsigned int inv_jack_detect:1; | 75 | unsigned int inv_jack_detect:1; /* inverted jack-detection */ |
76 | unsigned int inv_eapd:1; /* inverted EAPD implementation */ | ||
76 | 77 | ||
77 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 78 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
78 | struct hda_loopback_check loopback; | 79 | struct hda_loopback_check loopback; |
@@ -458,7 +459,7 @@ static struct hda_codec_ops ad198x_patch_ops = { | |||
458 | 459 | ||
459 | /* | 460 | /* |
460 | * EAPD control | 461 | * EAPD control |
461 | * the private value = nid | (invert << 8) | 462 | * the private value = nid |
462 | */ | 463 | */ |
463 | #define ad198x_eapd_info snd_ctl_boolean_mono_info | 464 | #define ad198x_eapd_info snd_ctl_boolean_mono_info |
464 | 465 | ||
@@ -467,8 +468,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol, | |||
467 | { | 468 | { |
468 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 469 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
469 | struct ad198x_spec *spec = codec->spec; | 470 | struct ad198x_spec *spec = codec->spec; |
470 | int invert = (kcontrol->private_value >> 8) & 1; | 471 | if (spec->inv_eapd) |
471 | if (invert) | ||
472 | ucontrol->value.integer.value[0] = ! spec->cur_eapd; | 472 | ucontrol->value.integer.value[0] = ! spec->cur_eapd; |
473 | else | 473 | else |
474 | ucontrol->value.integer.value[0] = spec->cur_eapd; | 474 | ucontrol->value.integer.value[0] = spec->cur_eapd; |
@@ -480,11 +480,10 @@ static int ad198x_eapd_put(struct snd_kcontrol *kcontrol, | |||
480 | { | 480 | { |
481 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 481 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
482 | struct ad198x_spec *spec = codec->spec; | 482 | struct ad198x_spec *spec = codec->spec; |
483 | int invert = (kcontrol->private_value >> 8) & 1; | ||
484 | hda_nid_t nid = kcontrol->private_value & 0xff; | 483 | hda_nid_t nid = kcontrol->private_value & 0xff; |
485 | unsigned int eapd; | 484 | unsigned int eapd; |
486 | eapd = !!ucontrol->value.integer.value[0]; | 485 | eapd = !!ucontrol->value.integer.value[0]; |
487 | if (invert) | 486 | if (spec->inv_eapd) |
488 | eapd = !eapd; | 487 | eapd = !eapd; |
489 | if (eapd == spec->cur_eapd) | 488 | if (eapd == spec->cur_eapd) |
490 | return 0; | 489 | return 0; |
@@ -705,7 +704,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { | |||
705 | .info = ad198x_eapd_info, | 704 | .info = ad198x_eapd_info, |
706 | .get = ad198x_eapd_get, | 705 | .get = ad198x_eapd_get, |
707 | .put = ad198x_eapd_put, | 706 | .put = ad198x_eapd_put, |
708 | .private_value = 0x1b | (1 << 8), /* port-D, inversed */ | 707 | .private_value = 0x1b, /* port-D */ |
709 | }, | 708 | }, |
710 | { } /* end */ | 709 | { } /* end */ |
711 | }; | 710 | }; |
@@ -1074,6 +1073,7 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1074 | spec->loopback.amplist = ad1986a_loopbacks; | 1073 | spec->loopback.amplist = ad1986a_loopbacks; |
1075 | #endif | 1074 | #endif |
1076 | spec->vmaster_nid = 0x1b; | 1075 | spec->vmaster_nid = 0x1b; |
1076 | spec->inv_eapd = 1; /* AD1986A has the inverted EAPD implementation */ | ||
1077 | 1077 | ||
1078 | codec->patch_ops = ad198x_patch_ops; | 1078 | codec->patch_ops = ad198x_patch_ops; |
1079 | 1079 | ||
@@ -2124,7 +2124,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = { | |||
2124 | .info = ad198x_eapd_info, | 2124 | .info = ad198x_eapd_info, |
2125 | .get = ad198x_eapd_get, | 2125 | .get = ad198x_eapd_get, |
2126 | .put = ad198x_eapd_put, | 2126 | .put = ad198x_eapd_put, |
2127 | .private_value = 0x12 | (1 << 8), /* port-D, inversed */ | 2127 | .private_value = 0x12, /* port-D */ |
2128 | }, | 2128 | }, |
2129 | 2129 | ||
2130 | { } /* end */ | 2130 | { } /* end */ |
@@ -3065,6 +3065,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3065 | spec->input_mux = &ad1988_laptop_capture_source; | 3065 | spec->input_mux = &ad1988_laptop_capture_source; |
3066 | spec->num_mixers = 1; | 3066 | spec->num_mixers = 1; |
3067 | spec->mixers[0] = ad1988_laptop_mixers; | 3067 | spec->mixers[0] = ad1988_laptop_mixers; |
3068 | spec->inv_eapd = 1; /* inverted EAPD */ | ||
3068 | spec->num_init_verbs = 1; | 3069 | spec->num_init_verbs = 1; |
3069 | spec->init_verbs[0] = ad1988_laptop_init_verbs; | 3070 | spec->init_verbs[0] = ad1988_laptop_init_verbs; |
3070 | if (board_config == AD1988_LAPTOP_DIG) | 3071 | if (board_config == AD1988_LAPTOP_DIG) |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index db4a7367b625..888b6313eeca 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -208,6 +208,7 @@ enum { | |||
208 | ALC885_MBP3, | 208 | ALC885_MBP3, |
209 | ALC885_MB5, | 209 | ALC885_MB5, |
210 | ALC885_IMAC24, | 210 | ALC885_IMAC24, |
211 | ALC885_IMAC91, | ||
211 | ALC883_3ST_2ch_DIG, | 212 | ALC883_3ST_2ch_DIG, |
212 | ALC883_3ST_6ch_DIG, | 213 | ALC883_3ST_6ch_DIG, |
213 | ALC883_3ST_6ch, | 214 | ALC883_3ST_6ch, |
@@ -2400,6 +2401,8 @@ static const char *alc_slave_sws[] = { | |||
2400 | "Speaker Playback Switch", | 2401 | "Speaker Playback Switch", |
2401 | "Mono Playback Switch", | 2402 | "Mono Playback Switch", |
2402 | "IEC958 Playback Switch", | 2403 | "IEC958 Playback Switch", |
2404 | "Line-Out Playback Switch", | ||
2405 | "PCM Playback Switch", | ||
2403 | NULL, | 2406 | NULL, |
2404 | }; | 2407 | }; |
2405 | 2408 | ||
@@ -7050,6 +7053,20 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = { | |||
7050 | { } /* end */ | 7053 | { } /* end */ |
7051 | }; | 7054 | }; |
7052 | 7055 | ||
7056 | static struct snd_kcontrol_new alc885_imac91_mixer[] = { | ||
7057 | HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0c, 0x00, HDA_OUTPUT), | ||
7058 | HDA_BIND_MUTE ("Line-Out Playback Switch", 0x0c, 0x02, HDA_INPUT), | ||
7059 | HDA_CODEC_MUTE ("Speaker Playback Switch", 0x14, 0x00, HDA_OUTPUT), | ||
7060 | HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x00, HDA_OUTPUT), | ||
7061 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
7062 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
7063 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT), | ||
7064 | HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT), | ||
7065 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT), | ||
7066 | { } /* end */ | ||
7067 | }; | ||
7068 | |||
7069 | |||
7053 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { | 7070 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { |
7054 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | 7071 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), |
7055 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | 7072 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), |
@@ -7505,6 +7522,66 @@ static struct hda_verb alc885_mbp3_init_verbs[] = { | |||
7505 | { } | 7522 | { } |
7506 | }; | 7523 | }; |
7507 | 7524 | ||
7525 | /* iMac 9,1 */ | ||
7526 | static struct hda_verb alc885_imac91_init_verbs[] = { | ||
7527 | /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */ | ||
7528 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
7529 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
7530 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
7531 | /* Rear mixer */ | ||
7532 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
7533 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
7534 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
7535 | /* HP Pin: output 0 (0x0c) */ | ||
7536 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
7537 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
7538 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
7539 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
7540 | /* Internal Speakers: output 0 (0x0d) */ | ||
7541 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
7542 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
7543 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
7544 | /* Mic (rear) pin: input vref at 80% */ | ||
7545 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | ||
7546 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
7547 | /* Front Mic pin: input vref at 80% */ | ||
7548 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | ||
7549 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
7550 | /* Line In pin: use output 1 when in LineOut mode */ | ||
7551 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
7552 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
7553 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
7554 | |||
7555 | /* FIXME: use matrix-type input source selection */ | ||
7556 | /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ | ||
7557 | /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ | ||
7558 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
7559 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | ||
7560 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | ||
7561 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | ||
7562 | /* Input mixer2 */ | ||
7563 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
7564 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | ||
7565 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | ||
7566 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | ||
7567 | /* Input mixer3 */ | ||
7568 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
7569 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | ||
7570 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | ||
7571 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | ||
7572 | /* ADC1: mute amp left and right */ | ||
7573 | {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
7574 | {0x07, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
7575 | /* ADC2: mute amp left and right */ | ||
7576 | {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
7577 | {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
7578 | /* ADC3: mute amp left and right */ | ||
7579 | {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
7580 | {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
7581 | |||
7582 | { } | ||
7583 | }; | ||
7584 | |||
7508 | /* iMac 24 mixer. */ | 7585 | /* iMac 24 mixer. */ |
7509 | static struct snd_kcontrol_new alc885_imac24_mixer[] = { | 7586 | static struct snd_kcontrol_new alc885_imac24_mixer[] = { |
7510 | HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT), | 7587 | HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT), |
@@ -7551,6 +7628,26 @@ static void alc885_mbp3_setup(struct hda_codec *codec) | |||
7551 | spec->autocfg.speaker_pins[0] = 0x14; | 7628 | spec->autocfg.speaker_pins[0] = 0x14; |
7552 | } | 7629 | } |
7553 | 7630 | ||
7631 | static void alc885_imac91_automute(struct hda_codec *codec) | ||
7632 | { | ||
7633 | unsigned int present; | ||
7634 | |||
7635 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
7636 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
7637 | snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, | ||
7638 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7639 | snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, | ||
7640 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7641 | |||
7642 | } | ||
7643 | |||
7644 | static void alc885_imac91_unsol_event(struct hda_codec *codec, | ||
7645 | unsigned int res) | ||
7646 | { | ||
7647 | /* Headphone insertion or removal. */ | ||
7648 | if ((res >> 26) == ALC880_HP_EVENT) | ||
7649 | alc885_imac91_automute(codec); | ||
7650 | } | ||
7554 | 7651 | ||
7555 | static struct hda_verb alc882_targa_verbs[] = { | 7652 | static struct hda_verb alc882_targa_verbs[] = { |
7556 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 7653 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
@@ -8718,6 +8815,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = { | |||
8718 | [ALC885_MB5] = "mb5", | 8815 | [ALC885_MB5] = "mb5", |
8719 | [ALC885_MBP3] = "mbp3", | 8816 | [ALC885_MBP3] = "mbp3", |
8720 | [ALC885_IMAC24] = "imac24", | 8817 | [ALC885_IMAC24] = "imac24", |
8818 | [ALC885_IMAC91] = "imac91", | ||
8721 | [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig", | 8819 | [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig", |
8722 | [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig", | 8820 | [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig", |
8723 | [ALC883_3ST_6ch] = "3stack-6ch", | 8821 | [ALC883_3ST_6ch] = "3stack-6ch", |
@@ -8891,6 +8989,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = { | |||
8891 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31), | 8989 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31), |
8892 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), | 8990 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), |
8893 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), | 8991 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), |
8992 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91), | ||
8894 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), | 8993 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), |
8895 | /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, | 8994 | /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, |
8896 | * so apparently no perfect solution yet | 8995 | * so apparently no perfect solution yet |
@@ -9002,6 +9101,20 @@ static struct alc_config_preset alc882_presets[] = { | |||
9002 | .setup = alc885_imac24_setup, | 9101 | .setup = alc885_imac24_setup, |
9003 | .init_hook = alc885_imac24_init_hook, | 9102 | .init_hook = alc885_imac24_init_hook, |
9004 | }, | 9103 | }, |
9104 | [ALC885_IMAC91] = { | ||
9105 | .mixers = { alc885_imac91_mixer, alc882_chmode_mixer }, | ||
9106 | .init_verbs = { alc885_imac91_init_verbs, | ||
9107 | alc880_gpio1_init_verbs }, | ||
9108 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), | ||
9109 | .dac_nids = alc882_dac_nids, | ||
9110 | .channel_mode = alc885_mbp_4ch_modes, | ||
9111 | .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes), | ||
9112 | .input_mux = &alc882_capture_source, | ||
9113 | .dig_out_nid = ALC882_DIGOUT_NID, | ||
9114 | .dig_in_nid = ALC882_DIGIN_NID, | ||
9115 | .unsol_event = alc885_imac91_unsol_event, | ||
9116 | .init_hook = alc885_imac91_automute, | ||
9117 | }, | ||
9005 | [ALC882_TARGA] = { | 9118 | [ALC882_TARGA] = { |
9006 | .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, | 9119 | .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, |
9007 | .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs, | 9120 | .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs, |
@@ -9908,10 +10021,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
9908 | spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ | 10021 | spec->init_amp = ALC_INIT_DEFAULT; /* always initialize */ |
9909 | 10022 | ||
9910 | if (!spec->adc_nids && spec->input_mux) { | 10023 | if (!spec->adc_nids && spec->input_mux) { |
9911 | int i; | 10024 | int i, j; |
9912 | spec->num_adc_nids = 0; | 10025 | spec->num_adc_nids = 0; |
9913 | for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) { | 10026 | for (i = 0; i < ARRAY_SIZE(alc882_adc_nids); i++) { |
10027 | const struct hda_input_mux *imux = spec->input_mux; | ||
9914 | hda_nid_t cap; | 10028 | hda_nid_t cap; |
10029 | hda_nid_t items[16]; | ||
9915 | hda_nid_t nid = alc882_adc_nids[i]; | 10030 | hda_nid_t nid = alc882_adc_nids[i]; |
9916 | unsigned int wcap = get_wcaps(codec, nid); | 10031 | unsigned int wcap = get_wcaps(codec, nid); |
9917 | /* get type */ | 10032 | /* get type */ |
@@ -9922,6 +10037,15 @@ static int patch_alc882(struct hda_codec *codec) | |||
9922 | err = snd_hda_get_connections(codec, nid, &cap, 1); | 10037 | err = snd_hda_get_connections(codec, nid, &cap, 1); |
9923 | if (err < 0) | 10038 | if (err < 0) |
9924 | continue; | 10039 | continue; |
10040 | err = snd_hda_get_connections(codec, cap, items, | ||
10041 | ARRAY_SIZE(items)); | ||
10042 | if (err < 0) | ||
10043 | continue; | ||
10044 | for (j = 0; j < imux->num_items; j++) | ||
10045 | if (imux->items[j].index >= err) | ||
10046 | break; | ||
10047 | if (j < imux->num_items) | ||
10048 | continue; | ||
9925 | spec->private_capsrc_nids[spec->num_adc_nids] = cap; | 10049 | spec->private_capsrc_nids[spec->num_adc_nids] = cap; |
9926 | spec->num_adc_nids++; | 10050 | spec->num_adc_nids++; |
9927 | } | 10051 | } |
@@ -16846,6 +16970,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { | |||
16846 | ALC662_3ST_6ch_DIG), | 16970 | ALC662_3ST_6ch_DIG), |
16847 | SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x", | 16971 | SND_PCI_QUIRK_MASK(0x1854, 0xf000, 0x2000, "ASUS H13-200x", |
16848 | ALC663_ASUS_H13), | 16972 | ALC663_ASUS_H13), |
16973 | SND_PCI_QUIRK(0x8086, 0xd604, "Intel mobo", ALC662_3ST_2ch_DIG), | ||
16849 | {} | 16974 | {} |
16850 | }; | 16975 | }; |
16851 | 16976 | ||
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 110d16e52733..765d7bd4c3d4 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -689,32 +689,14 @@ static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e | |||
689 | return change; | 689 | return change; |
690 | } | 690 | } |
691 | 691 | ||
692 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); | 692 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -10000, 100, 1); |
693 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); | 693 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); |
694 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0); | 694 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_adc, -1200, 100, 0); |
695 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0); | 695 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_master, -4650, 150, 0); |
696 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0); | 696 | static const DECLARE_TLV_DB_SCALE(db_scale_ac97_gain, -3450, 150, 0); |
697 | 697 | ||
698 | /* | 698 | #define WM_VOL_MAX 100 |
699 | * Logarithmic volume values for WM8770 | 699 | #define WM_VOL_CNT 101 /* 0dB .. -100dB */ |
700 | * Computed as 20 * Log10(255 / x) | ||
701 | */ | ||
702 | static const unsigned char wm_vol[256] = { | ||
703 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, | ||
704 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, | ||
705 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, | ||
706 | 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, | ||
707 | 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, | ||
708 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, | ||
709 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | ||
710 | 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, | ||
711 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | ||
712 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
713 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
714 | 0, 0 | ||
715 | }; | ||
716 | |||
717 | #define WM_VOL_MAX (sizeof(wm_vol) - 1) | ||
718 | #define WM_VOL_MUTE 0x8000 | 700 | #define WM_VOL_MUTE 0x8000 |
719 | 701 | ||
720 | static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) | 702 | static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) |
@@ -724,7 +706,8 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned sho | |||
724 | if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) | 706 | if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) |
725 | nvol = 0; | 707 | nvol = 0; |
726 | else | 708 | else |
727 | nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; | 709 | nvol = ((vol % WM_VOL_CNT) * (master % WM_VOL_CNT)) / |
710 | WM_VOL_MAX; | ||
728 | 711 | ||
729 | wm_put(ice, index, nvol); | 712 | wm_put(ice, index, nvol); |
730 | wm_put_nocache(ice, index, 0x180 | nvol); | 713 | wm_put_nocache(ice, index, 0x180 | nvol); |
@@ -820,7 +803,7 @@ static int wm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info * | |||
820 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 803 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
821 | uinfo->count = voices; | 804 | uinfo->count = voices; |
822 | uinfo->value.integer.min = 0; /* mute (-101dB) */ | 805 | uinfo->value.integer.min = 0; /* mute (-101dB) */ |
823 | uinfo->value.integer.max = 0x7F; /* 0dB */ | 806 | uinfo->value.integer.max = WM_VOL_MAX; /* 0dB */ |
824 | return 0; | 807 | return 0; |
825 | } | 808 | } |
826 | 809 | ||
@@ -850,7 +833,7 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value * | |||
850 | snd_ice1712_save_gpio_status(ice); | 833 | snd_ice1712_save_gpio_status(ice); |
851 | for (i = 0; i < voices; i++) { | 834 | for (i = 0; i < voices; i++) { |
852 | unsigned int vol = ucontrol->value.integer.value[i]; | 835 | unsigned int vol = ucontrol->value.integer.value[i]; |
853 | if (vol > 0x7f) | 836 | if (vol > WM_VOL_MAX) |
854 | continue; | 837 | continue; |
855 | vol |= spec->vol[ofs+i]; | 838 | vol |= spec->vol[ofs+i]; |
856 | if (vol != spec->vol[ofs+i]) { | 839 | if (vol != spec->vol[ofs+i]) { |
diff --git a/sound/soc/imx/mx1_mx2-pcm.c b/sound/soc/imx/mx1_mx2-pcm.c index b83866529397..bffffcd5ff34 100644 --- a/sound/soc/imx/mx1_mx2-pcm.c +++ b/sound/soc/imx/mx1_mx2-pcm.c | |||
@@ -322,12 +322,12 @@ static int mx1_mx2_pcm_open(struct snd_pcm_substream *substream) | |||
322 | 322 | ||
323 | pr_debug("%s: Requesting dma channel (%s)\n", __func__, | 323 | pr_debug("%s: Requesting dma channel (%s)\n", __func__, |
324 | prtd->dma_params->name); | 324 | prtd->dma_params->name); |
325 | prtd->dma_ch = imx_dma_request_by_prio(prtd->dma_params->name, | 325 | ret = imx_dma_request_by_prio(prtd->dma_params->name, DMA_PRIO_HIGH); |
326 | DMA_PRIO_HIGH); | 326 | if (ret < 0) { |
327 | if (prtd->dma_ch < 0) { | ||
328 | printk(KERN_ERR "Error %d requesting dma channel\n", ret); | 327 | printk(KERN_ERR "Error %d requesting dma channel\n", ret); |
329 | return ret; | 328 | return ret; |
330 | } | 329 | } |
330 | prtd->dma_ch = ret; | ||
331 | imx_dma_config_burstlen(prtd->dma_ch, | 331 | imx_dma_config_burstlen(prtd->dma_ch, |
332 | prtd->dma_params->watermark_level); | 332 | prtd->dma_params->watermark_level); |
333 | 333 | ||
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index f71cd28eca6b..91bb29666d26 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -194,7 +194,8 @@ static int usb_stream_hwdep_open(struct snd_hwdep *hw, struct file *file) | |||
194 | if (!us122l->first) | 194 | if (!us122l->first) |
195 | us122l->first = file; | 195 | us122l->first = file; |
196 | 196 | ||
197 | if (us122l->dev->descriptor.idProduct == USB_ID_US144) { | 197 | if (us122l->dev->descriptor.idProduct == USB_ID_US144 || |
198 | us122l->dev->descriptor.idProduct == USB_ID_US144MKII) { | ||
198 | iface = usb_ifnum_to_if(us122l->dev, 0); | 199 | iface = usb_ifnum_to_if(us122l->dev, 0); |
199 | usb_autopm_get_interface(iface); | 200 | usb_autopm_get_interface(iface); |
200 | } | 201 | } |
@@ -209,7 +210,8 @@ static int usb_stream_hwdep_release(struct snd_hwdep *hw, struct file *file) | |||
209 | struct usb_interface *iface; | 210 | struct usb_interface *iface; |
210 | snd_printdd(KERN_DEBUG "%p %p\n", hw, file); | 211 | snd_printdd(KERN_DEBUG "%p %p\n", hw, file); |
211 | 212 | ||
212 | if (us122l->dev->descriptor.idProduct == USB_ID_US144) { | 213 | if (us122l->dev->descriptor.idProduct == USB_ID_US144 || |
214 | us122l->dev->descriptor.idProduct == USB_ID_US144MKII) { | ||
213 | iface = usb_ifnum_to_if(us122l->dev, 0); | 215 | iface = usb_ifnum_to_if(us122l->dev, 0); |
214 | usb_autopm_put_interface(iface); | 216 | usb_autopm_put_interface(iface); |
215 | } | 217 | } |
@@ -476,7 +478,8 @@ static bool us122l_create_card(struct snd_card *card) | |||
476 | int err; | 478 | int err; |
477 | struct us122l *us122l = US122L(card); | 479 | struct us122l *us122l = US122L(card); |
478 | 480 | ||
479 | if (us122l->dev->descriptor.idProduct == USB_ID_US144) { | 481 | if (us122l->dev->descriptor.idProduct == USB_ID_US144 || |
482 | us122l->dev->descriptor.idProduct == USB_ID_US144MKII) { | ||
480 | err = usb_set_interface(us122l->dev, 0, 1); | 483 | err = usb_set_interface(us122l->dev, 0, 1); |
481 | if (err) { | 484 | if (err) { |
482 | snd_printk(KERN_ERR "usb_set_interface error \n"); | 485 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
@@ -495,7 +498,8 @@ static bool us122l_create_card(struct snd_card *card) | |||
495 | if (!us122l_start(us122l, 44100, 256)) | 498 | if (!us122l_start(us122l, 44100, 256)) |
496 | return false; | 499 | return false; |
497 | 500 | ||
498 | if (us122l->dev->descriptor.idProduct == USB_ID_US144) | 501 | if (us122l->dev->descriptor.idProduct == USB_ID_US144 || |
502 | us122l->dev->descriptor.idProduct == USB_ID_US144MKII) | ||
499 | err = us144_create_usbmidi(card); | 503 | err = us144_create_usbmidi(card); |
500 | else | 504 | else |
501 | err = us122l_create_usbmidi(card); | 505 | err = us122l_create_usbmidi(card); |
@@ -597,7 +601,8 @@ static int snd_us122l_probe(struct usb_interface *intf, | |||
597 | struct snd_card *card; | 601 | struct snd_card *card; |
598 | int err; | 602 | int err; |
599 | 603 | ||
600 | if (device->descriptor.idProduct == USB_ID_US144 | 604 | if ((device->descriptor.idProduct == USB_ID_US144 || |
605 | device->descriptor.idProduct == USB_ID_US144MKII) | ||
601 | && device->speed == USB_SPEED_HIGH) { | 606 | && device->speed == USB_SPEED_HIGH) { |
602 | snd_printk(KERN_ERR "disable ehci-hcd to run US-144 \n"); | 607 | snd_printk(KERN_ERR "disable ehci-hcd to run US-144 \n"); |
603 | return -ENODEV; | 608 | return -ENODEV; |
@@ -692,7 +697,8 @@ static int snd_us122l_resume(struct usb_interface *intf) | |||
692 | 697 | ||
693 | mutex_lock(&us122l->mutex); | 698 | mutex_lock(&us122l->mutex); |
694 | /* needed, doesn't restart without: */ | 699 | /* needed, doesn't restart without: */ |
695 | if (us122l->dev->descriptor.idProduct == USB_ID_US144) { | 700 | if (us122l->dev->descriptor.idProduct == USB_ID_US144 || |
701 | us122l->dev->descriptor.idProduct == USB_ID_US144MKII) { | ||
696 | err = usb_set_interface(us122l->dev, 0, 1); | 702 | err = usb_set_interface(us122l->dev, 0, 1); |
697 | if (err) { | 703 | if (err) { |
698 | snd_printk(KERN_ERR "usb_set_interface error \n"); | 704 | snd_printk(KERN_ERR "usb_set_interface error \n"); |
@@ -737,6 +743,16 @@ static struct usb_device_id snd_us122l_usb_id_table[] = { | |||
737 | .idVendor = 0x0644, | 743 | .idVendor = 0x0644, |
738 | .idProduct = USB_ID_US144 | 744 | .idProduct = USB_ID_US144 |
739 | }, | 745 | }, |
746 | { | ||
747 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
748 | .idVendor = 0x0644, | ||
749 | .idProduct = USB_ID_US122MKII | ||
750 | }, | ||
751 | { | ||
752 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
753 | .idVendor = 0x0644, | ||
754 | .idProduct = USB_ID_US144MKII | ||
755 | }, | ||
740 | { /* terminator */ } | 756 | { /* terminator */ } |
741 | }; | 757 | }; |
742 | 758 | ||
diff --git a/sound/usb/usx2y/us122l.h b/sound/usb/usx2y/us122l.h index 4daf1982e821..f263b3f96c86 100644 --- a/sound/usb/usx2y/us122l.h +++ b/sound/usb/usx2y/us122l.h | |||
@@ -25,5 +25,7 @@ struct us122l { | |||
25 | 25 | ||
26 | #define USB_ID_US122L 0x800E | 26 | #define USB_ID_US122L 0x800E |
27 | #define USB_ID_US144 0x800F | 27 | #define USB_ID_US144 0x800F |
28 | #define USB_ID_US122MKII 0x8021 | ||
29 | #define USB_ID_US144MKII 0x8020 | ||
28 | 30 | ||
29 | #endif | 31 | #endif |