diff options
Diffstat (limited to 'sound/pci')
| -rw-r--r-- | sound/pci/ac97/ac97_codec.c | 2 | ||||
| -rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 9 | ||||
| -rw-r--r-- | sound/pci/hda/hda_intel.c | 42 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 4 |
4 files changed, 40 insertions, 17 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 9473fca9681d..8b0f99688303 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
| @@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne | |||
| 1271 | tmp.index = ac97->num; | 1271 | tmp.index = ac97->num; |
| 1272 | kctl = snd_ctl_new1(&tmp, ac97); | 1272 | kctl = snd_ctl_new1(&tmp, ac97); |
| 1273 | } | 1273 | } |
| 1274 | if (!kctl) | ||
| 1275 | return -ENOMEM; | ||
| 1274 | if (reg >= AC97_PHONE && reg <= AC97_PCM) | 1276 | if (reg >= AC97_PHONE && reg <= AC97_PCM) |
| 1275 | set_tlv_db_scale(kctl, db_scale_5bit_12db_max); | 1277 | set_tlv_db_scale(kctl, db_scale_5bit_12db_max); |
| 1276 | else | 1278 | else |
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index bed4485f34f6..c21adb6ef1d5 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
| @@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
| 1416 | .ca0108_chip = 1, | 1416 | .ca0108_chip = 1, |
| 1417 | .spk71 = 1, | 1417 | .spk71 = 1, |
| 1418 | .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */ | 1418 | .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */ |
| 1419 | /* Tested by Maxim Kachur <mcdebugger@duganet.ru> 17th Oct 2012. */ | ||
| 1420 | /* This is MAEM8986, 0202 is MAEM8980 */ | ||
| 1421 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40071102, | ||
| 1422 | .driver = "Audigy2", .name = "E-mu 1010 PCIe [MAEM8986]", | ||
| 1423 | .id = "EMU1010", | ||
| 1424 | .emu10k2_chip = 1, | ||
| 1425 | .ca0108_chip = 1, | ||
| 1426 | .spk71 = 1, | ||
| 1427 | .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 PCIe */ | ||
| 1419 | /* Tested by James@superbug.co.uk 8th July 2005. */ | 1428 | /* Tested by James@superbug.co.uk 8th July 2005. */ |
| 1420 | /* This is MAEM8810, 0202 is MAEM8820 */ | 1429 | /* This is MAEM8810, 0202 is MAEM8820 */ |
| 1421 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, | 1430 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 6833835a218b..72b085ae7d46 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -501,6 +501,7 @@ struct azx { | |||
| 501 | 501 | ||
| 502 | /* VGA-switcheroo setup */ | 502 | /* VGA-switcheroo setup */ |
| 503 | unsigned int use_vga_switcheroo:1; | 503 | unsigned int use_vga_switcheroo:1; |
| 504 | unsigned int vga_switcheroo_registered:1; | ||
| 504 | unsigned int init_failed:1; /* delayed init failed */ | 505 | unsigned int init_failed:1; /* delayed init failed */ |
| 505 | unsigned int disabled:1; /* disabled by VGA-switcher */ | 506 | unsigned int disabled:1; /* disabled by VGA-switcher */ |
| 506 | 507 | ||
| @@ -2157,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip, | |||
| 2157 | if (delay < 0) | 2158 | if (delay < 0) |
| 2158 | delay += azx_dev->bufsize; | 2159 | delay += azx_dev->bufsize; |
| 2159 | if (delay >= azx_dev->period_bytes) { | 2160 | if (delay >= azx_dev->period_bytes) { |
| 2160 | snd_printdd("delay %d > period_bytes %d\n", | 2161 | snd_printk(KERN_WARNING SFX |
| 2161 | delay, azx_dev->period_bytes); | 2162 | "Unstable LPIB (%d >= %d); " |
| 2162 | delay = 0; /* something is wrong */ | 2163 | "disabling LPIB delay counting\n", |
| 2164 | delay, azx_dev->period_bytes); | ||
| 2165 | delay = 0; | ||
| 2166 | chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY; | ||
| 2163 | } | 2167 | } |
| 2164 | azx_dev->substream->runtime->delay = | 2168 | azx_dev->substream->runtime->delay = |
| 2165 | bytes_to_frames(azx_dev->substream->runtime, delay); | 2169 | bytes_to_frames(azx_dev->substream->runtime, delay); |
| @@ -2640,7 +2644,9 @@ static void azx_vs_set_state(struct pci_dev *pci, | |||
| 2640 | if (disabled) { | 2644 | if (disabled) { |
| 2641 | azx_suspend(&pci->dev); | 2645 | azx_suspend(&pci->dev); |
| 2642 | chip->disabled = true; | 2646 | chip->disabled = true; |
| 2643 | snd_hda_lock_devices(chip->bus); | 2647 | if (snd_hda_lock_devices(chip->bus)) |
| 2648 | snd_printk(KERN_WARNING SFX | ||
| 2649 | "Cannot lock devices!\n"); | ||
| 2644 | } else { | 2650 | } else { |
| 2645 | snd_hda_unlock_devices(chip->bus); | 2651 | snd_hda_unlock_devices(chip->bus); |
| 2646 | chip->disabled = false; | 2652 | chip->disabled = false; |
| @@ -2683,14 +2689,20 @@ static const struct vga_switcheroo_client_ops azx_vs_ops = { | |||
| 2683 | 2689 | ||
| 2684 | static int __devinit register_vga_switcheroo(struct azx *chip) | 2690 | static int __devinit register_vga_switcheroo(struct azx *chip) |
| 2685 | { | 2691 | { |
| 2692 | int err; | ||
| 2693 | |||
| 2686 | if (!chip->use_vga_switcheroo) | 2694 | if (!chip->use_vga_switcheroo) |
| 2687 | return 0; | 2695 | return 0; |
| 2688 | /* FIXME: currently only handling DIS controller | 2696 | /* FIXME: currently only handling DIS controller |
| 2689 | * is there any machine with two switchable HDMI audio controllers? | 2697 | * is there any machine with two switchable HDMI audio controllers? |
| 2690 | */ | 2698 | */ |
| 2691 | return vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops, | 2699 | err = vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops, |
| 2692 | VGA_SWITCHEROO_DIS, | 2700 | VGA_SWITCHEROO_DIS, |
| 2693 | chip->bus != NULL); | 2701 | chip->bus != NULL); |
| 2702 | if (err < 0) | ||
| 2703 | return err; | ||
| 2704 | chip->vga_switcheroo_registered = 1; | ||
| 2705 | return 0; | ||
| 2694 | } | 2706 | } |
| 2695 | #else | 2707 | #else |
| 2696 | #define init_vga_switcheroo(chip) /* NOP */ | 2708 | #define init_vga_switcheroo(chip) /* NOP */ |
| @@ -2712,7 +2724,8 @@ static int azx_free(struct azx *chip) | |||
| 2712 | if (use_vga_switcheroo(chip)) { | 2724 | if (use_vga_switcheroo(chip)) { |
| 2713 | if (chip->disabled && chip->bus) | 2725 | if (chip->disabled && chip->bus) |
| 2714 | snd_hda_unlock_devices(chip->bus); | 2726 | snd_hda_unlock_devices(chip->bus); |
| 2715 | vga_switcheroo_unregister_client(chip->pci); | 2727 | if (chip->vga_switcheroo_registered) |
| 2728 | vga_switcheroo_unregister_client(chip->pci); | ||
| 2716 | } | 2729 | } |
| 2717 | 2730 | ||
| 2718 | if (chip->initialized) { | 2731 | if (chip->initialized) { |
| @@ -2813,8 +2826,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { | |||
| 2813 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), | 2826 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), |
| 2814 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), | 2827 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), |
| 2815 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), | 2828 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), |
| 2816 | SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF), | ||
| 2817 | SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF), | ||
| 2818 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), | 2829 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), |
| 2819 | SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), | 2830 | SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), |
| 2820 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), | 2831 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), |
| @@ -3062,14 +3073,6 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
| 3062 | } | 3073 | } |
| 3063 | 3074 | ||
| 3064 | ok: | 3075 | ok: |
| 3065 | err = register_vga_switcheroo(chip); | ||
| 3066 | if (err < 0) { | ||
| 3067 | snd_printk(KERN_ERR SFX | ||
| 3068 | "Error registering VGA-switcheroo client\n"); | ||
| 3069 | azx_free(chip); | ||
| 3070 | return err; | ||
| 3071 | } | ||
| 3072 | |||
| 3073 | err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); | 3076 | err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); |
| 3074 | if (err < 0) { | 3077 | if (err < 0) { |
| 3075 | snd_printk(KERN_ERR SFX "Error creating device [card]!\n"); | 3078 | snd_printk(KERN_ERR SFX "Error creating device [card]!\n"); |
| @@ -3340,6 +3343,13 @@ static int __devinit azx_probe(struct pci_dev *pci, | |||
| 3340 | if (pci_dev_run_wake(pci)) | 3343 | if (pci_dev_run_wake(pci)) |
| 3341 | pm_runtime_put_noidle(&pci->dev); | 3344 | pm_runtime_put_noidle(&pci->dev); |
| 3342 | 3345 | ||
| 3346 | err = register_vga_switcheroo(chip); | ||
| 3347 | if (err < 0) { | ||
| 3348 | snd_printk(KERN_ERR SFX | ||
| 3349 | "Error registering VGA-switcheroo client\n"); | ||
| 3350 | goto out_free; | ||
| 3351 | } | ||
| 3352 | |||
| 3343 | dev++; | 3353 | dev++; |
| 3344 | return 0; | 3354 | return 0; |
| 3345 | 3355 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8253b4eeb6a1..48d9d609f89b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch, | |||
| 2598 | return "PCM"; | 2598 | return "PCM"; |
| 2599 | break; | 2599 | break; |
| 2600 | } | 2600 | } |
| 2601 | if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name))) | 2601 | if (ch >= ARRAY_SIZE(channel_name)) { |
| 2602 | snd_BUG(); | ||
| 2602 | return "PCM"; | 2603 | return "PCM"; |
| 2604 | } | ||
| 2603 | 2605 | ||
| 2604 | return channel_name[ch]; | 2606 | return channel_name[ch]; |
| 2605 | } | 2607 | } |
