aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/pxa2xx-ac97.c6
-rw-r--r--sound/core/misc.c1
-rw-r--r--sound/core/seq/instr/ainstr_fm.c1
-rw-r--r--sound/core/seq/instr/ainstr_gf1.c1
-rw-r--r--sound/core/seq/instr/ainstr_iw.c1
-rw-r--r--sound/core/seq/instr/ainstr_simple.c1
-rw-r--r--sound/core/seq/seq_virmidi.c1
-rw-r--r--sound/drivers/dummy.c11
-rw-r--r--sound/drivers/mtpav.c12
-rw-r--r--sound/drivers/mts64.c6
-rw-r--r--sound/drivers/portman2x4.c6
-rw-r--r--sound/drivers/serial-u16550.c14
-rw-r--r--sound/drivers/virmidi.c7
-rw-r--r--sound/isa/ad1848/ad1848.c2
-rw-r--r--sound/isa/cmi8330.c4
-rw-r--r--sound/isa/dt019x.c1
-rw-r--r--sound/isa/es1688/es1688.c6
-rw-r--r--sound/isa/gus/gusclassic.c10
-rw-r--r--sound/isa/gus/gusextreme.c12
-rw-r--r--sound/isa/gus/gusmax.c13
-rw-r--r--sound/isa/opl3sa2.c4
-rw-r--r--sound/isa/sb/sb8.c6
-rw-r--r--sound/oss/ac97_codec.c3
-rw-r--r--sound/oss/ad1889.c3
-rw-r--r--sound/oss/btaudio.c3
-rw-r--r--sound/oss/cs46xx.c9
-rw-r--r--sound/oss/dmasound/dac3550a.c3
-rw-r--r--sound/oss/dmasound/tas3001c.c3
-rw-r--r--sound/oss/dmasound/tas3004.c3
-rw-r--r--sound/oss/dmasound/tas_common.c3
-rw-r--r--sound/oss/emu10k1/main.c11
-rw-r--r--sound/oss/es1371.c3
-rw-r--r--sound/oss/hal2.c3
-rw-r--r--sound/oss/i810_audio.c9
-rw-r--r--sound/oss/kahlua.c3
-rw-r--r--sound/oss/nec_vrc5477.c3
-rw-r--r--sound/oss/opl3.c3
-rw-r--r--sound/oss/sb_card.c6
-rw-r--r--sound/oss/swarm_cs4297a.c13
-rw-r--r--sound/oss/trident.c9
-rw-r--r--sound/oss/waveartist.c4
-rw-r--r--sound/pci/ac97/ac97_codec.c1
-rw-r--r--sound/pci/ac97/ac97_patch.c6
-rw-r--r--sound/pci/ac97/ac97_patch.h1
-rw-r--r--sound/pci/hda/patch_conexant.c343
-rw-r--r--sound/pci/hda/patch_sigmatel.c44
-rw-r--r--sound/soc/at91/at91-i2s.c43
-rw-r--r--sound/soc/at91/at91-pcm.c20
-rw-r--r--sound/soc/codecs/Kconfig8
-rw-r--r--sound/synth/emux/emux.c1
-rw-r--r--sound/synth/emux/emux_proc.c1
-rw-r--r--sound/usb/usbaudio.c10
-rw-r--r--sound/usb/usbquirks.h23
53 files changed, 424 insertions, 300 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index dede954b2c65..28db4be7a16f 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -305,7 +305,7 @@ static int pxa2xx_ac97_resume(struct platform_device *dev)
305#define pxa2xx_ac97_resume NULL 305#define pxa2xx_ac97_resume NULL
306#endif 306#endif
307 307
308static int pxa2xx_ac97_probe(struct platform_device *dev) 308static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
309{ 309{
310 struct snd_card *card; 310 struct snd_card *card;
311 struct snd_ac97_bus *ac97_bus; 311 struct snd_ac97_bus *ac97_bus;
@@ -369,7 +369,7 @@ static int pxa2xx_ac97_probe(struct platform_device *dev)
369 return ret; 369 return ret;
370} 370}
371 371
372static int pxa2xx_ac97_remove(struct platform_device *dev) 372static int __devexit pxa2xx_ac97_remove(struct platform_device *dev)
373{ 373{
374 struct snd_card *card = platform_get_drvdata(dev); 374 struct snd_card *card = platform_get_drvdata(dev);
375 375
@@ -386,7 +386,7 @@ static int pxa2xx_ac97_remove(struct platform_device *dev)
386 386
387static struct platform_driver pxa2xx_ac97_driver = { 387static struct platform_driver pxa2xx_ac97_driver = {
388 .probe = pxa2xx_ac97_probe, 388 .probe = pxa2xx_ac97_probe,
389 .remove = pxa2xx_ac97_remove, 389 .remove = __devexit_p(pxa2xx_ac97_remove),
390 .suspend = pxa2xx_ac97_suspend, 390 .suspend = pxa2xx_ac97_suspend,
391 .resume = pxa2xx_ac97_resume, 391 .resume = pxa2xx_ac97_resume,
392 .driver = { 392 .driver = {
diff --git a/sound/core/misc.c b/sound/core/misc.c
index 6db86a7c9704..f78cd000e88d 100644
--- a/sound/core/misc.c
+++ b/sound/core/misc.c
@@ -21,7 +21,6 @@
21 21
22#include <sound/driver.h> 22#include <sound/driver.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/sched.h>
25#include <linux/time.h> 24#include <linux/time.h>
26#include <linux/ioport.h> 25#include <linux/ioport.h>
27#include <sound/core.h> 26#include <sound/core.h>
diff --git a/sound/core/seq/instr/ainstr_fm.c b/sound/core/seq/instr/ainstr_fm.c
index b09babf272cd..f80fab8f2ed1 100644
--- a/sound/core/seq/instr/ainstr_fm.c
+++ b/sound/core/seq/instr/ainstr_fm.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h>
24#include <sound/core.h> 23#include <sound/core.h>
25#include <sound/ainstr_fm.h> 24#include <sound/ainstr_fm.h>
26#include <sound/initval.h> 25#include <sound/initval.h>
diff --git a/sound/core/seq/instr/ainstr_gf1.c b/sound/core/seq/instr/ainstr_gf1.c
index 3c31038a74ba..c640e1cf854d 100644
--- a/sound/core/seq/instr/ainstr_gf1.c
+++ b/sound/core/seq/instr/ainstr_gf1.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <sound/core.h> 24#include <sound/core.h>
26#include <sound/ainstr_gf1.h> 25#include <sound/ainstr_gf1.h>
diff --git a/sound/core/seq/instr/ainstr_iw.c b/sound/core/seq/instr/ainstr_iw.c
index 7f8df19ba563..5367baee2d08 100644
--- a/sound/core/seq/instr/ainstr_iw.c
+++ b/sound/core/seq/instr/ainstr_iw.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <sound/core.h> 24#include <sound/core.h>
26#include <sound/ainstr_iw.h> 25#include <sound/ainstr_iw.h>
diff --git a/sound/core/seq/instr/ainstr_simple.c b/sound/core/seq/instr/ainstr_simple.c
index 6d6ffece7cbe..ac717bef9d77 100644
--- a/sound/core/seq/instr/ainstr_simple.c
+++ b/sound/core/seq/instr/ainstr_simple.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <sound/core.h> 24#include <sound/core.h>
26#include <sound/ainstr_simple.h> 25#include <sound/ainstr_simple.h>
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
index 972f93405364..061a7c61402a 100644
--- a/sound/core/seq/seq_virmidi.c
+++ b/sound/core/seq/seq_virmidi.c
@@ -38,7 +38,6 @@
38#include <sound/driver.h> 38#include <sound/driver.h>
39#include <linux/init.h> 39#include <linux/init.h>
40#include <linux/wait.h> 40#include <linux/wait.h>
41#include <linux/sched.h>
42#include <linux/slab.h> 41#include <linux/slab.h>
43#include <sound/core.h> 42#include <sound/core.h>
44#include <sound/rawmidi.h> 43#include <sound/rawmidi.h>
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 8339bad969ba..a0f28f51fc7e 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -423,7 +423,8 @@ static struct snd_pcm_ops snd_card_dummy_capture_ops = {
423 .pointer = snd_card_dummy_pcm_pointer, 423 .pointer = snd_card_dummy_pcm_pointer,
424}; 424};
425 425
426static int __init snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams) 426static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
427 int substreams)
427{ 428{
428 struct snd_pcm *pcm; 429 struct snd_pcm *pcm;
429 int err; 430 int err;
@@ -562,7 +563,7 @@ DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
562DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD) 563DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD)
563}; 564};
564 565
565static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy) 566static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
566{ 567{
567 struct snd_card *card = dummy->card; 568 struct snd_card *card = dummy->card;
568 unsigned int idx; 569 unsigned int idx;
@@ -579,7 +580,7 @@ static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy)
579 return 0; 580 return 0;
580} 581}
581 582
582static int __init snd_dummy_probe(struct platform_device *devptr) 583static int __devinit snd_dummy_probe(struct platform_device *devptr)
583{ 584{
584 struct snd_card *card; 585 struct snd_card *card;
585 struct snd_dummy *dummy; 586 struct snd_dummy *dummy;
@@ -617,7 +618,7 @@ static int __init snd_dummy_probe(struct platform_device *devptr)
617 return err; 618 return err;
618} 619}
619 620
620static int snd_dummy_remove(struct platform_device *devptr) 621static int __devexit snd_dummy_remove(struct platform_device *devptr)
621{ 622{
622 snd_card_free(platform_get_drvdata(devptr)); 623 snd_card_free(platform_get_drvdata(devptr));
623 platform_set_drvdata(devptr, NULL); 624 platform_set_drvdata(devptr, NULL);
@@ -648,7 +649,7 @@ static int snd_dummy_resume(struct platform_device *pdev)
648 649
649static struct platform_driver snd_dummy_driver = { 650static struct platform_driver snd_dummy_driver = {
650 .probe = snd_dummy_probe, 651 .probe = snd_dummy_probe,
651 .remove = snd_dummy_remove, 652 .remove = __devexit_p(snd_dummy_remove),
652#ifdef CONFIG_PM 653#ifdef CONFIG_PM
653 .suspend = snd_dummy_suspend, 654 .suspend = snd_dummy_suspend,
654 .resume = snd_dummy_resume, 655 .resume = snd_dummy_resume,
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index a9ff391258e7..40eb026c86ed 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -583,7 +583,7 @@ static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id)
583/* 583/*
584 * get ISA resources 584 * get ISA resources
585 */ 585 */
586static int __init snd_mtpav_get_ISA(struct mtpav * mcard) 586static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard)
587{ 587{
588 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { 588 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
589 snd_printk("MTVAP port 0x%lx is busy\n", port); 589 snd_printk("MTVAP port 0x%lx is busy\n", port);
@@ -619,7 +619,7 @@ static struct snd_rawmidi_ops snd_mtpav_input = {
619 * get RAWMIDI resources 619 * get RAWMIDI resources
620 */ 620 */
621 621
622static void __init snd_mtpav_set_name(struct mtpav *chip, 622static void __devinit snd_mtpav_set_name(struct mtpav *chip,
623 struct snd_rawmidi_substream *substream) 623 struct snd_rawmidi_substream *substream)
624{ 624{
625 if (substream->number >= 0 && substream->number < chip->num_ports) 625 if (substream->number >= 0 && substream->number < chip->num_ports)
@@ -634,7 +634,7 @@ static void __init snd_mtpav_set_name(struct mtpav *chip,
634 strcpy(substream->name, "MTP broadcast"); 634 strcpy(substream->name, "MTP broadcast");
635} 635}
636 636
637static int __init snd_mtpav_get_RAWMIDI(struct mtpav *mcard) 637static int __devinit snd_mtpav_get_RAWMIDI(struct mtpav *mcard)
638{ 638{
639 int rval; 639 int rval;
640 struct snd_rawmidi *rawmidi; 640 struct snd_rawmidi *rawmidi;
@@ -691,7 +691,7 @@ static void snd_mtpav_free(struct snd_card *card)
691 691
692/* 692/*
693 */ 693 */
694static int __init snd_mtpav_probe(struct platform_device *dev) 694static int __devinit snd_mtpav_probe(struct platform_device *dev)
695{ 695{
696 struct snd_card *card; 696 struct snd_card *card;
697 int err; 697 int err;
@@ -745,7 +745,7 @@ static int __init snd_mtpav_probe(struct platform_device *dev)
745 return err; 745 return err;
746} 746}
747 747
748static int snd_mtpav_remove(struct platform_device *devptr) 748static int __devexit snd_mtpav_remove(struct platform_device *devptr)
749{ 749{
750 snd_card_free(platform_get_drvdata(devptr)); 750 snd_card_free(platform_get_drvdata(devptr));
751 platform_set_drvdata(devptr, NULL); 751 platform_set_drvdata(devptr, NULL);
@@ -756,7 +756,7 @@ static int snd_mtpav_remove(struct platform_device *devptr)
756 756
757static struct platform_driver snd_mtpav_driver = { 757static struct platform_driver snd_mtpav_driver = {
758 .probe = snd_mtpav_probe, 758 .probe = snd_mtpav_probe,
759 .remove = snd_mtpav_remove, 759 .remove = __devexit_p(snd_mtpav_remove),
760 .driver = { 760 .driver = {
761 .name = SND_MTPAV_DRIVER 761 .name = SND_MTPAV_DRIVER
762 }, 762 },
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
index 5327c6f841f4..6c9f4c9bfeb6 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
@@ -1026,7 +1026,7 @@ __err:
1026 return err; 1026 return err;
1027} 1027}
1028 1028
1029static int snd_mts64_remove(struct platform_device *pdev) 1029static int __devexit snd_mts64_remove(struct platform_device *pdev)
1030{ 1030{
1031 struct snd_card *card = platform_get_drvdata(pdev); 1031 struct snd_card *card = platform_get_drvdata(pdev);
1032 1032
@@ -1039,7 +1039,7 @@ static int snd_mts64_remove(struct platform_device *pdev)
1039 1039
1040static struct platform_driver snd_mts64_driver = { 1040static struct platform_driver snd_mts64_driver = {
1041 .probe = snd_mts64_probe, 1041 .probe = snd_mts64_probe,
1042 .remove = snd_mts64_remove, 1042 .remove = __devexit_p(snd_mts64_remove),
1043 .driver = { 1043 .driver = {
1044 .name = PLATFORM_DRIVER 1044 .name = PLATFORM_DRIVER
1045 } 1045 }
@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_driver = {
1048/********************************************************************* 1048/*********************************************************************
1049 * module init stuff 1049 * module init stuff
1050 *********************************************************************/ 1050 *********************************************************************/
1051static void snd_mts64_unregister_all(void) 1051static void __init_or_module snd_mts64_unregister_all(void)
1052{ 1052{
1053 int i; 1053 int i;
1054 1054
diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
index 6c48772aaefd..b2d0ba4bd184 100644
--- a/sound/drivers/portman2x4.c
+++ b/sound/drivers/portman2x4.c
@@ -811,7 +811,7 @@ __err:
811 return err; 811 return err;
812} 812}
813 813
814static int snd_portman_remove(struct platform_device *pdev) 814static int __devexit snd_portman_remove(struct platform_device *pdev)
815{ 815{
816 struct snd_card *card = platform_get_drvdata(pdev); 816 struct snd_card *card = platform_get_drvdata(pdev);
817 817
@@ -824,7 +824,7 @@ static int snd_portman_remove(struct platform_device *pdev)
824 824
825static struct platform_driver snd_portman_driver = { 825static struct platform_driver snd_portman_driver = {
826 .probe = snd_portman_probe, 826 .probe = snd_portman_probe,
827 .remove = snd_portman_remove, 827 .remove = __devexit_p(snd_portman_remove),
828 .driver = { 828 .driver = {
829 .name = PLATFORM_DRIVER 829 .name = PLATFORM_DRIVER
830 } 830 }
@@ -833,7 +833,7 @@ static struct platform_driver snd_portman_driver = {
833/********************************************************************* 833/*********************************************************************
834 * module init stuff 834 * module init stuff
835 *********************************************************************/ 835 *********************************************************************/
836static void snd_portman_unregister_all(void) 836static void __init_or_module snd_portman_unregister_all(void)
837{ 837{
838 int i; 838 int i;
839 839
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 3a86a5820726..838a4277929d 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -327,7 +327,7 @@ static void snd_uart16550_buffer_timer(unsigned long data)
327 * return 0 if found 327 * return 0 if found
328 * return negative error if not found 328 * return negative error if not found
329 */ 329 */
330static int __init snd_uart16550_detect(struct snd_uart16550 *uart) 330static int __devinit snd_uart16550_detect(struct snd_uart16550 *uart)
331{ 331{
332 unsigned long io_base = uart->base; 332 unsigned long io_base = uart->base;
333 int ok; 333 int ok;
@@ -781,7 +781,7 @@ static int snd_uart16550_dev_free(struct snd_device *device)
781 return snd_uart16550_free(uart); 781 return snd_uart16550_free(uart);
782} 782}
783 783
784static int __init snd_uart16550_create(struct snd_card *card, 784static int __devinit snd_uart16550_create(struct snd_card *card,
785 unsigned long iobase, 785 unsigned long iobase,
786 int irq, 786 int irq,
787 unsigned int speed, 787 unsigned int speed,
@@ -860,7 +860,7 @@ static int __init snd_uart16550_create(struct snd_card *card,
860 return 0; 860 return 0;
861} 861}
862 862
863static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream) 863static void __devinit snd_uart16550_substreams(struct snd_rawmidi_str *stream)
864{ 864{
865 struct snd_rawmidi_substream *substream; 865 struct snd_rawmidi_substream *substream;
866 866
@@ -869,7 +869,7 @@ static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream)
869 } 869 }
870} 870}
871 871
872static int __init snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, 872static int __devinit snd_uart16550_rmidi(struct snd_uart16550 *uart, int device,
873 int outs, int ins, 873 int outs, int ins,
874 struct snd_rawmidi **rmidi) 874 struct snd_rawmidi **rmidi)
875{ 875{
@@ -896,7 +896,7 @@ static int __init snd_uart16550_rmidi(struct snd_uart16550 *uart, int device,
896 return 0; 896 return 0;
897} 897}
898 898
899static int __init snd_serial_probe(struct platform_device *devptr) 899static int __devinit snd_serial_probe(struct platform_device *devptr)
900{ 900{
901 struct snd_card *card; 901 struct snd_card *card;
902 struct snd_uart16550 *uart; 902 struct snd_uart16550 *uart;
@@ -981,7 +981,7 @@ static int __init snd_serial_probe(struct platform_device *devptr)
981 return err; 981 return err;
982} 982}
983 983
984static int snd_serial_remove(struct platform_device *devptr) 984static int __devexit snd_serial_remove(struct platform_device *devptr)
985{ 985{
986 snd_card_free(platform_get_drvdata(devptr)); 986 snd_card_free(platform_get_drvdata(devptr));
987 platform_set_drvdata(devptr, NULL); 987 platform_set_drvdata(devptr, NULL);
@@ -992,7 +992,7 @@ static int snd_serial_remove(struct platform_device *devptr)
992 992
993static struct platform_driver snd_serial_driver = { 993static struct platform_driver snd_serial_driver = {
994 .probe = snd_serial_probe, 994 .probe = snd_serial_probe,
995 .remove = snd_serial_remove, 995 .remove = __devexit_p( snd_serial_remove),
996 .driver = { 996 .driver = {
997 .name = SND_SERIAL_DRIVER 997 .name = SND_SERIAL_DRIVER
998 }, 998 },
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index 59171f8200df..46f3d3486067 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -44,7 +44,6 @@
44#include <sound/driver.h> 44#include <sound/driver.h>
45#include <linux/init.h> 45#include <linux/init.h>
46#include <linux/wait.h> 46#include <linux/wait.h>
47#include <linux/sched.h>
48#include <linux/err.h> 47#include <linux/err.h>
49#include <linux/platform_device.h> 48#include <linux/platform_device.h>
50#include <linux/moduleparam.h> 49#include <linux/moduleparam.h>
@@ -85,7 +84,7 @@ struct snd_card_virmidi {
85static struct platform_device *devices[SNDRV_CARDS]; 84static struct platform_device *devices[SNDRV_CARDS];
86 85
87 86
88static int __init snd_virmidi_probe(struct platform_device *devptr) 87static int __devinit snd_virmidi_probe(struct platform_device *devptr)
89{ 88{
90 struct snd_card *card; 89 struct snd_card *card;
91 struct snd_card_virmidi *vmidi; 90 struct snd_card_virmidi *vmidi;
@@ -129,7 +128,7 @@ static int __init snd_virmidi_probe(struct platform_device *devptr)
129 return err; 128 return err;
130} 129}
131 130
132static int snd_virmidi_remove(struct platform_device *devptr) 131static int __devexit snd_virmidi_remove(struct platform_device *devptr)
133{ 132{
134 snd_card_free(platform_get_drvdata(devptr)); 133 snd_card_free(platform_get_drvdata(devptr));
135 platform_set_drvdata(devptr, NULL); 134 platform_set_drvdata(devptr, NULL);
@@ -140,7 +139,7 @@ static int snd_virmidi_remove(struct platform_device *devptr)
140 139
141static struct platform_driver snd_virmidi_driver = { 140static struct platform_driver snd_virmidi_driver = {
142 .probe = snd_virmidi_probe, 141 .probe = snd_virmidi_probe,
143 .remove = snd_virmidi_remove, 142 .remove = __devexit_p(snd_virmidi_remove),
144 .driver = { 143 .driver = {
145 .name = SND_VIRMIDI_DRIVER 144 .name = SND_VIRMIDI_DRIVER
146 }, 145 },
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index 99908e44124d..74e501dea8b1 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 3
65static struct platform_device *devices[SNDRV_CARDS]; 65static struct platform_device *devices[SNDRV_CARDS];
66 66
67 67
68static int __init snd_ad1848_probe(struct platform_device *pdev) 68static int __devinit snd_ad1848_probe(struct platform_device *pdev)
69{ 69{
70 int dev = pdev->id; 70 int dev = pdev->id;
71 struct snd_card *card; 71 struct snd_card *card;
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index d1f6dfcec46e..c09a8009d2fa 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -574,7 +574,7 @@ static int __devinit snd_cmi8330_nonpnp_probe(struct platform_device *pdev)
574 return 0; 574 return 0;
575} 575}
576 576
577static int snd_cmi8330_nonpnp_remove(struct platform_device *devptr) 577static int __devexit snd_cmi8330_nonpnp_remove(struct platform_device *devptr)
578{ 578{
579 snd_card_free(platform_get_drvdata(devptr)); 579 snd_card_free(platform_get_drvdata(devptr));
580 platform_set_drvdata(devptr, NULL); 580 platform_set_drvdata(devptr, NULL);
@@ -597,7 +597,7 @@ static int snd_cmi8330_nonpnp_resume(struct platform_device *dev)
597 597
598static struct platform_driver snd_cmi8330_driver = { 598static struct platform_driver snd_cmi8330_driver = {
599 .probe = snd_cmi8330_nonpnp_probe, 599 .probe = snd_cmi8330_nonpnp_probe,
600 .remove = snd_cmi8330_nonpnp_remove, 600 .remove = __devexit_p(snd_cmi8330_nonpnp_remove),
601#ifdef CONFIG_PM 601#ifdef CONFIG_PM
602 .suspend = snd_cmi8330_nonpnp_suspend, 602 .suspend = snd_cmi8330_nonpnp_suspend,
603 .resume = snd_cmi8330_nonpnp_resume, 603 .resume = snd_cmi8330_nonpnp_resume,
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index c20a4b1b1536..ce57d526f7bc 100644
--- a/sound/isa/dt019x.c
+++ b/sound/isa/dt019x.c
@@ -23,7 +23,6 @@
23 23
24#include <sound/driver.h> 24#include <sound/driver.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/sched.h>
27#include <linux/wait.h> 26#include <linux/wait.h>
28#include <linux/pnp.h> 27#include <linux/pnp.h>
29#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 7f29f56e405b..65f97ff4eef1 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -73,7 +73,7 @@ static struct platform_device *devices[SNDRV_CARDS];
73 73
74#define PFX "es1688: " 74#define PFX "es1688: "
75 75
76static int __init snd_es1688_probe(struct platform_device *pdev) 76static int __devinit snd_es1688_probe(struct platform_device *pdev)
77{ 77{
78 int dev = pdev->id; 78 int dev = pdev->id;
79 static int possible_irqs[] = {5, 9, 10, 7, -1}; 79 static int possible_irqs[] = {5, 9, 10, 7, -1};
@@ -171,7 +171,7 @@ static int __init snd_es1688_probe(struct platform_device *pdev)
171 return err; 171 return err;
172} 172}
173 173
174static int snd_es1688_remove(struct platform_device *devptr) 174static int __devexit snd_es1688_remove(struct platform_device *devptr)
175{ 175{
176 snd_card_free(platform_get_drvdata(devptr)); 176 snd_card_free(platform_get_drvdata(devptr));
177 platform_set_drvdata(devptr, NULL); 177 platform_set_drvdata(devptr, NULL);
@@ -182,7 +182,7 @@ static int snd_es1688_remove(struct platform_device *devptr)
182 182
183static struct platform_driver snd_es1688_driver = { 183static struct platform_driver snd_es1688_driver = {
184 .probe = snd_es1688_probe, 184 .probe = snd_es1688_probe,
185 .remove = snd_es1688_remove, 185 .remove = __devexit_p(snd_es1688_remove),
186 /* FIXME: suspend/resume */ 186 /* FIXME: suspend/resume */
187 .driver = { 187 .driver = {
188 .name = ES1688_DRIVER 188 .name = ES1688_DRIVER
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 37057a37dc30..0395e2e0dd03 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -76,7 +76,7 @@ static struct platform_device *devices[SNDRV_CARDS];
76 76
77#define PFX "gusclassic: " 77#define PFX "gusclassic: "
78 78
79static int __init snd_gusclassic_detect(struct snd_gus_card * gus) 79static int __devinit snd_gusclassic_detect(struct snd_gus_card * gus)
80{ 80{
81 unsigned char d; 81 unsigned char d;
82 82
@@ -95,7 +95,7 @@ static int __init snd_gusclassic_detect(struct snd_gus_card * gus)
95 return 0; 95 return 0;
96} 96}
97 97
98static void __init snd_gusclassic_init(int dev, struct snd_gus_card * gus) 98static void __devinit snd_gusclassic_init(int dev, struct snd_gus_card * gus)
99{ 99{
100 gus->equal_irq = 0; 100 gus->equal_irq = 0;
101 gus->codec_flag = 0; 101 gus->codec_flag = 0;
@@ -103,7 +103,7 @@ static void __init snd_gusclassic_init(int dev, struct snd_gus_card * gus)
103 gus->joystick_dac = joystick_dac[dev]; 103 gus->joystick_dac = joystick_dac[dev];
104} 104}
105 105
106static int __init snd_gusclassic_probe(struct platform_device *pdev) 106static int __devinit snd_gusclassic_probe(struct platform_device *pdev)
107{ 107{
108 int dev = pdev->id; 108 int dev = pdev->id;
109 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1}; 109 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1};
@@ -211,7 +211,7 @@ static int __init snd_gusclassic_probe(struct platform_device *pdev)
211 return err; 211 return err;
212} 212}
213 213
214static int snd_gusclassic_remove(struct platform_device *devptr) 214static int __devexit snd_gusclassic_remove(struct platform_device *devptr)
215{ 215{
216 snd_card_free(platform_get_drvdata(devptr)); 216 snd_card_free(platform_get_drvdata(devptr));
217 platform_set_drvdata(devptr, NULL); 217 platform_set_drvdata(devptr, NULL);
@@ -222,7 +222,7 @@ static int snd_gusclassic_remove(struct platform_device *devptr)
222 222
223static struct platform_driver snd_gusclassic_driver = { 223static struct platform_driver snd_gusclassic_driver = {
224 .probe = snd_gusclassic_probe, 224 .probe = snd_gusclassic_probe,
225 .remove = snd_gusclassic_remove, 225 .remove = __devexit_p(snd_gusclassic_remove),
226 /* FIXME: suspend/resume */ 226 /* FIXME: suspend/resume */
227 .driver = { 227 .driver = {
228 .name = GUSCLASSIC_DRIVER 228 .name = GUSCLASSIC_DRIVER
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 532c56e35ca4..4f55fc3e66c1 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -92,7 +92,7 @@ static struct platform_device *devices[SNDRV_CARDS];
92 92
93#define PFX "gusextreme: " 93#define PFX "gusextreme: "
94 94
95static int __init snd_gusextreme_detect(int dev, 95static int __devinit snd_gusextreme_detect(int dev,
96 struct snd_card *card, 96 struct snd_card *card,
97 struct snd_gus_card * gus, 97 struct snd_gus_card * gus,
98 struct snd_es1688 *es1688) 98 struct snd_es1688 *es1688)
@@ -142,12 +142,12 @@ static int __init snd_gusextreme_detect(int dev,
142 return 0; 142 return 0;
143} 143}
144 144
145static void __init snd_gusextreme_init(int dev, struct snd_gus_card * gus) 145static void __devinit snd_gusextreme_init(int dev, struct snd_gus_card * gus)
146{ 146{
147 gus->joystick_dac = joystick_dac[dev]; 147 gus->joystick_dac = joystick_dac[dev];
148} 148}
149 149
150static int __init snd_gusextreme_mixer(struct snd_es1688 *chip) 150static int __devinit snd_gusextreme_mixer(struct snd_es1688 *chip)
151{ 151{
152 struct snd_card *card = chip->card; 152 struct snd_card *card = chip->card;
153 struct snd_ctl_elem_id id1, id2; 153 struct snd_ctl_elem_id id1, id2;
@@ -169,7 +169,7 @@ static int __init snd_gusextreme_mixer(struct snd_es1688 *chip)
169 return 0; 169 return 0;
170} 170}
171 171
172static int __init snd_gusextreme_probe(struct platform_device *pdev) 172static int __devinit snd_gusextreme_probe(struct platform_device *pdev)
173{ 173{
174 int dev = pdev->id; 174 int dev = pdev->id;
175 static int possible_ess_irqs[] = {5, 9, 10, 7, -1}; 175 static int possible_ess_irqs[] = {5, 9, 10, 7, -1};
@@ -321,7 +321,7 @@ static int __init snd_gusextreme_probe(struct platform_device *pdev)
321 return err; 321 return err;
322} 322}
323 323
324static int snd_gusextreme_remove(struct platform_device *devptr) 324static int __devexit snd_gusextreme_remove(struct platform_device *devptr)
325{ 325{
326 snd_card_free(platform_get_drvdata(devptr)); 326 snd_card_free(platform_get_drvdata(devptr));
327 platform_set_drvdata(devptr, NULL); 327 platform_set_drvdata(devptr, NULL);
@@ -332,7 +332,7 @@ static int snd_gusextreme_remove(struct platform_device *devptr)
332 332
333static struct platform_driver snd_gusextreme_driver = { 333static struct platform_driver snd_gusextreme_driver = {
334 .probe = snd_gusextreme_probe, 334 .probe = snd_gusextreme_probe,
335 .remove = snd_gusextreme_remove, 335 .remove = __devexit_p(snd_gusextreme_remove),
336 /* FIXME: suspend/resume */ 336 /* FIXME: suspend/resume */
337 .driver = { 337 .driver = {
338 .name = GUSEXTREME_DRIVER 338 .name = GUSEXTREME_DRIVER
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index c1c69e3cbfd0..d1ad90ca035d 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -85,7 +85,7 @@ struct snd_gusmax {
85 85
86#define PFX "gusmax: " 86#define PFX "gusmax: "
87 87
88static int __init snd_gusmax_detect(struct snd_gus_card * gus) 88static int __devinit snd_gusmax_detect(struct snd_gus_card * gus)
89{ 89{
90 unsigned char d; 90 unsigned char d;
91 91
@@ -127,7 +127,8 @@ static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id)
127 return IRQ_RETVAL(handled); 127 return IRQ_RETVAL(handled);
128} 128}
129 129
130static void __init snd_gusmax_init(int dev, struct snd_card *card, struct snd_gus_card * gus) 130static void __devinit snd_gusmax_init(int dev, struct snd_card *card,
131 struct snd_gus_card * gus)
131{ 132{
132 gus->equal_irq = 1; 133 gus->equal_irq = 1;
133 gus->codec_flag = 1; 134 gus->codec_flag = 1;
@@ -145,7 +146,7 @@ static void __init snd_gusmax_init(int dev, struct snd_card *card, struct snd_gu
145#define CS4231_PRIVATE( left, right, shift, mute ) \ 146#define CS4231_PRIVATE( left, right, shift, mute ) \
146 ((left << 24)|(right << 16)|(shift<<8)|mute) 147 ((left << 24)|(right << 16)|(shift<<8)|mute)
147 148
148static int __init snd_gusmax_mixer(struct snd_cs4231 *chip) 149static int __devinit snd_gusmax_mixer(struct snd_cs4231 *chip)
149{ 150{
150 struct snd_card *card = chip->card; 151 struct snd_card *card = chip->card;
151 struct snd_ctl_elem_id id1, id2; 152 struct snd_ctl_elem_id id1, id2;
@@ -204,7 +205,7 @@ static void snd_gusmax_free(struct snd_card *card)
204 free_irq(maxcard->irq, (void *)maxcard); 205 free_irq(maxcard->irq, (void *)maxcard);
205} 206}
206 207
207static int __init snd_gusmax_probe(struct platform_device *pdev) 208static int __devinit snd_gusmax_probe(struct platform_device *pdev)
208{ 209{
209 int dev = pdev->id; 210 int dev = pdev->id;
210 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; 211 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
@@ -348,7 +349,7 @@ static int __init snd_gusmax_probe(struct platform_device *pdev)
348 return err; 349 return err;
349} 350}
350 351
351static int snd_gusmax_remove(struct platform_device *devptr) 352static int __devexit snd_gusmax_remove(struct platform_device *devptr)
352{ 353{
353 snd_card_free(platform_get_drvdata(devptr)); 354 snd_card_free(platform_get_drvdata(devptr));
354 platform_set_drvdata(devptr, NULL); 355 platform_set_drvdata(devptr, NULL);
@@ -359,7 +360,7 @@ static int snd_gusmax_remove(struct platform_device *devptr)
359 360
360static struct platform_driver snd_gusmax_driver = { 361static struct platform_driver snd_gusmax_driver = {
361 .probe = snd_gusmax_probe, 362 .probe = snd_gusmax_probe,
362 .remove = snd_gusmax_remove, 363 .remove = __devexit_p(snd_gusmax_remove),
363 /* FIXME: suspend/resume */ 364 /* FIXME: suspend/resume */
364 .driver = { 365 .driver = {
365 .name = GUSMAX_DRIVER 366 .name = GUSMAX_DRIVER
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 1e30713d2cad..f3db686b1c0c 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -919,7 +919,7 @@ static int __devinit snd_opl3sa2_nonpnp_probe(struct platform_device *pdev)
919 return 0; 919 return 0;
920} 920}
921 921
922static int snd_opl3sa2_nonpnp_remove(struct platform_device *devptr) 922static int __devexit snd_opl3sa2_nonpnp_remove(struct platform_device *devptr)
923{ 923{
924 snd_card_free(platform_get_drvdata(devptr)); 924 snd_card_free(platform_get_drvdata(devptr));
925 platform_set_drvdata(devptr, NULL); 925 platform_set_drvdata(devptr, NULL);
@@ -942,7 +942,7 @@ static int snd_opl3sa2_nonpnp_resume(struct platform_device *dev)
942 942
943static struct platform_driver snd_opl3sa2_nonpnp_driver = { 943static struct platform_driver snd_opl3sa2_nonpnp_driver = {
944 .probe = snd_opl3sa2_nonpnp_probe, 944 .probe = snd_opl3sa2_nonpnp_probe,
945 .remove = snd_opl3sa2_nonpnp_remove, 945 .remove = __devexit( snd_opl3sa2_nonpnp_remove),
946#ifdef CONFIG_PM 946#ifdef CONFIG_PM
947 .suspend = snd_opl3sa2_nonpnp_suspend, 947 .suspend = snd_opl3sa2_nonpnp_suspend,
948 .resume = snd_opl3sa2_nonpnp_resume, 948 .resume = snd_opl3sa2_nonpnp_resume,
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 268ebd34703e..be1e83e6dea3 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -83,7 +83,7 @@ static void snd_sb8_free(struct snd_card *card)
83 release_and_free_resource(acard->fm_res); 83 release_and_free_resource(acard->fm_res);
84} 84}
85 85
86static int __init snd_sb8_probe(struct platform_device *pdev) 86static int __devinit snd_sb8_probe(struct platform_device *pdev)
87{ 87{
88 int dev = pdev->id; 88 int dev = pdev->id;
89 struct snd_sb *chip; 89 struct snd_sb *chip;
@@ -193,7 +193,7 @@ static int __init snd_sb8_probe(struct platform_device *pdev)
193 return err; 193 return err;
194} 194}
195 195
196static int snd_sb8_remove(struct platform_device *pdev) 196static int __devexit snd_sb8_remove(struct platform_device *pdev)
197{ 197{
198 snd_card_free(platform_get_drvdata(pdev)); 198 snd_card_free(platform_get_drvdata(pdev));
199 platform_set_drvdata(pdev, NULL); 199 platform_set_drvdata(pdev, NULL);
@@ -230,7 +230,7 @@ static int snd_sb8_resume(struct platform_device *dev)
230 230
231static struct platform_driver snd_sb8_driver = { 231static struct platform_driver snd_sb8_driver = {
232 .probe = snd_sb8_probe, 232 .probe = snd_sb8_probe,
233 .remove = snd_sb8_remove, 233 .remove = __devexit_p(snd_sb8_remove),
234#ifdef CONFIG_PM 234#ifdef CONFIG_PM
235 .suspend = snd_sb8_suspend, 235 .suspend = snd_sb8_suspend,
236 .resume = snd_sb8_resume, 236 .resume = snd_sb8_resume,
diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c
index 602db497929a..fef56cac06c8 100644
--- a/sound/oss/ac97_codec.c
+++ b/sound/oss/ac97_codec.c
@@ -744,11 +744,10 @@ static int ac97_check_modem(struct ac97_codec *codec)
744 744
745struct ac97_codec *ac97_alloc_codec(void) 745struct ac97_codec *ac97_alloc_codec(void)
746{ 746{
747 struct ac97_codec *codec = kmalloc(sizeof(struct ac97_codec), GFP_KERNEL); 747 struct ac97_codec *codec = kzalloc(sizeof(struct ac97_codec), GFP_KERNEL);
748 if(!codec) 748 if(!codec)
749 return NULL; 749 return NULL;
750 750
751 memset(codec, 0, sizeof(*codec));
752 spin_lock_init(&codec->lock); 751 spin_lock_init(&codec->lock);
753 INIT_LIST_HEAD(&codec->list); 752 INIT_LIST_HEAD(&codec->list);
754 return codec; 753 return codec;
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index f0724327493c..c0730a3563a2 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -230,9 +230,8 @@ static ad1889_dev_t *ad1889_alloc_dev(struct pci_dev *pci)
230 struct dmabuf *dmabuf; 230 struct dmabuf *dmabuf;
231 int i; 231 int i;
232 232
233 if ((dev = kmalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL) 233 if ((dev = kzalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL)
234 return NULL; 234 return NULL;
235 memset(dev, 0, sizeof(ad1889_dev_t));
236 spin_lock_init(&dev->lock); 235 spin_lock_init(&dev->lock);
237 dev->pci = pci; 236 dev->pci = pci;
238 237
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index f845528e1fac..f813ae9c2134 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -915,12 +915,11 @@ static int __devinit btaudio_probe(struct pci_dev *pci_dev,
915 return -EBUSY; 915 return -EBUSY;
916 } 916 }
917 917
918 bta = kmalloc(sizeof(*bta),GFP_ATOMIC); 918 bta = kzalloc(sizeof(*bta),GFP_ATOMIC);
919 if (!bta) { 919 if (!bta) {
920 rc = -ENOMEM; 920 rc = -ENOMEM;
921 goto fail0; 921 goto fail0;
922 } 922 }
923 memset(bta,0,sizeof(*bta));
924 923
925 bta->pci = pci_dev; 924 bta->pci = pci_dev;
926 bta->irq = pci_dev->irq; 925 bta->irq = pci_dev->irq;
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 147c8a951137..2a1f0d9ac968 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -3048,10 +3048,9 @@ static int cs_open(struct inode *inode, struct file *file)
3048 CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); 3048 CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") );
3049 if (card->states[0] == NULL) { 3049 if (card->states[0] == NULL) {
3050 state = card->states[0] = 3050 state = card->states[0] =
3051 kmalloc(sizeof(struct cs_state), GFP_KERNEL); 3051 kzalloc(sizeof(struct cs_state), GFP_KERNEL);
3052 if (state == NULL) 3052 if (state == NULL)
3053 return -ENOMEM; 3053 return -ENOMEM;
3054 memset(state, 0, sizeof(struct cs_state));
3055 mutex_init(&state->sem); 3054 mutex_init(&state->sem);
3056 dmabuf = &state->dmabuf; 3055 dmabuf = &state->dmabuf;
3057 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 3056 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
@@ -3114,10 +3113,9 @@ static int cs_open(struct inode *inode, struct file *file)
3114 CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); 3113 CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") );
3115 if (card->states[1] == NULL) { 3114 if (card->states[1] == NULL) {
3116 state = card->states[1] = 3115 state = card->states[1] =
3117 kmalloc(sizeof(struct cs_state), GFP_KERNEL); 3116 kzalloc(sizeof(struct cs_state), GFP_KERNEL);
3118 if (state == NULL) 3117 if (state == NULL)
3119 return -ENOMEM; 3118 return -ENOMEM;
3120 memset(state, 0, sizeof(struct cs_state));
3121 mutex_init(&state->sem); 3119 mutex_init(&state->sem);
3122 dmabuf = &state->dmabuf; 3120 dmabuf = &state->dmabuf;
3123 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 3121 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
@@ -5075,11 +5073,10 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
5075 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); 5073 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor);
5076 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); 5074 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card);
5077 5075
5078 if ((card = kmalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { 5076 if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) {
5079 printk(KERN_ERR "cs46xx: out of memory\n"); 5077 printk(KERN_ERR "cs46xx: out of memory\n");
5080 return -ENOMEM; 5078 return -ENOMEM;
5081 } 5079 }
5082 memset(card, 0, sizeof(*card));
5083 card->ba0_addr = RSRCADDRESS(pci_dev, 0); 5080 card->ba0_addr = RSRCADDRESS(pci_dev, 0);
5084 card->ba1_addr = RSRCADDRESS(pci_dev, 1); 5081 card->ba1_addr = RSRCADDRESS(pci_dev, 1);
5085 card->pci_dev = pci_dev; 5082 card->pci_dev = pci_dev;
diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c
index 7360d8954d60..0f0d03a55dab 100644
--- a/sound/oss/dmasound/dac3550a.c
+++ b/sound/oss/dmasound/dac3550a.c
@@ -163,10 +163,9 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address)
163 struct i2c_client *new_client; 163 struct i2c_client *new_client;
164 int rc = -ENODEV; 164 int rc = -ENODEV;
165 165
166 new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); 166 new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
167 if (!new_client) 167 if (!new_client)
168 return -ENOMEM; 168 return -ENOMEM;
169 memset(new_client, 0, sizeof(*new_client));
170 169
171 new_client->addr = address; 170 new_client->addr = address;
172 new_client->adapter = adapter; 171 new_client->adapter = adapter;
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
index 2f21a3c00374..4b7dbdd2a438 100644
--- a/sound/oss/dmasound/tas3001c.c
+++ b/sound/oss/dmasound/tas3001c.c
@@ -807,10 +807,9 @@ tas3001c_init(struct i2c_client *client)
807 size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t)); 807 size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t));
808 int i, j; 808 int i, j;
809 809
810 self = kmalloc(sz, GFP_KERNEL); 810 self = kzalloc(sz, GFP_KERNEL);
811 if (!self) 811 if (!self)
812 return -ENOMEM; 812 return -ENOMEM;
813 memset(self, 0, sz);
814 813
815 self->super.client = client; 814 self->super.client = client;
816 self->super.shadow = (tas_shadow_t *)(self+1); 815 self->super.shadow = (tas_shadow_t *)(self+1);
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
index af34fb39bc29..678bf0ff6da2 100644
--- a/sound/oss/dmasound/tas3004.c
+++ b/sound/oss/dmasound/tas3004.c
@@ -1092,10 +1092,9 @@ tas3004_init(struct i2c_client *client)
1092 char mcr2 = 0; 1092 char mcr2 = 0;
1093 int i, j; 1093 int i, j;
1094 1094
1095 self = kmalloc(sz, GFP_KERNEL); 1095 self = kzalloc(sz, GFP_KERNEL);
1096 if (!self) 1096 if (!self)
1097 return -ENOMEM; 1097 return -ENOMEM;
1098 memset(self, 0, sz);
1099 1098
1100 self->super.client = client; 1099 self->super.client = client;
1101 self->super.shadow = (tas_shadow_t *)(self+1); 1100 self->super.shadow = (tas_shadow_t *)(self+1);
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 882ae98a41b1..665e85b5562b 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -135,10 +135,9 @@ tas_detect_client(struct i2c_adapter *adapter, int address)
135 return -ENODEV; 135 return -ENODEV;
136 } 136 }
137 137
138 new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); 138 new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
139 if (!new_client) 139 if (!new_client)
140 return -ENOMEM; 140 return -ENOMEM;
141 memset(new_client, 0, sizeof(*new_client));
142 141
143 new_client->addr = address; 142 new_client->addr = address;
144 new_client->adapter = adapter; 143 new_client->adapter = adapter;
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
index 6c59df7b0001..16ac02540a3f 100644
--- a/sound/oss/emu10k1/main.c
+++ b/sound/oss/emu10k1/main.c
@@ -455,15 +455,13 @@ static int __devinit emu10k1_midi_init(struct emu10k1_card *card)
455{ 455{
456 int ret; 456 int ret;
457 457
458 card->mpuout = kmalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); 458 card->mpuout = kzalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL);
459 if (card->mpuout == NULL) { 459 if (card->mpuout == NULL) {
460 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n"); 460 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n");
461 ret = -ENOMEM; 461 ret = -ENOMEM;
462 goto err_out1; 462 goto err_out1;
463 } 463 }
464 464
465 memset(card->mpuout, 0, sizeof(struct emu10k1_mpuout));
466
467 card->mpuout->intr = 1; 465 card->mpuout->intr = 1;
468 card->mpuout->status = FLAGS_AVAILABLE; 466 card->mpuout->status = FLAGS_AVAILABLE;
469 card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT; 467 card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT;
@@ -472,15 +470,13 @@ static int __devinit emu10k1_midi_init(struct emu10k1_card *card)
472 470
473 spin_lock_init(&card->mpuout->lock); 471 spin_lock_init(&card->mpuout->lock);
474 472
475 card->mpuin = kmalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); 473 card->mpuin = kzalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL);
476 if (card->mpuin == NULL) { 474 if (card->mpuin == NULL) {
477 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n"); 475 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n");
478 ret = -ENOMEM; 476 ret = -ENOMEM;
479 goto err_out2; 477 goto err_out2;
480 } 478 }
481 479
482 memset(card->mpuin, 0, sizeof(struct emu10k1_mpuin));
483
484 card->mpuin->status = FLAGS_AVAILABLE; 480 card->mpuin->status = FLAGS_AVAILABLE;
485 481
486 tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin); 482 tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin);
@@ -1280,11 +1276,10 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev
1280 1276
1281 pci_set_master(pci_dev); 1277 pci_set_master(pci_dev);
1282 1278
1283 if ((card = kmalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { 1279 if ((card = kzalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) {
1284 printk(KERN_ERR "emu10k1: out of memory\n"); 1280 printk(KERN_ERR "emu10k1: out of memory\n");
1285 return -ENOMEM; 1281 return -ENOMEM;
1286 } 1282 }
1287 memset(card, 0, sizeof(struct emu10k1_card));
1288 1283
1289 card->iobase = pci_resource_start(pci_dev, 0); 1284 card->iobase = pci_resource_start(pci_dev, 0);
1290 card->length = pci_resource_len(pci_dev, 0); 1285 card->length = pci_resource_len(pci_dev, 0);
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index e1fbcca8e722..974dd732b149 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -2871,11 +2871,10 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic
2871 printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n"); 2871 printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n");
2872 return i; 2872 return i;
2873 } 2873 }
2874 if (!(s = kmalloc(sizeof(struct es1371_state), GFP_KERNEL))) { 2874 if (!(s = kzalloc(sizeof(struct es1371_state), GFP_KERNEL))) {
2875 printk(KERN_WARNING PFX "out of memory\n"); 2875 printk(KERN_WARNING PFX "out of memory\n");
2876 return -ENOMEM; 2876 return -ENOMEM;
2877 } 2877 }
2878 memset(s, 0, sizeof(struct es1371_state));
2879 2878
2880 s->codec = ac97_alloc_codec(); 2879 s->codec = ac97_alloc_codec();
2881 if(s->codec == NULL) 2880 if(s->codec == NULL)
diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c
index 80a42773c648..a94b9df489dc 100644
--- a/sound/oss/hal2.c
+++ b/sound/oss/hal2.c
@@ -1435,10 +1435,9 @@ static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
1435 int ret = 0; 1435 int ret = 0;
1436 struct hal2_card *hal2; 1436 struct hal2_card *hal2;
1437 1437
1438 hal2 = kmalloc(sizeof(struct hal2_card), GFP_KERNEL); 1438 hal2 = kzalloc(sizeof(struct hal2_card), GFP_KERNEL);
1439 if (!hal2) 1439 if (!hal2)
1440 return -ENOMEM; 1440 return -ENOMEM;
1441 memset(hal2, 0, sizeof(struct hal2_card));
1442 1441
1443 hal2->ctl_regs = (struct hal2_ctl_regs *)hpc3->pbus_extregs[0]; 1442 hal2->ctl_regs = (struct hal2_ctl_regs *)hpc3->pbus_extregs[0];
1444 hal2->aes_regs = (struct hal2_aes_regs *)hpc3->pbus_extregs[1]; 1443 hal2->aes_regs = (struct hal2_aes_regs *)hpc3->pbus_extregs[1];
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index c3c8a720d555..f5e31f11973d 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -2580,10 +2580,9 @@ static int i810_open(struct inode *inode, struct file *file)
2580 for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) { 2580 for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) {
2581 if (card->states[i] == NULL) { 2581 if (card->states[i] == NULL) {
2582 state = card->states[i] = (struct i810_state *) 2582 state = card->states[i] = (struct i810_state *)
2583 kmalloc(sizeof(struct i810_state), GFP_KERNEL); 2583 kzalloc(sizeof(struct i810_state), GFP_KERNEL);
2584 if (state == NULL) 2584 if (state == NULL)
2585 return -ENOMEM; 2585 return -ENOMEM;
2586 memset(state, 0, sizeof(struct i810_state));
2587 dmabuf = &state->dmabuf; 2586 dmabuf = &state->dmabuf;
2588 goto found_virt; 2587 goto found_virt;
2589 } 2588 }
@@ -3205,10 +3204,9 @@ static void __devinit i810_configure_clocking (void)
3205 */ 3204 */
3206 if(card != NULL) { 3205 if(card != NULL) {
3207 state = card->states[0] = (struct i810_state *) 3206 state = card->states[0] = (struct i810_state *)
3208 kmalloc(sizeof(struct i810_state), GFP_KERNEL); 3207 kzalloc(sizeof(struct i810_state), GFP_KERNEL);
3209 if (state == NULL) 3208 if (state == NULL)
3210 return; 3209 return;
3211 memset(state, 0, sizeof(struct i810_state));
3212 dmabuf = &state->dmabuf; 3210 dmabuf = &state->dmabuf;
3213 3211
3214 dmabuf->write_channel = card->alloc_pcm_channel(card); 3212 dmabuf->write_channel = card->alloc_pcm_channel(card);
@@ -3273,11 +3271,10 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
3273 return -ENODEV; 3271 return -ENODEV;
3274 } 3272 }
3275 3273
3276 if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) { 3274 if ((card = kzalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {
3277 printk(KERN_ERR "i810_audio: out of memory\n"); 3275 printk(KERN_ERR "i810_audio: out of memory\n");
3278 return -ENOMEM; 3276 return -ENOMEM;
3279 } 3277 }
3280 memset(card, 0, sizeof(*card));
3281 3278
3282 card->initializing = 1; 3279 card->initializing = 1;
3283 card->pci_dev = pci_dev; 3280 card->pci_dev = pci_dev;
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index 12e7b3038be2..dfe670f12e67 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -139,13 +139,12 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id
139 printk(KERN_INFO "kahlua: XpressAudio on IRQ %d, DMA %d, %d\n", 139 printk(KERN_INFO "kahlua: XpressAudio on IRQ %d, DMA %d, %d\n",
140 irq, dma8, dma16); 140 irq, dma8, dma16);
141 141
142 hw_config = kmalloc(sizeof(struct address_info), GFP_KERNEL); 142 hw_config = kzalloc(sizeof(struct address_info), GFP_KERNEL);
143 if(hw_config == NULL) 143 if(hw_config == NULL)
144 { 144 {
145 printk(KERN_ERR "kahlua: out of memory.\n"); 145 printk(KERN_ERR "kahlua: out of memory.\n");
146 return 1; 146 return 1;
147 } 147 }
148 memset(hw_config, 0, sizeof(*hw_config));
149 148
150 pci_set_drvdata(pdev, hw_config); 149 pci_set_drvdata(pdev, hw_config);
151 150
diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
index d459bdb14154..27b4ba3aaa7c 100644
--- a/sound/oss/nec_vrc5477.c
+++ b/sound/oss/nec_vrc5477.c
@@ -1860,11 +1860,10 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev,
1860 if (pcidev->irq == 0) 1860 if (pcidev->irq == 0)
1861 return -1; 1861 return -1;
1862 1862
1863 if (!(s = kmalloc(sizeof(struct vrc5477_ac97_state), GFP_KERNEL))) { 1863 if (!(s = kzalloc(sizeof(struct vrc5477_ac97_state), GFP_KERNEL))) {
1864 printk(KERN_ERR PFX "alloc of device struct failed\n"); 1864 printk(KERN_ERR PFX "alloc of device struct failed\n");
1865 return -1; 1865 return -1;
1866 } 1866 }
1867 memset(s, 0, sizeof(struct vrc5477_ac97_state));
1868 1867
1869 init_waitqueue_head(&s->dma_adc.wait); 1868 init_waitqueue_head(&s->dma_adc.wait);
1870 init_waitqueue_head(&s->dma_dac.wait); 1869 init_waitqueue_head(&s->dma_dac.wait);
diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c
index 2e8cfa5481f2..fc273e550944 100644
--- a/sound/oss/opl3.c
+++ b/sound/oss/opl3.c
@@ -166,7 +166,7 @@ int opl3_detect(int ioaddr, int *osp)
166 return 0; 166 return 0;
167 } 167 }
168 168
169 devc = kmalloc(sizeof(*devc), GFP_KERNEL); 169 devc = kzalloc(sizeof(*devc), GFP_KERNEL);
170 170
171 if (devc == NULL) 171 if (devc == NULL)
172 { 172 {
@@ -175,7 +175,6 @@ int opl3_detect(int ioaddr, int *osp)
175 return 0; 175 return 0;
176 } 176 }
177 177
178 memset(devc, 0, sizeof(*devc));
179 strcpy(devc->fm_info.name, "OPL2"); 178 strcpy(devc->fm_info.name, "OPL2");
180 179
181 if (!request_region(ioaddr, 4, devc->fm_info.name)) { 180 if (!request_region(ioaddr, 4, devc->fm_info.name)) {
diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c
index 8666291c0052..27acd6f29b98 100644
--- a/sound/oss/sb_card.c
+++ b/sound/oss/sb_card.c
@@ -137,11 +137,10 @@ static int __init sb_init_legacy(void)
137{ 137{
138 struct sb_module_options sbmo = {0}; 138 struct sb_module_options sbmo = {0};
139 139
140 if((legacy = kmalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { 140 if((legacy = kzalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) {
141 printk(KERN_ERR "sb: Error: Could not allocate memory\n"); 141 printk(KERN_ERR "sb: Error: Could not allocate memory\n");
142 return -ENOMEM; 142 return -ENOMEM;
143 } 143 }
144 memset(legacy, 0, sizeof(struct sb_card_config));
145 144
146 legacy->conf.io_base = io; 145 legacy->conf.io_base = io;
147 legacy->conf.irq = irq; 146 legacy->conf.irq = irq;
@@ -247,11 +246,10 @@ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device
247 return -EBUSY; 246 return -EBUSY;
248 } 247 }
249 248
250 if((scc = kmalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { 249 if((scc = kzalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) {
251 printk(KERN_ERR "sb: Error: Could not allocate memory\n"); 250 printk(KERN_ERR "sb: Error: Could not allocate memory\n");
252 return -ENOMEM; 251 return -ENOMEM;
253 } 252 }
254 memset(scc, 0, sizeof(struct sb_card_config));
255 253
256 printk(KERN_INFO "sb: PnP: Found Card Named = \"%s\", Card PnP id = " \ 254 printk(KERN_INFO "sb: PnP: Found Card Named = \"%s\", Card PnP id = " \
257 "%s, Device PnP id = %s\n", card->card->name, card_id->id, 255 "%s, Device PnP id = %s\n", card->card->name, card_id->id,
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
index 9f7e5f59ac82..016b918329ad 100644
--- a/sound/oss/swarm_cs4297a.c
+++ b/sound/oss/swarm_cs4297a.c
@@ -616,25 +616,23 @@ static int init_serdma(serdma_t *dma)
616 616
617 /* Descriptors */ 617 /* Descriptors */
618 dma->ringsz = DMA_DESCR; 618 dma->ringsz = DMA_DESCR;
619 dma->descrtab = kmalloc(dma->ringsz * sizeof(serdma_descr_t), GFP_KERNEL); 619 dma->descrtab = kzalloc(dma->ringsz * sizeof(serdma_descr_t), GFP_KERNEL);
620 if (!dma->descrtab) { 620 if (!dma->descrtab) {
621 printk(KERN_ERR "cs4297a: kmalloc descrtab failed\n"); 621 printk(KERN_ERR "cs4297a: kzalloc descrtab failed\n");
622 return -1; 622 return -1;
623 } 623 }
624 memset(dma->descrtab, 0, dma->ringsz * sizeof(serdma_descr_t));
625 dma->descrtab_end = dma->descrtab + dma->ringsz; 624 dma->descrtab_end = dma->descrtab + dma->ringsz;
626 /* XXX bloddy mess, use proper DMA API here ... */ 625 /* XXX bloddy mess, use proper DMA API here ... */
627 dma->descrtab_phys = CPHYSADDR((long)dma->descrtab); 626 dma->descrtab_phys = CPHYSADDR((long)dma->descrtab);
628 dma->descr_add = dma->descr_rem = dma->descrtab; 627 dma->descr_add = dma->descr_rem = dma->descrtab;
629 628
630 /* Frame buffer area */ 629 /* Frame buffer area */
631 dma->dma_buf = kmalloc(DMA_BUF_SIZE, GFP_KERNEL); 630 dma->dma_buf = kzalloc(DMA_BUF_SIZE, GFP_KERNEL);
632 if (!dma->dma_buf) { 631 if (!dma->dma_buf) {
633 printk(KERN_ERR "cs4297a: kmalloc dma_buf failed\n"); 632 printk(KERN_ERR "cs4297a: kzalloc dma_buf failed\n");
634 kfree(dma->descrtab); 633 kfree(dma->descrtab);
635 return -1; 634 return -1;
636 } 635 }
637 memset(dma->dma_buf, 0, DMA_BUF_SIZE);
638 dma->dma_buf_phys = CPHYSADDR((long)dma->dma_buf); 636 dma->dma_buf_phys = CPHYSADDR((long)dma->dma_buf);
639 637
640 /* Samples buffer area */ 638 /* Samples buffer area */
@@ -2619,12 +2617,11 @@ static int __init cs4297a_init(void)
2619 udelay(100); 2617 udelay(100);
2620#endif 2618#endif
2621 2619
2622 if (!(s = kmalloc(sizeof(struct cs4297a_state), GFP_KERNEL))) { 2620 if (!(s = kzalloc(sizeof(struct cs4297a_state), GFP_KERNEL))) {
2623 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR 2621 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR
2624 "cs4297a: probe() no memory for state struct.\n")); 2622 "cs4297a: probe() no memory for state struct.\n"));
2625 return -1; 2623 return -1;
2626 } 2624 }
2627 memset(s, 0, sizeof(struct cs4297a_state));
2628 s->magic = CS4297a_MAGIC; 2625 s->magic = CS4297a_MAGIC;
2629 init_waitqueue_head(&s->dma_adc.wait); 2626 init_waitqueue_head(&s->dma_adc.wait);
2630 init_waitqueue_head(&s->dma_dac.wait); 2627 init_waitqueue_head(&s->dma_dac.wait);
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index 6b1f8c9cdcf8..72a8a0ed36a2 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -2729,12 +2729,11 @@ trident_open(struct inode *inode, struct file *file)
2729 } 2729 }
2730 for (i = 0; i < NR_HW_CH; i++) { 2730 for (i = 0; i < NR_HW_CH; i++) {
2731 if (card->states[i] == NULL) { 2731 if (card->states[i] == NULL) {
2732 state = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); 2732 state = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL);
2733 if (state == NULL) { 2733 if (state == NULL) {
2734 mutex_unlock(&card->open_mutex); 2734 mutex_unlock(&card->open_mutex);
2735 return -ENOMEM; 2735 return -ENOMEM;
2736 } 2736 }
2737 memset(state, 0, sizeof(*state));
2738 mutex_init(&state->sem); 2737 mutex_init(&state->sem);
2739 dmabuf = &state->dmabuf; 2738 dmabuf = &state->dmabuf;
2740 goto found_virt; 2739 goto found_virt;
@@ -3618,7 +3617,7 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
3618 } 3617 }
3619 return -EBUSY; 3618 return -EBUSY;
3620 } 3619 }
3621 s = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); 3620 s = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL);
3622 if (!s) { 3621 if (!s) {
3623 num = ali_multi_channels_5_1[state_count]; 3622 num = ali_multi_channels_5_1[state_count];
3624 ali_free_pcm_channel(card, num); 3623 ali_free_pcm_channel(card, num);
@@ -3630,7 +3629,6 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums)
3630 } 3629 }
3631 return -ENOMEM; 3630 return -ENOMEM;
3632 } 3631 }
3633 memset(s, 0, sizeof(*state));
3634 3632
3635 s->dmabuf.channel = channel; 3633 s->dmabuf.channel = channel;
3636 s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags = 3634 s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags =
@@ -4399,11 +4397,10 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
4399 } 4397 }
4400 4398
4401 rc = -ENOMEM; 4399 rc = -ENOMEM;
4402 if ((card = kmalloc(sizeof(*card), GFP_KERNEL)) == NULL) { 4400 if ((card = kzalloc(sizeof(*card), GFP_KERNEL)) == NULL) {
4403 printk(KERN_ERR "trident: out of memory\n"); 4401 printk(KERN_ERR "trident: out of memory\n");
4404 goto out_release_region; 4402 goto out_release_region;
4405 } 4403 }
4406 memset(card, 0, sizeof (*card));
4407 4404
4408 init_timer(&card->timer); 4405 init_timer(&card->timer);
4409 card->iobase = iobase; 4406 card->iobase = iobase;
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 26a7c6af95bc..b48c72923a13 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -1267,12 +1267,10 @@ static int __init waveartist_init(wavnc_info *devc)
1267 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, 1267 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq,
1268 devc->hw.dma, devc->hw.dma2); 1268 devc->hw.dma, devc->hw.dma2);
1269 1269
1270 portc = kmalloc(sizeof(wavnc_port_info), GFP_KERNEL); 1270 portc = kzalloc(sizeof(wavnc_port_info), GFP_KERNEL);
1271 if (portc == NULL) 1271 if (portc == NULL)
1272 goto nomem; 1272 goto nomem;
1273 1273
1274 memset(portc, 0, sizeof(wavnc_port_info));
1275
1276 my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, dev_name, 1274 my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, dev_name,
1277 &waveartist_audio_driver, sizeof(struct audio_driver), 1275 &waveartist_audio_driver, sizeof(struct audio_driver),
1278 devc->audio_flags, AFMT_U8 | AFMT_S16_LE | AFMT_S8, 1276 devc->audio_flags, AFMT_U8 | AFMT_S16_LE | AFMT_S8,
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 74ed81081478..a9eec2a2357d 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -143,6 +143,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
143{ 0x43525970, 0xfffffff8, "CS4202", NULL, NULL }, 143{ 0x43525970, 0xfffffff8, "CS4202", NULL, NULL },
144{ 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, // SmartMC II 144{ 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, // SmartMC II
145{ 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, // SmartAMC fixme: the mask might be different 145{ 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, // SmartAMC fixme: the mask might be different
146{ 0x43585431, 0xffffffff, "Cx20551", patch_cx20551, NULL },
146{ 0x44543031, 0xfffffff0, "DT0398", NULL, NULL }, 147{ 0x44543031, 0xfffffff0, "DT0398", NULL, NULL },
147{ 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, // same as TR28028? 148{ 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, // same as TR28028?
148{ 0x45838308, 0xffffffff, "ESS1988", NULL, NULL }, 149{ 0x45838308, 0xffffffff, "ESS1988", NULL, NULL },
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 641d0c8d659e..bfc2fed16da3 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1338,6 +1338,12 @@ int patch_conexant(struct snd_ac97 * ac97)
1338 return 0; 1338 return 0;
1339} 1339}
1340 1340
1341int patch_cx20551(struct snd_ac97 *ac97)
1342{
1343 snd_ac97_update_bits(ac97, 0x5c, 0x01, 0x01);
1344 return 0;
1345}
1346
1341/* 1347/*
1342 * Analog Device AD18xx, AD19xx codecs 1348 * Analog Device AD18xx, AD19xx codecs
1343 */ 1349 */
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index 94340daaaf1f..555d1c9a98fd 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -39,6 +39,7 @@ int patch_sigmatel_stac9758(struct snd_ac97 * ac97);
39int patch_cirrus_cs4299(struct snd_ac97 * ac97); 39int patch_cirrus_cs4299(struct snd_ac97 * ac97);
40int patch_cirrus_spdif(struct snd_ac97 * ac97); 40int patch_cirrus_spdif(struct snd_ac97 * ac97);
41int patch_conexant(struct snd_ac97 * ac97); 41int patch_conexant(struct snd_ac97 * ac97);
42int patch_cx20551(struct snd_ac97 * ac97);
42int patch_ad1819(struct snd_ac97 * ac97); 43int patch_ad1819(struct snd_ac97 * ac97);
43int patch_ad1881(struct snd_ac97 * ac97); 44int patch_ad1881(struct snd_ac97 * ac97);
44int patch_ad1885(struct snd_ac97 * ac97); 45int patch_ad1885(struct snd_ac97 * ac97);
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 73f4668238c6..23a1c75085b5 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -57,6 +57,7 @@ struct conexant_spec {
57 * dig_out_nid and hp_nid are optional 57 * dig_out_nid and hp_nid are optional
58 */ 58 */
59 unsigned int cur_eapd; 59 unsigned int cur_eapd;
60 unsigned int hp_present;
60 unsigned int need_dac_fix; 61 unsigned int need_dac_fix;
61 62
62 /* capture */ 63 /* capture */
@@ -354,7 +355,7 @@ static struct hda_codec_ops conexant_patch_ops = {
354 * the private value = nid | (invert << 8) 355 * the private value = nid | (invert << 8)
355 */ 356 */
356 357
357static int conexant_eapd_info(struct snd_kcontrol *kcontrol, 358static int cxt_eapd_info(struct snd_kcontrol *kcontrol,
358 struct snd_ctl_elem_info *uinfo) 359 struct snd_ctl_elem_info *uinfo)
359{ 360{
360 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 361 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -364,7 +365,7 @@ static int conexant_eapd_info(struct snd_kcontrol *kcontrol,
364 return 0; 365 return 0;
365} 366}
366 367
367static int conexant_eapd_get(struct snd_kcontrol *kcontrol, 368static int cxt_eapd_get(struct snd_kcontrol *kcontrol,
368 struct snd_ctl_elem_value *ucontrol) 369 struct snd_ctl_elem_value *ucontrol)
369{ 370{
370 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 371 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
@@ -375,9 +376,10 @@ static int conexant_eapd_get(struct snd_kcontrol *kcontrol,
375 else 376 else
376 ucontrol->value.integer.value[0] = spec->cur_eapd; 377 ucontrol->value.integer.value[0] = spec->cur_eapd;
377 return 0; 378 return 0;
379
378} 380}
379 381
380static int conexant_eapd_put(struct snd_kcontrol *kcontrol, 382static int cxt_eapd_put(struct snd_kcontrol *kcontrol,
381 struct snd_ctl_elem_value *ucontrol) 383 struct snd_ctl_elem_value *ucontrol)
382{ 384{
383 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 385 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
@@ -385,11 +387,13 @@ static int conexant_eapd_put(struct snd_kcontrol *kcontrol,
385 int invert = (kcontrol->private_value >> 8) & 1; 387 int invert = (kcontrol->private_value >> 8) & 1;
386 hda_nid_t nid = kcontrol->private_value & 0xff; 388 hda_nid_t nid = kcontrol->private_value & 0xff;
387 unsigned int eapd; 389 unsigned int eapd;
390
388 eapd = ucontrol->value.integer.value[0]; 391 eapd = ucontrol->value.integer.value[0];
389 if (invert) 392 if (invert)
390 eapd = !eapd; 393 eapd = !eapd;
391 if (eapd == spec->cur_eapd && !codec->in_resume) 394 if (eapd == spec->cur_eapd && !codec->in_resume)
392 return 0; 395 return 0;
396
393 spec->cur_eapd = eapd; 397 spec->cur_eapd = eapd;
394 snd_hda_codec_write(codec, nid, 398 snd_hda_codec_write(codec, nid,
395 0, AC_VERB_SET_EAPD_BTLENABLE, 399 0, AC_VERB_SET_EAPD_BTLENABLE,
@@ -400,6 +404,15 @@ static int conexant_eapd_put(struct snd_kcontrol *kcontrol,
400/* controls for test mode */ 404/* controls for test mode */
401#ifdef CONFIG_SND_DEBUG 405#ifdef CONFIG_SND_DEBUG
402 406
407#define CXT_EAPD_SWITCH(xname, nid, mask) \
408 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
409 .info = cxt_eapd_info, \
410 .get = cxt_eapd_get, \
411 .put = cxt_eapd_put, \
412 .private_value = nid | (mask<<16) }
413
414
415
403static int conexant_ch_mode_info(struct snd_kcontrol *kcontrol, 416static int conexant_ch_mode_info(struct snd_kcontrol *kcontrol,
404 struct snd_ctl_elem_info *uinfo) 417 struct snd_ctl_elem_info *uinfo)
405{ 418{
@@ -492,7 +505,7 @@ static int cxt_gpio_data_put(struct snd_kcontrol *kcontrol,
492 .get = cxt_gpio_data_get, \ 505 .get = cxt_gpio_data_get, \
493 .put = cxt_gpio_data_put, \ 506 .put = cxt_gpio_data_put, \
494 .private_value = nid | (mask<<16) } 507 .private_value = nid | (mask<<16) }
495 508#if 0
496static int cxt_spdif_ctrl_info(struct snd_kcontrol *kcontrol, 509static int cxt_spdif_ctrl_info(struct snd_kcontrol *kcontrol,
497 struct snd_ctl_elem_info *uinfo) 510 struct snd_ctl_elem_info *uinfo)
498{ 511{
@@ -547,7 +560,7 @@ static int cxt_spdif_ctrl_put(struct snd_kcontrol *kcontrol,
547 .get = cxt_spdif_ctrl_get, \ 560 .get = cxt_spdif_ctrl_get, \
548 .put = cxt_spdif_ctrl_put, \ 561 .put = cxt_spdif_ctrl_put, \
549 .private_value = nid | (mask<<16) } 562 .private_value = nid | (mask<<16) }
550 563#endif
551#endif /* CONFIG_SND_DEBUG */ 564#endif /* CONFIG_SND_DEBUG */
552 565
553/* Conexant 5045 specific */ 566/* Conexant 5045 specific */
@@ -564,7 +577,7 @@ static struct hda_channel_mode cxt5045_modes[1] = {
564static struct hda_input_mux cxt5045_capture_source = { 577static struct hda_input_mux cxt5045_capture_source = {
565 .num_items = 2, 578 .num_items = 2,
566 .items = { 579 .items = {
567 { "ExtMic", 0x1 }, 580 { "IntMic", 0x1 },
568 { "LineIn", 0x2 }, 581 { "LineIn", 0x2 },
569 } 582 }
570}; 583};
@@ -575,15 +588,20 @@ static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol,
575{ 588{
576 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 589 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
577 struct conexant_spec *spec = codec->spec; 590 struct conexant_spec *spec = codec->spec;
591 unsigned int bits;
578 592
579 if (!conexant_eapd_put(kcontrol, ucontrol)) 593 if (!cxt_eapd_put(kcontrol, ucontrol))
580 return 0; 594 return 0;
581 595
582 /* toggle HP mute appropriately */ 596 /* toggle internal speakers mute depending of presence of
583 snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0, 597 * the headphone jack
584 0x80, spec->cur_eapd ? 0 : 0x80); 598 */
585 snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0, 599 bits = (!spec->hp_present && spec->cur_eapd) ? 0 : 0x80;
586 0x80, spec->cur_eapd ? 0 : 0x80); 600 snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits);
601 snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits);
602 bits = spec->cur_eapd ? 0 : 0x80;
603 snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0, 0x80, bits);
604 snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0, 0x80, bits);
587 return 1; 605 return 1;
588} 606}
589 607
@@ -610,14 +628,13 @@ static int cxt5045_hp_master_vol_put(struct snd_kcontrol *kcontrol,
610/* mute internal speaker if HP is plugged */ 628/* mute internal speaker if HP is plugged */
611static void cxt5045_hp_automute(struct hda_codec *codec) 629static void cxt5045_hp_automute(struct hda_codec *codec)
612{ 630{
613 unsigned int present; 631 struct conexant_spec *spec = codec->spec;
632 unsigned int bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
614 633
615 present = snd_hda_codec_read(codec, 0x11, 0, 634 spec->hp_present = snd_hda_codec_read(codec, 0x11, 0,
616 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 635 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
617 snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 636 snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits);
618 0x80, present ? 0x80 : 0); 637 snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits);
619 snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0,
620 0x80, present ? 0x80 : 0);
621} 638}
622 639
623/* unsolicited event for HP jack sensing */ 640/* unsolicited event for HP jack sensing */
@@ -640,25 +657,27 @@ static struct snd_kcontrol_new cxt5045_mixers[] = {
640 .get = conexant_mux_enum_get, 657 .get = conexant_mux_enum_get,
641 .put = conexant_mux_enum_put 658 .put = conexant_mux_enum_put
642 }, 659 },
643 HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x17, 0x02, HDA_INPUT), 660 HDA_CODEC_VOLUME("Int Mic Volume", 0x17, 0x01, HDA_INPUT),
644 HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x17, 0x02, HDA_INPUT), 661 HDA_CODEC_MUTE("Int Mic Switch", 0x17, 0x01, HDA_INPUT),
645 HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x02, HDA_INPUT), 662 HDA_CODEC_VOLUME("Ext Mic Volume", 0x17, 0x02, HDA_INPUT),
646 HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x02, HDA_INPUT), 663 HDA_CODEC_MUTE("Ext Mic Switch", 0x17, 0x02, HDA_INPUT),
664 HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x0, HDA_INPUT),
665 HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x0, HDA_INPUT),
647 { 666 {
648 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 667 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
649 .name = "Master Playback Volume", 668 .name = "Master Playback Volume",
650 .info = snd_hda_mixer_amp_volume_info, 669 .info = snd_hda_mixer_amp_volume_info,
651 .get = snd_hda_mixer_amp_volume_get, 670 .get = snd_hda_mixer_amp_volume_get,
652 .put = cxt5045_hp_master_vol_put, 671 .put = cxt5045_hp_master_vol_put,
653 .private_value = HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT), 672 .private_value = HDA_COMPOSE_AMP_VAL(0x10, 3, 0, HDA_OUTPUT),
654 }, 673 },
655 { 674 {
656 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 675 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
657 .name = "Master Playback Switch", 676 .name = "Master Playback Switch",
658 .info = conexant_eapd_info, 677 .info = cxt_eapd_info,
659 .get = conexant_eapd_get, 678 .get = cxt_eapd_get,
660 .put = cxt5045_hp_master_sw_put, 679 .put = cxt5045_hp_master_sw_put,
661 .private_value = 0x11, 680 .private_value = 0x10,
662 }, 681 },
663 682
664 {} 683 {}
@@ -669,22 +688,26 @@ static struct hda_verb cxt5045_init_verbs[] = {
669 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 688 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
670 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, 689 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
671 /* HP, Amp */ 690 /* HP, Amp */
672 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 691 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
673 {0x1A, AC_VERB_SET_CONNECT_SEL,0x01}, 692 {0x17, AC_VERB_SET_CONNECT_SEL,0x01},
674 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, 693 {0x17, AC_VERB_SET_AMP_GAIN_MUTE,
675 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00}, 694 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x01},
676 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, 695 {0x17, AC_VERB_SET_AMP_GAIN_MUTE,
696 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x02},
697 {0x17, AC_VERB_SET_AMP_GAIN_MUTE,
677 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03}, 698 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03},
678 /* Record selector: Front mic */
679 {0x14, AC_VERB_SET_CONNECT_SEL,0x03},
680 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 699 {0x17, AC_VERB_SET_AMP_GAIN_MUTE,
700 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x04},
701 /* Record selector: Int mic */
702 {0x1a, AC_VERB_SET_CONNECT_SEL,0x0},
703 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE,
681 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, 704 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
682 /* SPDIF route: PCM */ 705 /* SPDIF route: PCM */
683 { 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 }, 706 { 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 },
684 /* pin sensing on HP and Mic jacks */ 707 /* pin sensing on HP and Mic jacks */
685 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, 708 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
686 /* EAPD */ 709 /* EAPD */
687 {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x0 }, /* default on */ 710 {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */
688 { } /* end */ 711 { } /* end */
689}; 712};
690 713
@@ -706,8 +729,6 @@ static struct hda_input_mux cxt5045_test_capture_source = {
706static struct snd_kcontrol_new cxt5045_test_mixer[] = { 729static struct snd_kcontrol_new cxt5045_test_mixer[] = {
707 730
708 /* Output controls */ 731 /* Output controls */
709 HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x19, 0x00, HDA_OUTPUT),
710 HDA_CODEC_MUTE("OutAmp-1 Switch", 0x19,0x00, HDA_OUTPUT),
711 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x10, 0x0, HDA_OUTPUT), 732 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x10, 0x0, HDA_OUTPUT),
712 HDA_CODEC_MUTE("Speaker Playback Switch", 0x10, 0x0, HDA_OUTPUT), 733 HDA_CODEC_MUTE("Speaker Playback Switch", 0x10, 0x0, HDA_OUTPUT),
713 734
@@ -715,6 +736,9 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
715 CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT), 736 CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT),
716 CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT), 737 CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT),
717 738
739 /* EAPD Switch Control */
740 CXT_EAPD_SWITCH("External Amplifier", 0x10, 0x0),
741
718 /* Loopback mixer controls */ 742 /* Loopback mixer controls */
719 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x17, 0x01, HDA_INPUT), 743 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x17, 0x01, HDA_INPUT),
720 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x17, 0x01, HDA_INPUT), 744 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x17, 0x01, HDA_INPUT),
@@ -725,17 +749,16 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
725 HDA_CODEC_VOLUME("CD Playback Volume", 0x17, 0x04, HDA_INPUT), 749 HDA_CODEC_VOLUME("CD Playback Volume", 0x17, 0x04, HDA_INPUT),
726 HDA_CODEC_MUTE("CD Playback Switch", 0x17, 0x04, HDA_INPUT), 750 HDA_CODEC_MUTE("CD Playback Switch", 0x17, 0x04, HDA_INPUT),
727 751
728 /* Controls for GPIO pins, assuming they exist and are configured as outputs */ 752 HDA_CODEC_VOLUME("Capture-1 Volume", 0x17, 0x0, HDA_INPUT),
729 CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01), 753 HDA_CODEC_MUTE("Capture-1 Switch", 0x17, 0x0, HDA_INPUT),
730#if 0 /* limit this to one GPIO pin for now */ 754 HDA_CODEC_VOLUME("Capture-2 Volume", 0x17, 0x1, HDA_INPUT),
731 CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02), 755 HDA_CODEC_MUTE("Capture-2 Switch", 0x17, 0x1, HDA_INPUT),
732 CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04), 756 HDA_CODEC_VOLUME("Capture-3 Volume", 0x17, 0x2, HDA_INPUT),
733 CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08), 757 HDA_CODEC_MUTE("Capture-3 Switch", 0x17, 0x2, HDA_INPUT),
734#endif 758 HDA_CODEC_VOLUME("Capture-4 Volume", 0x17, 0x3, HDA_INPUT),
735 CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x13, 0x01), 759 HDA_CODEC_MUTE("Capture-4 Switch", 0x17, 0x3, HDA_INPUT),
736 760 HDA_CODEC_VOLUME("Capture-5 Volume", 0x17, 0x4, HDA_INPUT),
737 HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_OUTPUT), 761 HDA_CODEC_MUTE("Capture-5 Switch", 0x17, 0x4, HDA_INPUT),
738 HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_OUTPUT),
739 { 762 {
740 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 763 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
741 .name = "Input Source", 764 .name = "Input Source",
@@ -748,14 +771,9 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
748}; 771};
749 772
750static struct hda_verb cxt5045_test_init_verbs[] = { 773static struct hda_verb cxt5045_test_init_verbs[] = {
751 /* Enable all GPIOs as outputs with an initial value of 0 */
752 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
753 {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
754 {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
755
756 /* Enable retasking pins as output, initially without power amp */ 774 /* Enable retasking pins as output, initially without power amp */
757 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 775 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
758 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 776 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
759 777
760 /* Disable digital (SPDIF) pins initially, but users can enable 778 /* Disable digital (SPDIF) pins initially, but users can enable
761 * them via a mixer switch. In the case of SPDIF-out, this initverb 779 * them via a mixer switch. In the case of SPDIF-out, this initverb
@@ -823,6 +841,8 @@ static const char *cxt5045_models[CXT5045_MODELS] = {
823 841
824static struct snd_pci_quirk cxt5045_cfg_tbl[] = { 842static struct snd_pci_quirk cxt5045_cfg_tbl[] = {
825 SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP), 843 SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP),
844 SND_PCI_QUIRK(0x103c, 0x30bb, "HP DV8000", CXT5045_LAPTOP),
845 SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_LAPTOP),
826 {} 846 {}
827}; 847};
828 848
@@ -880,11 +900,11 @@ static int patch_cxt5045(struct hda_codec *codec)
880 900
881 901
882/* Conexant 5047 specific */ 902/* Conexant 5047 specific */
903#define CXT5047_SPDIF_OUT 0x11
883 904
884static hda_nid_t cxt5047_dac_nids[1] = { 0x10 }; 905static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c };
885static hda_nid_t cxt5047_adc_nids[1] = { 0x12 }; 906static hda_nid_t cxt5047_adc_nids[1] = { 0x12 };
886static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a }; 907static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a };
887#define CXT5047_SPDIF_OUT 0x11
888 908
889static struct hda_channel_mode cxt5047_modes[1] = { 909static struct hda_channel_mode cxt5047_modes[1] = {
890 { 2, NULL }, 910 { 2, NULL },
@@ -893,15 +913,23 @@ static struct hda_channel_mode cxt5047_modes[1] = {
893static struct hda_input_mux cxt5047_capture_source = { 913static struct hda_input_mux cxt5047_capture_source = {
894 .num_items = 2, 914 .num_items = 2,
895 .items = { 915 .items = {
896 { "ExtMic", 0x1 }, 916 { "ExtMic", 0x0 },
897 { "IntMic", 0x2 }, 917 { "IntMic", 0x1 },
898 } 918 }
899}; 919};
900 920
901static struct hda_input_mux cxt5047_hp_capture_source = { 921static struct hda_input_mux cxt5047_hp_capture_source = {
902 .num_items = 1, 922 .num_items = 1,
903 .items = { 923 .items = {
904 { "ExtMic", 0x1 }, 924 { "ExtMic", 0x2 },
925 }
926};
927
928static struct hda_input_mux cxt5047_toshiba_capture_source = {
929 .num_items = 2,
930 .items = {
931 { "ExtMic", 0x2 },
932 { "Line-In", 0x1 },
905 } 933 }
906}; 934};
907 935
@@ -911,20 +939,24 @@ static int cxt5047_hp_master_sw_put(struct snd_kcontrol *kcontrol,
911{ 939{
912 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 940 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
913 struct conexant_spec *spec = codec->spec; 941 struct conexant_spec *spec = codec->spec;
942 unsigned int bits;
914 943
915 if (!conexant_eapd_put(kcontrol, ucontrol)) 944 if (!cxt_eapd_put(kcontrol, ucontrol))
916 return 0; 945 return 0;
917 946
918 /* toggle HP mute appropriately */ 947 /* toggle internal speakers mute depending of presence of
919 snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, 948 * the headphone jack
920 0x80, spec->cur_eapd ? 0 : 0x80); 949 */
921 snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0, 950 bits = (!spec->hp_present && spec->cur_eapd) ? 0 : 0x80;
922 0x80, spec->cur_eapd ? 0 : 0x80); 951 snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits);
952 snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits);
953 bits = spec->cur_eapd ? 0 : 0x80;
954 snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, 0x80, bits);
955 snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0, 0x80, bits);
923 return 1; 956 return 1;
924} 957}
925 958
926#if 0 959/* bind volumes of both NID 0x13 (Headphones) and 0x1d (Speakers) */
927/* bind volumes of both NID 0x13 and 0x1d */
928static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol, 960static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
929 struct snd_ctl_elem_value *ucontrol) 961 struct snd_ctl_elem_value *ucontrol)
930{ 962{
@@ -932,9 +964,9 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
932 long *valp = ucontrol->value.integer.value; 964 long *valp = ucontrol->value.integer.value;
933 int change; 965 int change;
934 966
935 change = snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 967 change = snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0,
936 0x7f, valp[0] & 0x7f); 968 0x7f, valp[0] & 0x7f);
937 change |= snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 969 change |= snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0,
938 0x7f, valp[1] & 0x7f); 970 0x7f, valp[1] & 0x7f);
939 snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, 971 snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0,
940 0x7f, valp[0] & 0x7f); 972 0x7f, valp[0] & 0x7f);
@@ -942,19 +974,20 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
942 0x7f, valp[1] & 0x7f); 974 0x7f, valp[1] & 0x7f);
943 return change; 975 return change;
944} 976}
945#endif
946 977
947/* mute internal speaker if HP is plugged */ 978/* mute internal speaker if HP is plugged */
948static void cxt5047_hp_automute(struct hda_codec *codec) 979static void cxt5047_hp_automute(struct hda_codec *codec)
949{ 980{
950 unsigned int present; 981 struct conexant_spec *spec = codec->spec;
982 unsigned int bits = spec->hp_present || !spec->cur_eapd ? 0x80 : 0;
951 983
952 present = snd_hda_codec_read(codec, 0x13, 0, 984 spec->hp_present = snd_hda_codec_read(codec, 0x13, 0,
953 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 985 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
954 snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 986 snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits);
955 0x80, present ? 0x80 : 0); 987 snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits);
956 snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 988 /* Mute/Unmute PCM 2 for good measure - some systems need this */
957 0x80, present ? 0x80 : 0); 989 snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits);
990 snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits);
958} 991}
959 992
960/* toggle input of built-in and mic jack appropriately */ 993/* toggle input of built-in and mic jack appropriately */
@@ -1009,12 +1042,55 @@ static struct snd_kcontrol_new cxt5047_mixers[] = {
1009 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), 1042 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT),
1010 HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), 1043 HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT),
1011 HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT), 1044 HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT),
1012 HDA_CODEC_VOLUME("Master Playback Volume", 0x13, 0x00, HDA_OUTPUT), 1045 HDA_CODEC_VOLUME("PCM-2 Volume", 0x1c, 0x00, HDA_OUTPUT),
1046 HDA_CODEC_MUTE("PCM-2 Switch", 0x1c, 0x00, HDA_OUTPUT),
1047 {
1048 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1049 .name = "Master Playback Volume",
1050 .info = snd_hda_mixer_amp_volume_info,
1051 .get = snd_hda_mixer_amp_volume_get,
1052 .put = cxt5047_hp_master_vol_put,
1053 .private_value = HDA_COMPOSE_AMP_VAL(0x13, 3, 0, HDA_OUTPUT),
1054 },
1013 { 1055 {
1014 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1056 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1015 .name = "Master Playback Switch", 1057 .name = "Master Playback Switch",
1016 .info = conexant_eapd_info, 1058 .info = cxt_eapd_info,
1017 .get = conexant_eapd_get, 1059 .get = cxt_eapd_get,
1060 .put = cxt5047_hp_master_sw_put,
1061 .private_value = 0x13,
1062 },
1063
1064 {}
1065};
1066
1067static struct snd_kcontrol_new cxt5047_toshiba_mixers[] = {
1068 {
1069 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1070 .name = "Capture Source",
1071 .info = conexant_mux_enum_info,
1072 .get = conexant_mux_enum_get,
1073 .put = conexant_mux_enum_put
1074 },
1075 HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT),
1076 HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19, 0x02, HDA_INPUT),
1077 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT),
1078 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT),
1079 HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT),
1080 HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT),
1081 {
1082 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1083 .name = "Master Playback Volume",
1084 .info = snd_hda_mixer_amp_volume_info,
1085 .get = snd_hda_mixer_amp_volume_get,
1086 .put = cxt5047_hp_master_vol_put,
1087 .private_value = HDA_COMPOSE_AMP_VAL(0x13, 3, 0, HDA_OUTPUT),
1088 },
1089 {
1090 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1091 .name = "Master Playback Switch",
1092 .info = cxt_eapd_info,
1093 .get = cxt_eapd_get,
1018 .put = cxt5047_hp_master_sw_put, 1094 .put = cxt5047_hp_master_sw_put,
1019 .private_value = 0x13, 1095 .private_value = 0x13,
1020 }, 1096 },
@@ -1040,8 +1116,8 @@ static struct snd_kcontrol_new cxt5047_hp_mixers[] = {
1040 { 1116 {
1041 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1117 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1042 .name = "Master Playback Switch", 1118 .name = "Master Playback Switch",
1043 .info = conexant_eapd_info, 1119 .info = cxt_eapd_info,
1044 .get = conexant_eapd_get, 1120 .get = cxt_eapd_get,
1045 .put = cxt5047_hp_master_sw_put, 1121 .put = cxt5047_hp_master_sw_put,
1046 .private_value = 0x13, 1122 .private_value = 0x13,
1047 }, 1123 },
@@ -1053,19 +1129,23 @@ static struct hda_verb cxt5047_init_verbs[] = {
1053 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 1129 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
1054 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, 1130 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
1055 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, 1131 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
1056 /* HP, Amp */ 1132 /* HP, Amp, Speaker */
1057 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, 1133 {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1058 {0x1A, AC_VERB_SET_CONNECT_SEL,0x03}, 1134 {0x1A, AC_VERB_SET_CONNECT_SEL,0x00},
1059 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, 1135 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE,
1060 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00}, 1136 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00},
1061 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, 1137 {0x1A, AC_VERB_SET_AMP_GAIN_MUTE,
1062 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03}, 1138 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03},
1139 {0x1d, AC_VERB_SET_CONNECT_SEL,0x0},
1063 /* Record selector: Front mic */ 1140 /* Record selector: Front mic */
1064 {0x12, AC_VERB_SET_CONNECT_SEL,0x03}, 1141 {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
1065 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, 1142 {0x19, AC_VERB_SET_AMP_GAIN_MUTE,
1066 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, 1143 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
1067 /* SPDIF route: PCM */ 1144 /* SPDIF route: PCM */
1068 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x0 }, 1145 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x0 },
1146 /* Enable unsolicited events */
1147 {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
1148 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
1069 { } /* end */ 1149 { } /* end */
1070}; 1150};
1071 1151
@@ -1075,14 +1155,24 @@ static struct hda_verb cxt5047_toshiba_init_verbs[] = {
1075 /* pin sensing on HP and Mic jacks */ 1155 /* pin sensing on HP and Mic jacks */
1076 {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, 1156 {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
1077 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, 1157 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
1158 /* Speaker routing */
1159 {0x1d, AC_VERB_SET_CONNECT_SEL,0x1},
1160 /* Change default to ExtMic for recording */
1161 {0x1a, AC_VERB_SET_CONNECT_SEL,0x2},
1078 {} 1162 {}
1079}; 1163};
1080 1164
1081/* configuration for HP Laptops */ 1165/* configuration for HP Laptops */
1082static struct hda_verb cxt5047_hp_init_verbs[] = { 1166static struct hda_verb cxt5047_hp_init_verbs[] = {
1083 /* pin sensing on HP and Mic jacks */ 1167 /* pin sensing on HP jack */
1084 {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, 1168 {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
1085 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, 1169 /* Record selector: Ext Mic */
1170 {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
1171 {0x1a, AC_VERB_SET_CONNECT_SEL,0x02},
1172 {0x19, AC_VERB_SET_AMP_GAIN_MUTE,
1173 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
1174 /* Speaker routing */
1175 {0x1d, AC_VERB_SET_CONNECT_SEL,0x1},
1086 {} 1176 {}
1087}; 1177};
1088 1178
@@ -1091,53 +1181,56 @@ static struct hda_verb cxt5047_hp_init_verbs[] = {
1091 */ 1181 */
1092#ifdef CONFIG_SND_DEBUG 1182#ifdef CONFIG_SND_DEBUG
1093static struct hda_input_mux cxt5047_test_capture_source = { 1183static struct hda_input_mux cxt5047_test_capture_source = {
1094 .num_items = 5, 1184 .num_items = 4,
1095 .items = { 1185 .items = {
1096 { "MIXER", 0x0 }, 1186 { "LINE1 pin", 0x0 },
1097 { "LINE1 pin", 0x1 }, 1187 { "MIC1 pin", 0x1 },
1098 { "MIC1 pin", 0x2 }, 1188 { "MIC2 pin", 0x2 },
1099 { "MIC2 pin", 0x3 }, 1189 { "CD pin", 0x3 },
1100 { "CD pin", 0x4 },
1101 }, 1190 },
1102}; 1191};
1103 1192
1104static struct snd_kcontrol_new cxt5047_test_mixer[] = { 1193static struct snd_kcontrol_new cxt5047_test_mixer[] = {
1105 1194
1106 /* Output only controls */ 1195 /* Output only controls */
1107 HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x10, 0x00, HDA_OUTPUT), 1196 HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x10, 0x0, HDA_OUTPUT),
1108 HDA_CODEC_MUTE("OutAmp-1 Switch", 0x10,0x00, HDA_OUTPUT), 1197 HDA_CODEC_MUTE("OutAmp-1 Switch", 0x10,0x0, HDA_OUTPUT),
1109 HDA_CODEC_VOLUME("OutAmp-2 Volume", 0x1c, 0x00, HDA_OUTPUT), 1198 HDA_CODEC_VOLUME("OutAmp-2 Volume", 0x1c, 0x0, HDA_OUTPUT),
1110 HDA_CODEC_MUTE("OutAmp-2 Switch", 0x1c, 0x00, HDA_OUTPUT), 1199 HDA_CODEC_MUTE("OutAmp-2 Switch", 0x1c, 0x0, HDA_OUTPUT),
1111 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x0, HDA_OUTPUT), 1200 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
1112 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1d, 0x0, HDA_OUTPUT), 1201 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
1113 HDA_CODEC_VOLUME("HeadPhone Playback Volume", 0x13, 0x0, HDA_OUTPUT), 1202 HDA_CODEC_VOLUME("HeadPhone Playback Volume", 0x13, 0x0, HDA_OUTPUT),
1114 HDA_CODEC_MUTE("HeadPhone Playback Switch", 0x13, 0x0, HDA_OUTPUT), 1203 HDA_CODEC_MUTE("HeadPhone Playback Switch", 0x13, 0x0, HDA_OUTPUT),
1204 HDA_CODEC_VOLUME("Line1-Out Playback Volume", 0x14, 0x0, HDA_OUTPUT),
1205 HDA_CODEC_MUTE("Line1-Out Playback Switch", 0x14, 0x0, HDA_OUTPUT),
1206 HDA_CODEC_VOLUME("Line2-Out Playback Volume", 0x15, 0x0, HDA_OUTPUT),
1207 HDA_CODEC_MUTE("Line2-Out Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1115 1208
1116 /* Modes for retasking pin widgets */ 1209 /* Modes for retasking pin widgets */
1117 CXT_PIN_MODE("LINE1 pin mode", 0x14, CXT_PIN_DIR_INOUT), 1210 CXT_PIN_MODE("LINE1 pin mode", 0x14, CXT_PIN_DIR_INOUT),
1118 CXT_PIN_MODE("MIC1 pin mode", 0x15, CXT_PIN_DIR_INOUT), 1211 CXT_PIN_MODE("MIC1 pin mode", 0x15, CXT_PIN_DIR_INOUT),
1119 1212
1120 /* Loopback mixer controls */ 1213 /* EAPD Switch Control */
1121 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x19, 0x02, HDA_INPUT), 1214 CXT_EAPD_SWITCH("External Amplifier", 0x13, 0x0),
1122 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x19, 0x02, HDA_INPUT),
1123 HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x19, 0x03, HDA_INPUT),
1124 HDA_CODEC_MUTE("MIC2 Playback Switch", 0x19, 0x03, HDA_INPUT),
1125 HDA_CODEC_VOLUME("LINE Playback Volume", 0x19, 0x01, HDA_INPUT),
1126 HDA_CODEC_MUTE("LINE Playback Switch", 0x19, 0x01, HDA_INPUT),
1127 HDA_CODEC_VOLUME("CD Playback Volume", 0x19, 0x04, HDA_INPUT),
1128 HDA_CODEC_MUTE("CD Playback Switch", 0x19, 0x04, HDA_INPUT),
1129
1130#if 0
1131 /* Controls for GPIO pins, assuming they exist and are configured as outputs */
1132 CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
1133 CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
1134 CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
1135 CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
1136#endif
1137 CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x18, 0x01),
1138 1215
1139 HDA_CODEC_VOLUME("Capture Volume", 0x19, 0x0, HDA_OUTPUT), 1216 /* Loopback mixer controls */
1140 HDA_CODEC_MUTE("Capture Switch", 0x19, 0x0, HDA_OUTPUT), 1217 HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x12, 0x01, HDA_INPUT),
1218 HDA_CODEC_MUTE("MIC1 Playback Switch", 0x12, 0x01, HDA_INPUT),
1219 HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x12, 0x02, HDA_INPUT),
1220 HDA_CODEC_MUTE("MIC2 Playback Switch", 0x12, 0x02, HDA_INPUT),
1221 HDA_CODEC_VOLUME("LINE Playback Volume", 0x12, 0x0, HDA_INPUT),
1222 HDA_CODEC_MUTE("LINE Playback Switch", 0x12, 0x0, HDA_INPUT),
1223 HDA_CODEC_VOLUME("CD Playback Volume", 0x12, 0x04, HDA_INPUT),
1224 HDA_CODEC_MUTE("CD Playback Switch", 0x12, 0x04, HDA_INPUT),
1225
1226 HDA_CODEC_VOLUME("Capture-1 Volume", 0x19, 0x0, HDA_INPUT),
1227 HDA_CODEC_MUTE("Capture-1 Switch", 0x19, 0x0, HDA_INPUT),
1228 HDA_CODEC_VOLUME("Capture-2 Volume", 0x19, 0x1, HDA_INPUT),
1229 HDA_CODEC_MUTE("Capture-2 Switch", 0x19, 0x1, HDA_INPUT),
1230 HDA_CODEC_VOLUME("Capture-3 Volume", 0x19, 0x2, HDA_INPUT),
1231 HDA_CODEC_MUTE("Capture-3 Switch", 0x19, 0x2, HDA_INPUT),
1232 HDA_CODEC_VOLUME("Capture-4 Volume", 0x19, 0x3, HDA_INPUT),
1233 HDA_CODEC_MUTE("Capture-4 Switch", 0x19, 0x3, HDA_INPUT),
1141 { 1234 {
1142 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1235 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1143 .name = "Input Source", 1236 .name = "Input Source",
@@ -1145,16 +1238,18 @@ static struct snd_kcontrol_new cxt5047_test_mixer[] = {
1145 .get = conexant_mux_enum_get, 1238 .get = conexant_mux_enum_get,
1146 .put = conexant_mux_enum_put, 1239 .put = conexant_mux_enum_put,
1147 }, 1240 },
1241 /* Controls for GPIO pins, assuming they exist and are configured
1242 * as outputs
1243 */
1244 CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
1245 CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
1246 CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
1247 CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
1148 1248
1149 { } /* end */ 1249 { } /* end */
1150}; 1250};
1151 1251
1152static struct hda_verb cxt5047_test_init_verbs[] = { 1252static struct hda_verb cxt5047_test_init_verbs[] = {
1153 /* Enable all GPIOs as outputs with an initial value of 0 */
1154 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
1155 {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
1156 {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
1157
1158 /* Enable retasking pins as output, initially without power amp */ 1253 /* Enable retasking pins as output, initially without power amp */
1159 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 1254 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1160 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 1255 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
@@ -1215,7 +1310,6 @@ static int cxt5047_hp_init(struct hda_codec *codec)
1215{ 1310{
1216 conexant_init(codec); 1311 conexant_init(codec);
1217 cxt5047_hp_automute(codec); 1312 cxt5047_hp_automute(codec);
1218 cxt5047_hp_automic(codec);
1219 return 0; 1313 return 0;
1220} 1314}
1221 1315
@@ -1242,6 +1336,7 @@ static const char *cxt5047_models[CXT5047_MODELS] = {
1242static struct snd_pci_quirk cxt5047_cfg_tbl[] = { 1336static struct snd_pci_quirk cxt5047_cfg_tbl[] = {
1243 SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP), 1337 SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP),
1244 SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP), 1338 SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP),
1339 SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2000Z", CXT5047_LAPTOP),
1245 SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP), 1340 SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP),
1246 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD), 1341 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD),
1247 {} 1342 {}
@@ -1291,8 +1386,10 @@ static int patch_cxt5047(struct hda_codec *codec)
1291 codec->patch_ops.init = cxt5047_hp_init; 1386 codec->patch_ops.init = cxt5047_hp_init;
1292 break; 1387 break;
1293 case CXT5047_LAPTOP_EAPD: 1388 case CXT5047_LAPTOP_EAPD:
1389 spec->input_mux = &cxt5047_toshiba_capture_source;
1294 spec->num_init_verbs = 2; 1390 spec->num_init_verbs = 2;
1295 spec->init_verbs[1] = cxt5047_toshiba_init_verbs; 1391 spec->init_verbs[1] = cxt5047_toshiba_init_verbs;
1392 spec->mixers[0] = cxt5047_toshiba_mixers;
1296 break; 1393 break;
1297#ifdef CONFIG_SND_DEBUG 1394#ifdef CONFIG_SND_DEBUG
1298 case CXT5047_TEST: 1395 case CXT5047_TEST:
@@ -1305,7 +1402,9 @@ static int patch_cxt5047(struct hda_codec *codec)
1305} 1402}
1306 1403
1307struct hda_codec_preset snd_hda_preset_conexant[] = { 1404struct hda_codec_preset snd_hda_preset_conexant[] = {
1308 { .id = 0x14f15045, .name = "CXT5045", .patch = patch_cxt5045 }, 1405 { .id = 0x14f15045, .name = "CX20549 (Venice)",
1309 { .id = 0x14f15047, .name = "CXT5047", .patch = patch_cxt5047 }, 1406 .patch = patch_cxt5045 },
1407 { .id = 0x14f15047, .name = "CX20551 (Waikiki)",
1408 .patch = patch_cxt5047 },
1310 {} /* terminator */ 1409 {} /* terminator */
1311}; 1410};
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 6f4a39273b98..f7ef9c5afe87 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -457,6 +457,10 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
457 "Dell Latitude 120L", STAC_REF), 457 "Dell Latitude 120L", STAC_REF),
458 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc, 458 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc,
459 "Dell Latitude D820", STAC_REF), 459 "Dell Latitude D820", STAC_REF),
460 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cd,
461 "Dell Inspiron E1705/9400", STAC_REF),
462 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce,
463 "Dell XPS M1710", STAC_REF),
460 {} /* terminator */ 464 {} /* terminator */
461}; 465};
462 466
@@ -1800,6 +1804,7 @@ static int patch_stac925x(struct hda_codec *codec)
1800 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, 1804 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
1801 stac925x_models, 1805 stac925x_models,
1802 stac925x_cfg_tbl); 1806 stac925x_cfg_tbl);
1807 again:
1803 if (spec->board_config < 0) { 1808 if (spec->board_config < 0) {
1804 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n"); 1809 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n");
1805 err = stac92xx_save_bios_config_regs(codec); 1810 err = stac92xx_save_bios_config_regs(codec);
@@ -1825,6 +1830,15 @@ static int patch_stac925x(struct hda_codec *codec)
1825 spec->mixer = stac925x_mixer; 1830 spec->mixer = stac925x_mixer;
1826 1831
1827 err = stac92xx_parse_auto_config(codec, 0x8, 0x7); 1832 err = stac92xx_parse_auto_config(codec, 0x8, 0x7);
1833 if (!err) {
1834 if (spec->board_config < 0) {
1835 printk(KERN_WARNING "hda_codec: No auto-config is "
1836 "available, default to model=ref\n");
1837 spec->board_config = STAC_925x_REF;
1838 goto again;
1839 }
1840 err = -EINVAL;
1841 }
1828 if (err < 0) { 1842 if (err < 0) {
1829 stac92xx_free(codec); 1843 stac92xx_free(codec);
1830 return err; 1844 return err;
@@ -1850,6 +1864,7 @@ static int patch_stac922x(struct hda_codec *codec)
1850 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, 1864 spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
1851 stac922x_models, 1865 stac922x_models,
1852 stac922x_cfg_tbl); 1866 stac922x_cfg_tbl);
1867 again:
1853 if (spec->board_config < 0) { 1868 if (spec->board_config < 0) {
1854 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " 1869 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, "
1855 "using BIOS defaults\n"); 1870 "using BIOS defaults\n");
@@ -1875,6 +1890,15 @@ static int patch_stac922x(struct hda_codec *codec)
1875 spec->multiout.dac_nids = spec->dac_nids; 1890 spec->multiout.dac_nids = spec->dac_nids;
1876 1891
1877 err = stac92xx_parse_auto_config(codec, 0x08, 0x09); 1892 err = stac92xx_parse_auto_config(codec, 0x08, 0x09);
1893 if (!err) {
1894 if (spec->board_config < 0) {
1895 printk(KERN_WARNING "hda_codec: No auto-config is "
1896 "available, default to model=ref\n");
1897 spec->board_config = STAC_D945_REF;
1898 goto again;
1899 }
1900 err = -EINVAL;
1901 }
1878 if (err < 0) { 1902 if (err < 0) {
1879 stac92xx_free(codec); 1903 stac92xx_free(codec);
1880 return err; 1904 return err;
@@ -1903,6 +1927,7 @@ static int patch_stac927x(struct hda_codec *codec)
1903 spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, 1927 spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS,
1904 stac927x_models, 1928 stac927x_models,
1905 stac927x_cfg_tbl); 1929 stac927x_cfg_tbl);
1930 again:
1906 if (spec->board_config < 0) { 1931 if (spec->board_config < 0) {
1907 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); 1932 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n");
1908 err = stac92xx_save_bios_config_regs(codec); 1933 err = stac92xx_save_bios_config_regs(codec);
@@ -1945,6 +1970,15 @@ static int patch_stac927x(struct hda_codec *codec)
1945 spec->multiout.dac_nids = spec->dac_nids; 1970 spec->multiout.dac_nids = spec->dac_nids;
1946 1971
1947 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); 1972 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20);
1973 if (!err) {
1974 if (spec->board_config < 0) {
1975 printk(KERN_WARNING "hda_codec: No auto-config is "
1976 "available, default to model=ref\n");
1977 spec->board_config = STAC_D965_REF;
1978 goto again;
1979 }
1980 err = -EINVAL;
1981 }
1948 if (err < 0) { 1982 if (err < 0) {
1949 stac92xx_free(codec); 1983 stac92xx_free(codec);
1950 return err; 1984 return err;
@@ -1970,6 +2004,7 @@ static int patch_stac9205(struct hda_codec *codec)
1970 spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS, 2004 spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS,
1971 stac9205_models, 2005 stac9205_models,
1972 stac9205_cfg_tbl); 2006 stac9205_cfg_tbl);
2007 again:
1973 if (spec->board_config < 0) { 2008 if (spec->board_config < 0) {
1974 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); 2009 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n");
1975 err = stac92xx_save_bios_config_regs(codec); 2010 err = stac92xx_save_bios_config_regs(codec);
@@ -2008,6 +2043,15 @@ static int patch_stac9205(struct hda_codec *codec)
2008 AC_VERB_SET_GPIO_MASK, 0x00000001); 2043 AC_VERB_SET_GPIO_MASK, 0x00000001);
2009 2044
2010 err = stac92xx_parse_auto_config(codec, 0x1f, 0x20); 2045 err = stac92xx_parse_auto_config(codec, 0x1f, 0x20);
2046 if (!err) {
2047 if (spec->board_config < 0) {
2048 printk(KERN_WARNING "hda_codec: No auto-config is "
2049 "available, default to model=ref\n");
2050 spec->board_config = STAC_9205_REF;
2051 goto again;
2052 }
2053 err = -EINVAL;
2054 }
2011 if (err < 0) { 2055 if (err < 0) {
2012 stac92xx_free(codec); 2056 stac92xx_free(codec);
2013 return err; 2057 return err;
diff --git a/sound/soc/at91/at91-i2s.c b/sound/soc/at91/at91-i2s.c
index fcc544a96ba3..9fc0c0388881 100644
--- a/sound/soc/at91/at91-i2s.c
+++ b/sound/soc/at91/at91-i2s.c
@@ -20,6 +20,8 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/atmel_pdc.h>
24
23#include <sound/driver.h> 25#include <sound/driver.h>
24#include <sound/core.h> 26#include <sound/core.h>
25#include <sound/pcm.h> 27#include <sound/pcm.h>
@@ -29,7 +31,6 @@
29#include <asm/arch/hardware.h> 31#include <asm/arch/hardware.h>
30#include <asm/arch/at91_pmc.h> 32#include <asm/arch/at91_pmc.h>
31#include <asm/arch/at91_ssc.h> 33#include <asm/arch/at91_ssc.h>
32#include <asm/arch/at91_pdc.h>
33 34
34#include "at91-pcm.h" 35#include "at91-pcm.h"
35#include "at91-i2s.h" 36#include "at91-i2s.h"
@@ -51,17 +52,17 @@
51 * SSC PDC registers required by the PCM DMA engine. 52 * SSC PDC registers required by the PCM DMA engine.
52 */ 53 */
53static struct at91_pdc_regs pdc_tx_reg = { 54static struct at91_pdc_regs pdc_tx_reg = {
54 .xpr = AT91_PDC_TPR, 55 .xpr = ATMEL_PDC_TPR,
55 .xcr = AT91_PDC_TCR, 56 .xcr = ATMEL_PDC_TCR,
56 .xnpr = AT91_PDC_TNPR, 57 .xnpr = ATMEL_PDC_TNPR,
57 .xncr = AT91_PDC_TNCR, 58 .xncr = ATMEL_PDC_TNCR,
58}; 59};
59 60
60static struct at91_pdc_regs pdc_rx_reg = { 61static struct at91_pdc_regs pdc_rx_reg = {
61 .xpr = AT91_PDC_RPR, 62 .xpr = ATMEL_PDC_RPR,
62 .xcr = AT91_PDC_RCR, 63 .xcr = ATMEL_PDC_RCR,
63 .xnpr = AT91_PDC_RNPR, 64 .xnpr = ATMEL_PDC_RNPR,
64 .xncr = AT91_PDC_RNCR, 65 .xncr = ATMEL_PDC_RNCR,
65}; 66};
66 67
67/* 68/*
@@ -72,8 +73,8 @@ static struct at91_ssc_mask ssc_tx_mask = {
72 .ssc_disable = AT91_SSC_TXDIS, 73 .ssc_disable = AT91_SSC_TXDIS,
73 .ssc_endx = AT91_SSC_ENDTX, 74 .ssc_endx = AT91_SSC_ENDTX,
74 .ssc_endbuf = AT91_SSC_TXBUFE, 75 .ssc_endbuf = AT91_SSC_TXBUFE,
75 .pdc_enable = AT91_PDC_TXTEN, 76 .pdc_enable = ATMEL_PDC_TXTEN,
76 .pdc_disable = AT91_PDC_TXTDIS, 77 .pdc_disable = ATMEL_PDC_TXTDIS,
77}; 78};
78 79
79static struct at91_ssc_mask ssc_rx_mask = { 80static struct at91_ssc_mask ssc_rx_mask = {
@@ -81,8 +82,8 @@ static struct at91_ssc_mask ssc_rx_mask = {
81 .ssc_disable = AT91_SSC_RXDIS, 82 .ssc_disable = AT91_SSC_RXDIS,
82 .ssc_endx = AT91_SSC_ENDRX, 83 .ssc_endx = AT91_SSC_ENDRX,
83 .ssc_endbuf = AT91_SSC_RXBUFF, 84 .ssc_endbuf = AT91_SSC_RXBUFF,
84 .pdc_enable = AT91_PDC_RXTEN, 85 .pdc_enable = ATMEL_PDC_RXTEN,
85 .pdc_disable = AT91_PDC_RXTDIS, 86 .pdc_disable = ATMEL_PDC_RXTDIS,
86}; 87};
87 88
88 89
@@ -508,14 +509,14 @@ static int at91_i2s_hw_params(struct snd_pcm_substream *substream,
508 /* Reset the SSC and its PDC registers */ 509 /* Reset the SSC and its PDC registers */
509 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST); 510 at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST);
510 511
511 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RPR, 0); 512 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RPR, 0);
512 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RCR, 0); 513 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RCR, 0);
513 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNPR, 0); 514 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNPR, 0);
514 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNCR, 0); 515 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNCR, 0);
515 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TPR, 0); 516 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TPR, 0);
516 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TCR, 0); 517 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TCR, 0);
517 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNPR, 0); 518 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNPR, 0);
518 at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNCR, 0); 519 at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNCR, 0);
519 520
520 if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt, 521 if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt,
521 0, ssc_p->name, ssc_p)) < 0) { 522 0, ssc_p->name, ssc_p)) < 0) {
diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c
index e88b12e7cc40..b39b95a47040 100644
--- a/sound/soc/at91/at91-pcm.c
+++ b/sound/soc/at91/at91-pcm.c
@@ -21,6 +21,7 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/atmel_pdc.h>
24 25
25#include <sound/driver.h> 26#include <sound/driver.h>
26#include <sound/core.h> 27#include <sound/core.h>
@@ -30,7 +31,6 @@
30 31
31#include <asm/arch/hardware.h> 32#include <asm/arch/hardware.h>
32#include <asm/arch/at91_ssc.h> 33#include <asm/arch/at91_ssc.h>
33#include <asm/arch/at91_pdc.h>
34 34
35#include "at91-pcm.h" 35#include "at91-pcm.h"
36 36
@@ -83,7 +83,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr,
83 params->name, ssc_sr, count); 83 params->name, ssc_sr, count);
84 84
85 /* re-start the PDC */ 85 /* re-start the PDC */
86 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); 86 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
87 87
88 prtd->period_ptr += prtd->period_size; 88 prtd->period_ptr += prtd->period_size;
89 if (prtd->period_ptr >= prtd->dma_buffer_end) { 89 if (prtd->period_ptr >= prtd->dma_buffer_end) {
@@ -94,7 +94,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr,
94 at91_ssc_write(params->ssc_base + params->pdc->xcr, 94 at91_ssc_write(params->ssc_base + params->pdc->xcr,
95 prtd->period_size / params->pdc_xfer_size); 95 prtd->period_size / params->pdc_xfer_size);
96 96
97 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); 97 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
98 } 98 }
99 99
100 if (ssc_sr & params->mask->ssc_endx) { 100 if (ssc_sr & params->mask->ssc_endx) {
@@ -143,7 +143,7 @@ static int at91_pcm_hw_free(struct snd_pcm_substream *substream)
143 struct at91_pcm_dma_params *params = prtd->params; 143 struct at91_pcm_dma_params *params = prtd->params;
144 144
145 if (params != NULL) { 145 if (params != NULL) {
146 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); 146 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
147 prtd->params->dma_intr_handler = NULL; 147 prtd->params->dma_intr_handler = NULL;
148 } 148 }
149 149
@@ -158,7 +158,7 @@ static int at91_pcm_prepare(struct snd_pcm_substream *substream)
158 at91_ssc_write(params->ssc_base + AT91_SSC_IDR, 158 at91_ssc_write(params->ssc_base + AT91_SSC_IDR,
159 params->mask->ssc_endx | params->mask->ssc_endbuf); 159 params->mask->ssc_endx | params->mask->ssc_endbuf);
160 160
161 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); 161 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
162 return 0; 162 return 0;
163} 163}
164 164
@@ -192,7 +192,7 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream,
192 at91_ssc_write(params->ssc_base + AT91_SSC_IER, 192 at91_ssc_write(params->ssc_base + AT91_SSC_IER,
193 params->mask->ssc_endx | params->mask->ssc_endbuf); 193 params->mask->ssc_endx | params->mask->ssc_endbuf);
194 194
195 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); 195 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
196 196
197 DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), 197 DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR),
198 at91_ssc_read(params->ssc_base + AT91_SSC_IER)); 198 at91_ssc_read(params->ssc_base + AT91_SSC_IER));
@@ -201,12 +201,12 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream,
201 case SNDRV_PCM_TRIGGER_STOP: 201 case SNDRV_PCM_TRIGGER_STOP:
202 case SNDRV_PCM_TRIGGER_SUSPEND: 202 case SNDRV_PCM_TRIGGER_SUSPEND:
203 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 203 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
204 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); 204 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
205 break; 205 break;
206 206
207 case SNDRV_PCM_TRIGGER_RESUME: 207 case SNDRV_PCM_TRIGGER_RESUME:
208 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 208 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
209 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); 209 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
210 break; 210 break;
211 211
212 default: 212 default:
@@ -379,7 +379,7 @@ static int at91_pcm_suspend(struct platform_device *pdev,
379 379
380 /* disable the PDC and save the PDC registers */ 380 /* disable the PDC and save the PDC registers */
381 381
382 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); 382 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
383 383
384 prtd->pdc_xpr_save = at91_ssc_read(params->ssc_base + params->pdc->xpr); 384 prtd->pdc_xpr_save = at91_ssc_read(params->ssc_base + params->pdc->xpr);
385 prtd->pdc_xcr_save = at91_ssc_read(params->ssc_base + params->pdc->xcr); 385 prtd->pdc_xcr_save = at91_ssc_read(params->ssc_base + params->pdc->xcr);
@@ -408,7 +408,7 @@ static int at91_pcm_resume(struct platform_device *pdev,
408 at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save); 408 at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save);
409 at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save); 409 at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save);
410 410
411 at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); 411 at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
412 return 0; 412 return 0;
413} 413}
414#else 414#else
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 78ac2688e124..ec2a2787957a 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1,15 +1,15 @@
1config SND_SOC_AC97_CODEC 1config SND_SOC_AC97_CODEC
2 tristate 2 tristate
3 depends SND_SOC 3 depends on SND_SOC
4 4
5config SND_SOC_WM8731 5config SND_SOC_WM8731
6 tristate 6 tristate
7 depends SND_SOC 7 depends on SND_SOC
8 8
9config SND_SOC_WM8750 9config SND_SOC_WM8750
10 tristate 10 tristate
11 depends SND_SOC 11 depends on SND_SOC
12 12
13config SND_SOC_WM9712 13config SND_SOC_WM9712
14 tristate 14 tristate
15 depends SND_SOC 15 depends on SND_SOC
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c
index 573e3701c14f..ebcac13fd397 100644
--- a/sound/synth/emux/emux.c
+++ b/sound/synth/emux/emux.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/sched.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <linux/string.h> 24#include <linux/string.h>
26#include <sound/core.h> 25#include <sound/core.h>
diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c
index 59144ec026e4..680f2b7fec20 100644
--- a/sound/synth/emux/emux_proc.c
+++ b/sound/synth/emux/emux_proc.c
@@ -20,7 +20,6 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/sched.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <sound/core.h> 24#include <sound/core.h>
26#include <sound/emux_synth.h> 25#include <sound/emux_synth.h>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 4dfb91d4398a..b6d886373bb0 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -325,16 +325,6 @@ static int prepare_capture_urb(struct snd_usb_substream *subs,
325 } 325 }
326 urb->transfer_buffer_length = offs; 326 urb->transfer_buffer_length = offs;
327 urb->number_of_packets = ctx->packets; 327 urb->number_of_packets = ctx->packets;
328#if 0 // for check
329 if (! urb->bandwidth) {
330 int bustime;
331 bustime = usb_check_bandwidth(urb->dev, urb);
332 if (bustime < 0)
333 return bustime;
334 printk("urb %d: bandwidth = %d (packets = %d)\n", ctx->index, bustime, urb->number_of_packets);
335 usb_claim_bandwidth(urb->dev, urb, bustime, 1);
336 }
337#endif // for check
338 return 0; 328 return 0;
339} 329}
340 330
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 25b4ab4f61e7..858262068f4f 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -948,6 +948,29 @@ YAMAHA_DEVICE(0x7010, "UB99"),
948}, 948},
949 /* TODO: add Edirol M-100FX support */ 949 /* TODO: add Edirol M-100FX support */
950{ 950{
951 /* has ID 0x004e when not in "Advanced Driver" mode */
952 USB_DEVICE(0x0582, 0x004c),
953 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
954 .vendor_name = "EDIROL",
955 .product_name = "PCR-A",
956 .ifnum = QUIRK_ANY_INTERFACE,
957 .type = QUIRK_COMPOSITE,
958 .data = (const struct snd_usb_audio_quirk[]) {
959 {
960 .ifnum = 1,
961 .type = QUIRK_AUDIO_STANDARD_INTERFACE
962 },
963 {
964 .ifnum = 2,
965 .type = QUIRK_AUDIO_STANDARD_INTERFACE
966 },
967 {
968 .ifnum = -1
969 }
970 }
971 }
972},
973{
951 /* has ID 0x004f when not in "Advanced Driver" mode */ 974 /* has ID 0x004f when not in "Advanced Driver" mode */
952 USB_DEVICE(0x0582, 0x004d), 975 USB_DEVICE(0x0582, 0x004d),
953 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 976 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {