diff options
28 files changed, 179 insertions, 84 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index 0ecbe4edbec1..aaa568a3806e 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -363,7 +363,7 @@ static int card_resume(struct pnp_dev *dev) int pnp_register_card_driver(struct pnp_card_driver * drv) { - int count = 0; + int count; struct list_head *pos, *temp; drv->link.name = drv->name; @@ -374,10 +374,15 @@ int pnp_register_card_driver(struct pnp_card_driver * drv) drv->link.suspend = drv->suspend ? card_suspend : NULL; drv->link.resume = drv->resume ? card_resume : NULL; + count = pnp_register_driver(&drv->link); + if (count < 0) + return count; + spin_lock(&pnp_lock); list_add_tail(&drv->global_list, &pnp_card_drivers); spin_unlock(&pnp_lock); - pnp_register_driver(&drv->link); + + count = 0; list_for_each_safe(pos,temp,&pnp_cards){ struct pnp_card *card = list_entry(pos, struct pnp_card, global_list); diff --git a/sound/core/info.c b/sound/core/info.c index ae8853921464..af123e3bdb24 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -444,8 +444,8 @@ static unsigned int snd_info_entry_poll(struct file *file, poll_table * wait) return mask; } -static inline int _snd_info_entry_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static long snd_info_entry_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) { struct snd_info_private_data *data; struct snd_info_entry *entry; @@ -465,17 +465,6 @@ static inline int _snd_info_entry_ioctl(struct inode *inode, struct file *file, return -ENOTTY; } -/* FIXME: need to unlock BKL to allow preemption */ -static int snd_info_entry_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - int err; - unlock_kernel(); - err = _snd_info_entry_ioctl(inode, file, cmd, arg); - lock_kernel(); - return err; -} - static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma) { struct inode *inode = file->f_dentry->d_inode; @@ -499,15 +488,15 @@ static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma) static struct file_operations snd_info_entry_operations = { - .owner = THIS_MODULE, - .llseek = snd_info_entry_llseek, - .read = snd_info_entry_read, - .write = snd_info_entry_write, - .poll = snd_info_entry_poll, - .ioctl = snd_info_entry_ioctl, - .mmap = snd_info_entry_mmap, - .open = snd_info_entry_open, - .release = snd_info_entry_release, + .owner = THIS_MODULE, + .llseek = snd_info_entry_llseek, + .read = snd_info_entry_read, + .write = snd_info_entry_write, + .poll = snd_info_entry_poll, + .unlocked_ioctl = snd_info_entry_ioctl, + .mmap = snd_info_entry_mmap, + .open = snd_info_entry_open, + .release = snd_info_entry_release, }; /** diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index bd8e23818460..fd9bb2575de8 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -109,7 +109,9 @@ module_param_array(wssdma, int, NULL, 0444); MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); static struct platform_device *platform_devices[SNDRV_CARDS]; +#ifdef CONFIG_PNP static int pnp_registered; +#endif #define CMI8330_RMUX3D 16 #define CMI8330_MUTEMUX 17 @@ -672,8 +674,10 @@ static void __init_or_module snd_cmi8330_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnp_registered) pnp_unregister_card_driver(&cmi8330_pnpc_driver); +#endif for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&snd_cmi8330_driver); @@ -700,11 +704,13 @@ static int __init alsa_card_cmi8330_init(void) cards++; } +#ifdef CONFIG_PNP err = pnp_register_card_driver(&cmi8330_pnpc_driver); if (err >= 0) { pnp_registered = 1; cards += err; } +#endif if (!cards) { #ifdef MODULE diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index e1683337e6cd..edf9279bf9d9 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -75,8 +75,10 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235}," #ifdef CS4232 #define IDENT "CS4232" +#define CS423X_DRIVER "snd_cs4232" #else #define IDENT "CS4236+" +#define CS423X_DRIVER "snd_cs4236" #endif static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ @@ -125,10 +127,12 @@ module_param_array(dma2, int, NULL, 0444); MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); static struct platform_device *platform_devices[SNDRV_CARDS]; +#ifdef CONFIG_PNP static int pnpc_registered; #ifdef CS4232 static int pnp_registered; #endif +#endif /* CONFIG_PNP */ struct snd_card_cs4236 { struct snd_cs4231 *chip; @@ -158,7 +162,6 @@ MODULE_DEVICE_TABLE(pnp, snd_cs4232_pnpbiosids); #endif /* CS4232 */ #ifdef CS4232 -#define CS423X_DRIVER "snd_cs4232" #define CS423X_ISAPNP_DRIVER "cs4232_isapnp" static struct pnp_card_device_id snd_cs423x_pnpids[] = { /* Philips PCA70PS */ @@ -179,7 +182,6 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = { { .id = "" } /* end */ }; #else /* CS4236 */ -#define CS423X_DRIVER "snd_cs4236" #define CS423X_ISAPNP_DRIVER "cs4236_isapnp" static struct pnp_card_device_id snd_cs423x_pnpids[] = { /* Intel Marlin Spike Motherboard - CS4235 */ @@ -747,12 +749,14 @@ static void __init_or_module snd_cs423x_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnpc_registered) pnp_unregister_card_driver(&cs423x_pnpc_driver); #ifdef CS4232 if (pnp_registered) pnp_unregister_driver(&cs4232_pnp_driver); #endif +#endif /* CONFIG_PNP */ for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&cs423x_nonpnp_driver); @@ -778,6 +782,7 @@ static int __init alsa_card_cs423x_init(void) platform_devices[i] = device; cards++; } +#ifdef CONFIG_PNP #ifdef CS4232 i = pnp_register_driver(&cs4232_pnp_driver); if (i >= 0) { @@ -790,6 +795,8 @@ static int __init alsa_card_cs423x_init(void) pnpc_registered = 1; cards += i; } +#endif /* CONFIG_PNP */ + if (!cards) { #ifdef MODULE printk(KERN_ERR IDENT " soundcard not found or device busy\n"); diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index bf5de0782eb0..08f032b51107 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -1878,9 +1878,9 @@ module_param_array(dma2, int, NULL, 0444); MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); static struct platform_device *platform_devices[SNDRV_CARDS]; -static int pnp_registered; #ifdef CONFIG_PNP +static int pnp_registered; static struct pnp_card_device_id snd_audiodrive_pnpids[] = { /* ESS 1868 (integrated on Compaq dual P-Pro motherboard and Genius 18PnP 3D) */ @@ -2209,8 +2209,10 @@ static void __init_or_module snd_es18xx_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnp_registered) pnp_unregister_card_driver(&es18xx_pnpc_driver); +#endif for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&snd_es18xx_nonpnp_driver); @@ -2237,11 +2239,13 @@ static int __init alsa_card_es18xx_init(void) cards++; } +#ifdef CONFIG_PNP i = pnp_register_card_driver(&es18xx_pnpc_driver); if (i >= 0) { pnp_registered = 1; cards += i; } +#endif if(!cards) { #ifdef MODULE diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index ca359e0c674b..9dc6b20e9a5c 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -91,8 +91,10 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444); MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); static struct platform_device *platform_devices[SNDRV_CARDS]; +#ifdef CONFIG_PNP static int pnp_registered; static int pnpc_registered; +#endif /* control ports */ #define OPL3SA2_PM_CTRL 0x01 @@ -779,7 +781,7 @@ static int snd_opl3sa2_pnp_resume(struct pnp_dev *pdev) #endif static struct pnp_driver opl3sa2_pnp_driver = { - .name = "opl3sa2-pnpbios", + .name = "snd-opl3sa2-pnpbios", .id_table = snd_opl3sa2_pnpbiosids, .probe = snd_opl3sa2_pnp_detect, .remove = __devexit_p(snd_opl3sa2_pnp_remove), @@ -846,7 +848,7 @@ static int snd_opl3sa2_pnp_cresume(struct pnp_card_link *pcard) static struct pnp_card_driver opl3sa2_pnpc_driver = { .flags = PNP_DRIVER_RES_DISABLE, - .name = "opl3sa2", + .name = "snd-opl3sa2-cpnp", .id_table = snd_opl3sa2_pnpids, .probe = snd_opl3sa2_pnp_cdetect, .remove = __devexit_p(snd_opl3sa2_pnp_cremove), @@ -929,10 +931,12 @@ static void __init_or_module snd_opl3sa2_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnpc_registered) pnp_unregister_card_driver(&opl3sa2_pnpc_driver); if (pnp_registered) pnp_unregister_driver(&opl3sa2_pnp_driver); +#endif for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&snd_opl3sa2_nonpnp_driver); @@ -961,6 +965,7 @@ static int __init alsa_card_opl3sa2_init(void) cards++; } +#ifdef CONFIG_PNP err = pnp_register_driver(&opl3sa2_pnp_driver); if (err >= 0) { pnp_registered = 1; @@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void) pnpc_registered = 1; cards += err; } +#endif if (!cards) { #ifdef MODULE diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index c0be7a5a3425..0667bd14ad60 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c @@ -179,6 +179,8 @@ static struct pnp_card_device_id snd_sb16_pnpids[] = { { .id = "CTL0086", .devs = { { "CTL0041" } } }, /* Sound Blaster Vibra16X */ { .id = "CTL00f0", .devs = { { "CTL0043" } } }, + /* Sound Blaster 16 (Virtual PC 2004) */ + { .id = "tBA03b0", .devs = { {.id="PNPb003" } } }, #else /* SNDRV_SBAWE defined */ /* Sound Blaster AWE 32 PnP */ { .id = "CTL0035", .devs = { { "CTL0031" }, { "CTL0021" } } }, @@ -235,8 +237,6 @@ static struct pnp_card_device_id snd_sb16_pnpids[] = { { .id = "CTLXXXX" , .devs = { { "CTL0044" }, { "CTL0023" } } }, { .id = "CTLXXXX" , .devs = { { "CTL0045" }, { "CTL0022" } } }, #endif /* SNDRV_SBAWE */ - /* Sound Blaster 16 PnP (Virtual PC 2004)*/ - { .id = "tBA03b0", .devs = { { "PNPb003" } } }, { .id = "", } }; diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 5fb981c0a281..29bba8cc3ef3 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c @@ -69,9 +69,9 @@ module_param_array(dma, int, NULL, 0444); MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); static struct platform_device *platform_devices[SNDRV_CARDS]; -static int pnp_registered; #ifdef CONFIG_PNP +static int pnp_registered; static struct pnp_card_device_id sscape_pnpids[] = { { .id = "ENS3081", .devs = { { "ENS0000" } } }, { .id = "" } /* end */ @@ -1391,8 +1391,10 @@ static void __init_or_module sscape_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnp_registered) pnp_unregister_card_driver(&sscape_pnpc_driver); +#endif for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&snd_sscape_driver); @@ -1466,8 +1468,10 @@ static int __init sscape_init(void) ret = sscape_manual_probe(); if (ret < 0) return ret; +#ifdef CONFIG_PNP if (pnp_register_card_driver(&sscape_pnpc_driver) >= 0) pnp_registered = 1; +#endif return 0; } diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index a6dcb2f970ca..fa3ab960de17 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c @@ -84,10 +84,9 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444); MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); static struct platform_device *platform_devices[SNDRV_CARDS]; -static int pnp_registered; - #ifdef CONFIG_PNP +static int pnp_registered; static struct pnp_card_device_id snd_wavefront_pnpids[] = { /* Tropez */ @@ -695,8 +694,10 @@ static void __init_or_module snd_wavefront_unregister_all(void) { int i; +#ifdef CONFIG_PNP if (pnp_registered) pnp_unregister_card_driver(&wavefront_pnpc_driver); +#endif for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) platform_device_unregister(platform_devices[i]); platform_driver_unregister(&snd_wavefront_driver); @@ -725,11 +726,13 @@ static int __init alsa_card_wavefront_init(void) cards++; } +#ifdef CONFIG_PNP i = pnp_register_card_driver(&wavefront_pnpc_driver); if (i >= 0) { pnp_registered = 1; cards += i; } +#endif if (!cards) { #ifdef MODULE diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 4aa5fdc5688e..a444a78c7c94 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c @@ -1621,8 +1621,27 @@ static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = { AC97_SINGLE("Line Jack Sense", AC97_AD_JACK_SPDIF, 12, 1, 0), }; +/* black list to avoid HP/Line jack-sense controls + * (SS vendor << 16 | device) + */ +static unsigned int ad1981_jacks_blacklist[] = { + 0x10140554, /* Thinkpad T42p/R50p */ + 0 /* end */ +}; + +static int check_list(struct snd_ac97 *ac97, const unsigned int *list) +{ + u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; + for (; *list; list++) + if (*list == subid) + return 1; + return 0; +} + static int patch_ad1981a_specific(struct snd_ac97 * ac97) { + if (check_list(ac97, ad1981_jacks_blacklist)) + return 0; return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); } @@ -1635,22 +1654,26 @@ static struct snd_ac97_build_ops patch_ad1981a_build_ops = { #endif }; +/* white list to enable HP jack-sense bits + * (SS vendor << 16 | device) + */ +static unsigned int ad1981_jacks_whitelist[] = { + 0x0e11005a, /* HP nc4000/4010 */ + 0x103c0890, /* HP nc6000 */ + 0x103c0938, /* HP nc4220 */ + 0x103c099c, /* HP nx6110 */ + 0x103c0944, /* HP nc6220 */ + 0x103c0934, /* HP nc8220 */ + 0x103c006d, /* HP nx9105 */ + 0x17340088, /* FSC Scenic-W */ + 0 /* end */ +}; + static void check_ad1981_hp_jack_sense(struct snd_ac97 *ac97) { - u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device; - switch (subid) { - case 0x0e11005a: /* HP nc4000/4010 */ - case 0x103c0890: /* HP nc6000 */ - case 0x103c0938: /* HP nc4220 */ - case 0x103c099c: /* HP nx6110 */ - case 0x103c0944: /* HP nc6220 */ - case 0x103c0934: /* HP nc8220 */ - case 0x103c006d: /* HP nx9105 */ - case 0x17340088: /* FSC Scenic-W */ + if (check_list(ac97, ad1981_jacks_whitelist)) /* enable headphone jack sense */ snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); - break; - } } int patch_ad1981a(struct snd_ac97 *ac97) @@ -1672,6 +1695,8 @@ static int patch_ad1981b_specific(struct snd_ac97 *ac97) if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0) return err; + if (check_list(ac97, ad1981_jacks_blacklist)) + return 0; return patch_build_controls(ac97, snd_ac97_ad1981x_jack_sense, ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); } @@ -2210,9 +2235,9 @@ static void alc850_update_jacks(struct snd_ac97 *ac97) /* Vref disable (bit12), 1kOhm (bit13) */ snd_ac97_update_bits(ac97, AC97_ALC850_MISC1, (1<<12)|(1<<13), shared ? (1<<12) : (1<<13)); - /* MIC-IN = 1, CENTER-LFE = 2 */ + /* MIC-IN = 1, CENTER-LFE = 5 */ snd_ac97_update_bits(ac97, AC97_ALC850_JACK_SELECT, 7 << 4, - shared ? (2<<4) : (1<<4)); + shared ? (5<<4) : (1<<4)); } static const struct snd_kcontrol_new snd_ac97_controls_alc850[] = { diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index bc4d1ef08efa..e264136e8fb4 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -279,7 +279,7 @@ struct snd_ali { }; static struct pci_device_id snd_ali_ids[] = { - {0x10b9, 0x5451, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, + {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0}, {0, } }; MODULE_DEVICE_TABLE(pci, snd_ali_ids); diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c index 13bc8ed301c5..c8280f82eb5a 100644 --- a/sound/pci/au88x0/au88x0_eq.c +++ b/sound/pci/au88x0/au88x0_eq.c @@ -849,7 +849,7 @@ static int snd_vortex_peaks_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { vortex_t *vortex = snd_kcontrol_chip(kcontrol); - int i, count; + int i, count = 0; u16 peaks[20]; vortex_Eqlzr_GetAllPeaks(vortex, peaks, &count); diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index dc9cd3079b14..c840a4c08e98 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c @@ -781,6 +781,8 @@ static struct pci_device_id snd_bt87x_ids[] = { BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, 0x0070, 0x13eb, 32000), /* Viewcast Osprey 200 */ BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0xff01, 44100), + /* AVerMedia Studio No. 103, 203, ...? */ + BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1461, 0x0003, 48000), { } }; MODULE_DEVICE_TABLE(pci, snd_bt87x_ids); @@ -808,7 +810,7 @@ static int __devinit snd_bt87x_detect_card(struct pci_dev *pci) const struct pci_device_id *supported; supported = pci_match_device(&driver, pci); - if (supported) + if (supported && supported->driver_data > 0) return supported->driver_data; for (i = 0; i < ARRAY_SIZE(blacklist); ++i) diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 6ed7c0bfa091..9477838a9c88 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -199,7 +199,8 @@ static struct snd_ca0106_details ca0106_chip_details[] = { .name = "MSI K8N Diamond MB [SB0438]", .gpio_type = 1, .i2c_adc = 1 } , - /* Shuttle XPC SD31P which has an onboard Creative Labs Sound Blaster Live! 24-bit EAX + /* Shuttle XPC SD31P which has an onboard Creative Labs + * Sound Blaster Live! 24-bit EAX * high-definition 7.1 audio processor". * Added using info from andrewvegan in alsa bug #1298 */ @@ -207,6 +208,15 @@ static struct snd_ca0106_details ca0106_chip_details[] = { .name = "Shuttle XPC SD31P [SD31P]", .gpio_type = 1, .i2c_adc = 1 } , + /* Shuttle XPC SD11G5 which has an onboard Creative Labs + * Sound Blaster Live! 24-bit EAX + * high-definition 7.1 audio processor". + * Fixes ALSA bug#1600 + */ + { .serial = 0x30411297, + .name = "Shuttle XPC SD11G5 [SD11G5]", + .gpio_type = 1, + .i2c_adc = 1 } , { .serial = 0, .name = "AudigyLS [Unknown]" } }; diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 509aa2b63331..d4e0fb39bd06 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -675,7 +675,7 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name, if (pass_through) { /* wont work with any other rate than the native DSP rate */ - snd_assert (rate = 48000); + snd_assert (rate == 48000); scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&src_task_scb, dest,"DMAREADER",parent_scb, diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index f36ede827479..02e3721030b7 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -46,8 +46,10 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; static struct pci_device_id snd_cs5535audio_ids[] = { - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0, }, + { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, {} }; diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 2e86a901a0a4..2a9d12d10680 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -759,6 +759,8 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, "Master Mono Playback Volume", "PCM Out Path & Mute", "Mono Output Select", + "Front Playback Switch", + "Front Playback Volume", "Surround Playback Switch", "Surround Playback Volume", "Center Playback Switch", @@ -829,9 +831,9 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, } if (emu->audigy) { /* set master volume to 0 dB */ - snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000); + snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000); /* set capture source to mic */ - snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000); + snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000); c = audigy_remove_ctls; } else { /* @@ -844,8 +846,8 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu, snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE|AC97SLOT_REAR_LEFT|AC97SLOT_REAR_RIGHT); } /* remove unused AC97 controls */ - snd_ac97_write(emu->ac97, AC97_SURROUND_MASTER, 0x0202); - snd_ac97_write(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202); + snd_ac97_write_cache(emu->ac97, AC97_SURROUND_MASTER, 0x0202); + snd_ac97_write_cache(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202); c = emu10k1_remove_ctls; } for (; *c; c++) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index a983deba4025..fd12b6991fe4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -75,6 +75,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," "{Intel, ICH6M}," "{Intel, ICH7}," "{Intel, ESB2}," + "{Intel, ICH8}," "{ATI, SB450}," "{VIA, VT8251}," "{VIA, VT8237A}," @@ -1586,6 +1587,7 @@ static struct pci_device_id azx_ids[] = { { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */ { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ + { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */ { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ad9e501a9818..543980d89b83 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2945,6 +2945,8 @@ static int alc260_auto_init(struct hda_codec *codec) */ static struct hda_board_config alc260_cfg_tbl[] = { { .modelname = "basic", .config = ALC260_BASIC }, + { .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb, + .config = ALC260_BASIC }, /* Sony VAIO */ { .modelname = "hp", .config = ALC260_HP }, { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP }, { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP }, diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 61903848cd43..4f78b58416a4 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -183,6 +183,7 @@ static struct snd_kcontrol_new stac922x_mixer[] = { .put = stac92xx_mux_enum_put, }, HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mux Capture Volume", 0x12, 0x0, HDA_OUTPUT), { } /* end */ }; diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 5466b1fa0cd5..b345894659bb 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1805,6 +1805,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { }, { .subvendor = 0x1028, + .subdevice = 0x0151, + .name = "Dell Optiplex GX270", /* AD1981B */ + .type = AC97_TUNE_HP_ONLY + }, + { + .subvendor = 0x1028, .subdevice = 0x0163, .name = "Dell Unknown", /* STAC9750/51 */ .type = AC97_TUNE_HP_ONLY @@ -1847,12 +1853,6 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { }, { .subvendor = 0x103c, - .subdevice = 0x099c, - .name = "HP nx6110", /* AD1981B */ - .type = AC97_TUNE_HP_ONLY - }, - { - .subvendor = 0x103c, .subdevice = 0x129d, .name = "HP xw8000", .type = AC97_TUNE_HP_ONLY @@ -1866,7 +1866,7 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { { .subvendor = 0x103c, .subdevice = 0x099c, - .name = "HP nc6120", + .name = "HP nx6110/nc6120", .type = AC97_TUNE_HP_MUTE_LED }, { diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index b8c0853a8278..b2cba75b6b16 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -454,7 +454,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) is_capture = (subs->stream == SNDRV_PCM_STREAM_CAPTURE); stream_num = is_capture ? 0 : subs->number; - snd_printdd("pcxhr_update_r_buffer(pcm%c%d) : addr(%p) bytes(%x) subs(%d)\n", + snd_printdd("pcxhr_update_r_buffer(pcm%c%d) : addr(%p) bytes(%zx) subs(%d)\n", is_capture ? 'c' : 'p', chip->chip_idx, (void*)subs->runtime->dma_addr, subs->runtime->dma_bytes, subs->number); @@ -744,13 +744,14 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs) /* only the first stream can choose the sample rate */ /* the further opened streams will be limited to its frequency (see open) */ /* set the clock only once (first stream) */ - if (mgr->sample_rate == 0) { + if (mgr->sample_rate != subs->runtime->rate) { err = pcxhr_set_clock(mgr, subs->runtime->rate); if (err) break; + if (mgr->sample_rate == 0) + /* start the DSP-timer */ + err = pcxhr_hardware_timer(mgr, 1); mgr->sample_rate = subs->runtime->rate; - - err = pcxhr_hardware_timer(mgr, 1); /* start the DSP-timer */ } } while(0); /* do only once (so we can use break instead of goto) */ diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 3dec616bad6b..103b4d715ff4 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -3324,11 +3324,11 @@ static int __devinit snd_hdspm_preallocate_memory(struct hdspm * hdspm) snd_dma_pci_data(hdspm->pci), wanted, wanted)) < 0) { - snd_printdd("Could not preallocate %d Bytes\n", wanted); + snd_printdd("Could not preallocate %zd Bytes\n", wanted); return err; } else - snd_printdd(" Preallocated %d Bytes\n", wanted); + snd_printdd(" Preallocated %zd Bytes\n", wanted); return 0; } @@ -3510,7 +3510,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card, struct hdspm * hdsp hdspm->monitor_outs = enable_monitor; - snd_printdd("kmalloc Mixer memory of %d Bytes\n", + snd_printdd("kmalloc Mixer memory of %zd Bytes\n", sizeof(struct hdspm_mixer)); if ((hdspm->mixer = kmalloc(sizeof(struct hdspm_mixer), GFP_KERNEL)) == NULL) { diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index 2b21df16ad6a..b4538045049f 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -64,9 +64,11 @@ module_param_array(wavetable_size, int, NULL, 0444); MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth."); static struct pci_device_id snd_trident_ids[] = { - { 0x1023, 0x2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Trident 4DWave DX PCI Audio */ - { 0x1023, 0x2001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Trident 4DWave NX PCI Audio */ - { 0x1039, 0x7018, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* SiS SI7018 PCI Audio */ + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), + PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0}, + {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), + 0, 0, 0}, + {PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, 0}, { 0, } }; diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index ed26a155c344..d59fe3e83f17 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -2340,6 +2340,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci) { .subvendor = 0x1043, .subdevice = 0x80b0, .action = VIA_DXS_NO_VRA }, /* ASUS A7V600 & K8V*/ { .subvendor = 0x1043, .subdevice = 0x810d, .action = VIA_DXS_SRC }, /* ASUS */ { .subvendor = 0x1043, .subdevice = 0x812a, .action = VIA_DXS_SRC }, /* ASUS A8V Deluxe */ + { .subvendor = 0x1043, .subdevice = 0x8174, .action = VIA_DXS_SRC }, /* ASUS */ { .subvendor = 0x1071, .subdevice = 0x8375, .action = VIA_DXS_NO_VRA }, /* Vobis/Yakumo/Mitac notebook */ { .subvendor = 0x1071, .subdevice = 0x8399, .action = VIA_DXS_NO_VRA }, /* Umax AB 595T (VIA K8N800A - VT8237) */ { .subvendor = 0x10cf, .subdevice = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */ @@ -2371,6 +2372,8 @@ static int __devinit check_dxs_list(struct pci_dev *pci) { .subvendor = 0x161f, .subdevice = 0x2032, .action = VIA_DXS_48K }, /* m680x machines */ { .subvendor = 0x1631, .subdevice = 0xe004, .action = VIA_DXS_ENABLE }, /* Easy Note 3174, Packard Bell */ { .subvendor = 0x1695, .subdevice = 0x3005, .action = VIA_DXS_ENABLE }, /* EPoX EP-8K9A */ + { .subvendor = 0x1695, .subdevice = 0x300e, .action = VIA_DXS_SRC }, /* EPoX 9HEAI */ + { .subvendor = 0x16f3, .subdevice = 0x6405, .action = VIA_DXS_SRC }, /* Jetway K8M8MS */ { .subvendor = 0x1849, .subdevice = 0x3059, .action = VIA_DXS_NO_VRA }, /* ASRock K7VM2 */ { .subvendor = 0x1849, .subdevice = 0x9761, .action = VIA_DXS_SRC }, /* ASRock mobo(?) */ { .subvendor = 0x1919, .subdevice = 0x200a, .action = VIA_DXS_NO_VRA }, /* Soltek SL-K8Tpro-939 */ diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 1dfc7233c6a8..a1aa74b79b3d 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1229,6 +1229,7 @@ static int snd_ymfpci_spdif_default_get(struct snd_kcontrol *kcontrol, spin_lock_irq(&chip->reg_lock); ucontrol->value.iec958.status[0] = (chip->spdif_bits >> 0) & 0xff; ucontrol->value.iec958.status[1] = (chip->spdif_bits >> 8) & 0xff; + ucontrol->value.iec958.status[3] = IEC958_AES3_CON_FS_48000; spin_unlock_irq(&chip->reg_lock); return 0; } @@ -1303,6 +1304,7 @@ static int snd_ymfpci_spdif_stream_get(struct snd_kcontrol *kcontrol, spin_lock_irq(&chip->reg_lock); ucontrol->value.iec958.status[0] = (chip->spdif_pcm_bits >> 0) & 0xff; ucontrol->value.iec958.status[1] = (chip->spdif_pcm_bits >> 8) & 0xff; + ucontrol->value.iec958.status[3] = IEC958_AES3_CON_FS_48000; spin_unlock_irq(&chip->reg_lock); return 0; } diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index a642e4cfcf45..4988f873a7ba 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1216,7 +1216,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) goto __error; } for (i = 0; i < 3; i ++) { - if (of_address_to_resource(np->parent, i, + if (of_address_to_resource(np, i, &chip->rsrc[i])) { printk(KERN_ERR "snd: can't translate rsrc " " %d (%s)\n", i, rnames[i]); diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index a1bd8040dea4..d5013383fad7 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -478,22 +478,38 @@ static int retire_playback_sync_urb_hs(struct snd_usb_substream *subs, /* * Prepare urb for streaming before playback starts. * - * We don't care about (or have) any data, so we just send a transfer delimiter. + * We don't yet have data, so we send a frame of silence. */ static int prepare_startup_playback_urb(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *urb) { - unsigned int i; + unsigned int i, offs, counts; struct snd_urb_ctx *ctx = urb->context; + int stride = runtime->frame_bits >> 3; + offs = 0; urb->dev = ctx->subs->dev; urb->number_of_packets = subs->packs_per_ms; for (i = 0; i < subs->packs_per_ms; ++i) { - urb->iso_frame_desc[i].offset = 0; - urb->iso_frame_desc[i].length = 0; + /* calculate the size of a packet */ + if (subs->fill_max) + counts = subs->maxframesize; /* fixed */ + else { + subs->phase = (subs->phase & 0xffff) + + (subs->freqm << subs->datainterval); + counts = subs->phase >> 16; + if (counts > subs->maxframesize) + counts = subs->maxframesize; + } + urb->iso_frame_desc[i].offset = offs * stride; + urb->iso_frame_desc[i].length = counts * stride; + offs += counts; } - urb->transfer_buffer_length = 0; + urb->transfer_buffer_length = offs * stride; + memset(urb->transfer_buffer, + subs->cur_audiofmt->format == SNDRV_PCM_FORMAT_U8 ? 0x80 : 0, + offs * stride); return 0; } @@ -2477,12 +2493,13 @@ static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp if (err < 0) return err; #if 1 - /* FIXME: temporary hack for extigy/audigy 2 nx */ + /* FIXME: temporary hack for extigy/audigy 2 nx/zs */ /* extigy apparently supports sample rates other than 48k * but not in ordinary way. so we enable only 48k atm. */ if (chip->usb_id == USB_ID(0x041e, 0x3000) || - chip->usb_id == USB_ID(0x041e, 0x3020)) { + chip->usb_id == USB_ID(0x041e, 0x3020) || + chip->usb_id == USB_ID(0x041e, 0x3061)) { if (fmt[3] == USB_FORMAT_TYPE_I && fp->rates != SNDRV_PCM_RATE_48000 && fp->rates != SNDRV_PCM_RATE_96000) |