diff options
Diffstat (limited to 'sound')
53 files changed, 424 insertions, 300 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index dede954b2c6..28db4be7a16 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) #define pxa2xx_ac97_resume NULL #endif -static int pxa2xx_ac97_probe(struct platform_device *dev) +static int __devinit pxa2xx_ac97_probe(struct platform_device *dev) { struct snd_card *card; struct snd_ac97_bus *ac97_bus; @@ -369,7 +369,7 @@ static int pxa2xx_ac97_probe(struct platform_device *dev) return ret; } -static int pxa2xx_ac97_remove(struct platform_device *dev) +static int __devexit pxa2xx_ac97_remove(struct platform_device *dev) { struct snd_card *card = platform_get_drvdata(dev); @@ -386,7 +386,7 @@ static int pxa2xx_ac97_remove(struct platform_device *dev) static struct platform_driver pxa2xx_ac97_driver = { .probe = pxa2xx_ac97_probe, - .remove = pxa2xx_ac97_remove, + .remove = __devexit_p(pxa2xx_ac97_remove), .suspend = pxa2xx_ac97_suspend, .resume = pxa2xx_ac97_resume, .driver = { diff --git a/sound/core/misc.c b/sound/core/misc.c index 6db86a7c970..f78cd000e88 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c @@ -21,7 +21,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <linux/time.h> #include <linux/ioport.h> #include <sound/core.h> diff --git a/sound/core/seq/instr/ainstr_fm.c b/sound/core/seq/instr/ainstr_fm.c index b09babf272c..f80fab8f2ed 100644 --- a/sound/core/seq/instr/ainstr_fm.c +++ b/sound/core/seq/instr/ainstr_fm.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <sound/core.h> #include <sound/ainstr_fm.h> #include <sound/initval.h> diff --git a/sound/core/seq/instr/ainstr_gf1.c b/sound/core/seq/instr/ainstr_gf1.c index 3c31038a74b..c640e1cf854 100644 --- a/sound/core/seq/instr/ainstr_gf1.c +++ b/sound/core/seq/instr/ainstr_gf1.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/ainstr_gf1.h> diff --git a/sound/core/seq/instr/ainstr_iw.c b/sound/core/seq/instr/ainstr_iw.c index 7f8df19ba56..5367baee2d0 100644 --- a/sound/core/seq/instr/ainstr_iw.c +++ b/sound/core/seq/instr/ainstr_iw.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/ainstr_iw.h> diff --git a/sound/core/seq/instr/ainstr_simple.c b/sound/core/seq/instr/ainstr_simple.c index 6d6ffece7cb..ac717bef9d7 100644 --- a/sound/core/seq/instr/ainstr_simple.c +++ b/sound/core/seq/instr/ainstr_simple.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/ainstr_simple.h> diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index 972f9340536..061a7c61402 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -38,7 +38,6 @@ #include <sound/driver.h> #include <linux/init.h> #include <linux/wait.h> -#include <linux/sched.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/rawmidi.h> diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 8339bad969b..a0f28f51fc7 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 = { .pointer = snd_card_dummy_pcm_pointer, }; -static int __init snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams) +static int __devinit snd_card_dummy_pcm(struct snd_dummy *dummy, int device, + int substreams) { struct snd_pcm *pcm; int err; @@ -562,7 +563,7 @@ DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD), DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD) }; -static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy) +static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy) { struct snd_card *card = dummy->card; unsigned int idx; @@ -579,7 +580,7 @@ static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy) return 0; } -static int __init snd_dummy_probe(struct platform_device *devptr) +static int __devinit snd_dummy_probe(struct platform_device *devptr) { struct snd_card *card; struct snd_dummy *dummy; @@ -617,7 +618,7 @@ static int __init snd_dummy_probe(struct platform_device *devptr) return err; } -static int snd_dummy_remove(struct platform_device *devptr) +static int __devexit snd_dummy_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -648,7 +649,7 @@ static int snd_dummy_resume(struct platform_device *pdev) static struct platform_driver snd_dummy_driver = { .probe = snd_dummy_probe, - .remove = snd_dummy_remove, + .remove = __devexit_p(snd_dummy_remove), #ifdef CONFIG_PM .suspend = snd_dummy_suspend, .resume = snd_dummy_resume, diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index a9ff391258e..40eb026c86e 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) /* * get ISA resources */ -static int __init snd_mtpav_get_ISA(struct mtpav * mcard) +static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard) { if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { snd_printk("MTVAP port 0x%lx is busy\n", port); @@ -619,7 +619,7 @@ static struct snd_rawmidi_ops snd_mtpav_input = { * get RAWMIDI resources */ -static void __init snd_mtpav_set_name(struct mtpav *chip, +static void __devinit snd_mtpav_set_name(struct mtpav *chip, struct snd_rawmidi_substream *substream) { if (substream->number >= 0 && substream->number < chip->num_ports) @@ -634,7 +634,7 @@ static void __init snd_mtpav_set_name(struct mtpav *chip, strcpy(substream->name, "MTP broadcast"); } -static int __init snd_mtpav_get_RAWMIDI(struct mtpav *mcard) +static int __devinit snd_mtpav_get_RAWMIDI(struct mtpav *mcard) { int rval; struct snd_rawmidi *rawmidi; @@ -691,7 +691,7 @@ static void snd_mtpav_free(struct snd_card *card) /* */ -static int __init snd_mtpav_probe(struct platform_device *dev) +static int __devinit snd_mtpav_probe(struct platform_device *dev) { struct snd_card *card; int err; @@ -745,7 +745,7 @@ static int __init snd_mtpav_probe(struct platform_device *dev) return err; } -static int snd_mtpav_remove(struct platform_device *devptr) +static int __devexit snd_mtpav_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -756,7 +756,7 @@ static int snd_mtpav_remove(struct platform_device *devptr) static struct platform_driver snd_mtpav_driver = { .probe = snd_mtpav_probe, - .remove = snd_mtpav_remove, + .remove = __devexit_p(snd_mtpav_remove), .driver = { .name = SND_MTPAV_DRIVER }, diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 5327c6f841f..6c9f4c9bfeb 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -1026,7 +1026,7 @@ __err: return err; } -static int snd_mts64_remove(struct platform_device *pdev) +static int __devexit snd_mts64_remove(struct platform_device *pdev) { struct snd_card *card = platform_get_drvdata(pdev); @@ -1039,7 +1039,7 @@ static int snd_mts64_remove(struct platform_device *pdev) static struct platform_driver snd_mts64_driver = { .probe = snd_mts64_probe, - .remove = snd_mts64_remove, + .remove = __devexit_p(snd_mts64_remove), .driver = { .name = PLATFORM_DRIVER } @@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_driver = { /********************************************************************* * module init stuff *********************************************************************/ -static void snd_mts64_unregister_all(void) +static void __init_or_module snd_mts64_unregister_all(void) { int i; diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 6c48772aaef..b2d0ba4bd18 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -811,7 +811,7 @@ __err: return err; } -static int snd_portman_remove(struct platform_device *pdev) +static int __devexit snd_portman_remove(struct platform_device *pdev) { struct snd_card *card = platform_get_drvdata(pdev); @@ -824,7 +824,7 @@ static int snd_portman_remove(struct platform_device *pdev) static struct platform_driver snd_portman_driver = { .probe = snd_portman_probe, - .remove = snd_portman_remove, + .remove = __devexit_p(snd_portman_remove), .driver = { .name = PLATFORM_DRIVER } @@ -833,7 +833,7 @@ static struct platform_driver snd_portman_driver = { /********************************************************************* * module init stuff *********************************************************************/ -static void snd_portman_unregister_all(void) +static void __init_or_module snd_portman_unregister_all(void) { int i; diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 3a86a582072..838a4277929 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) * return 0 if found * return negative error if not found */ -static int __init snd_uart16550_detect(struct snd_uart16550 *uart) +static int __devinit snd_uart16550_detect(struct snd_uart16550 *uart) { unsigned long io_base = uart->base; int ok; @@ -781,7 +781,7 @@ static int snd_uart16550_dev_free(struct snd_device *device) return snd_uart16550_free(uart); } -static int __init snd_uart16550_create(struct snd_card *card, +static int __devinit snd_uart16550_create(struct snd_card *card, unsigned long iobase, int irq, unsigned int speed, @@ -860,7 +860,7 @@ static int __init snd_uart16550_create(struct snd_card *card, return 0; } -static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream) +static void __devinit snd_uart16550_substreams(struct snd_rawmidi_str *stream) { struct snd_rawmidi_substream *substream; @@ -869,7 +869,7 @@ static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream) } } -static int __init snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, +static int __devinit snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, int outs, int ins, struct snd_rawmidi **rmidi) { @@ -896,7 +896,7 @@ static int __init snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, return 0; } -static int __init snd_serial_probe(struct platform_device *devptr) +static int __devinit snd_serial_probe(struct platform_device *devptr) { struct snd_card *card; struct snd_uart16550 *uart; @@ -981,7 +981,7 @@ static int __init snd_serial_probe(struct platform_device *devptr) return err; } -static int snd_serial_remove(struct platform_device *devptr) +static int __devexit snd_serial_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -992,7 +992,7 @@ static int snd_serial_remove(struct platform_device *devptr) static struct platform_driver snd_serial_driver = { .probe = snd_serial_probe, - .remove = snd_serial_remove, + .remove = __devexit_p( snd_serial_remove), .driver = { .name = SND_SERIAL_DRIVER }, diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 59171f8200d..46f3d348606 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c @@ -44,7 +44,6 @@ #include <sound/driver.h> #include <linux/init.h> #include <linux/wait.h> -#include <linux/sched.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/moduleparam.h> @@ -85,7 +84,7 @@ struct snd_card_virmidi { static struct platform_device *devices[SNDRV_CARDS]; -static int __init snd_virmidi_probe(struct platform_device *devptr) +static int __devinit snd_virmidi_probe(struct platform_device *devptr) { struct snd_card *card; struct snd_card_virmidi *vmidi; @@ -129,7 +128,7 @@ static int __init snd_virmidi_probe(struct platform_device *devptr) return err; } -static int snd_virmidi_remove(struct platform_device *devptr) +static int __devexit snd_virmidi_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -140,7 +139,7 @@ static int snd_virmidi_remove(struct platform_device *devptr) static struct platform_driver snd_virmidi_driver = { .probe = snd_virmidi_probe, - .remove = snd_virmidi_remove, + .remove = __devexit_p(snd_virmidi_remove), .driver = { .name = SND_VIRMIDI_DRIVER }, diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 99908e44124..74e501dea8b 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 static struct platform_device *devices[SNDRV_CARDS]; -static int __init snd_ad1848_probe(struct platform_device *pdev) +static int __devinit snd_ad1848_probe(struct platform_device *pdev) { int dev = pdev->id; struct snd_card *card; diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index d1f6dfcec46..c09a8009d2f 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) return 0; } -static int snd_cmi8330_nonpnp_remove(struct platform_device *devptr) +static int __devexit snd_cmi8330_nonpnp_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -597,7 +597,7 @@ static int snd_cmi8330_nonpnp_resume(struct platform_device *dev) static struct platform_driver snd_cmi8330_driver = { .probe = snd_cmi8330_nonpnp_probe, - .remove = snd_cmi8330_nonpnp_remove, + .remove = __devexit_p(snd_cmi8330_nonpnp_remove), #ifdef CONFIG_PM .suspend = snd_cmi8330_nonpnp_suspend, .resume = snd_cmi8330_nonpnp_resume, diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c index c20a4b1b153..ce57d526f7b 100644 --- a/sound/isa/dt019x.c +++ b/sound/isa/dt019x.c @@ -23,7 +23,6 @@ #include <sound/driver.h> #include <linux/init.h> -#include <linux/sched.h> #include <linux/wait.h> #include <linux/pnp.h> #include <linux/moduleparam.h> diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index 7f29f56e405..65f97ff4eef 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c @@ -73,7 +73,7 @@ static struct platform_device *devices[SNDRV_CARDS]; #define PFX "es1688: " -static int __init snd_es1688_probe(struct platform_device *pdev) +static int __devinit snd_es1688_probe(struct platform_device *pdev) { int dev = pdev->id; static int possible_irqs[] = {5, 9, 10, 7, -1}; @@ -171,7 +171,7 @@ static int __init snd_es1688_probe(struct platform_device *pdev) return err; } -static int snd_es1688_remove(struct platform_device *devptr) +static int __devexit snd_es1688_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -182,7 +182,7 @@ static int snd_es1688_remove(struct platform_device *devptr) static struct platform_driver snd_es1688_driver = { .probe = snd_es1688_probe, - .remove = snd_es1688_remove, + .remove = __devexit_p(snd_es1688_remove), /* FIXME: suspend/resume */ .driver = { .name = ES1688_DRIVER diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 37057a37dc3..0395e2e0dd0 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c @@ -76,7 +76,7 @@ static struct platform_device *devices[SNDRV_CARDS]; #define PFX "gusclassic: " -static int __init snd_gusclassic_detect(struct snd_gus_card * gus) +static int __devinit snd_gusclassic_detect(struct snd_gus_card * gus) { unsigned char d; @@ -95,7 +95,7 @@ static int __init snd_gusclassic_detect(struct snd_gus_card * gus) return 0; } -static void __init snd_gusclassic_init(int dev, struct snd_gus_card * gus) +static void __devinit snd_gusclassic_init(int dev, struct snd_gus_card * gus) { gus->equal_irq = 0; gus->codec_flag = 0; @@ -103,7 +103,7 @@ static void __init snd_gusclassic_init(int dev, struct snd_gus_card * gus) gus->joystick_dac = joystick_dac[dev]; } -static int __init snd_gusclassic_probe(struct platform_device *pdev) +static int __devinit snd_gusclassic_probe(struct platform_device *pdev) { int dev = pdev->id; 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) return err; } -static int snd_gusclassic_remove(struct platform_device *devptr) +static int __devexit snd_gusclassic_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -222,7 +222,7 @@ static int snd_gusclassic_remove(struct platform_device *devptr) static struct platform_driver snd_gusclassic_driver = { .probe = snd_gusclassic_probe, - .remove = snd_gusclassic_remove, + .remove = __devexit_p(snd_gusclassic_remove), /* FIXME: suspend/resume */ .driver = { .name = GUSCLASSIC_DRIVER diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 532c56e35ca..4f55fc3e66c 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c @@ -92,7 +92,7 @@ static struct platform_device *devices[SNDRV_CARDS]; #define PFX "gusextreme: " -static int __init snd_gusextreme_detect(int dev, +static int __devinit snd_gusextreme_detect(int dev, struct snd_card *card, struct snd_gus_card * gus, struct snd_es1688 *es1688) @@ -142,12 +142,12 @@ static int __init snd_gusextreme_detect(int dev, return 0; } -static void __init snd_gusextreme_init(int dev, struct snd_gus_card * gus) +static void __devinit snd_gusextreme_init(int dev, struct snd_gus_card * gus) { gus->joystick_dac = joystick_dac[dev]; } -static int __init snd_gusextreme_mixer(struct snd_es1688 *chip) +static int __devinit snd_gusextreme_mixer(struct snd_es1688 *chip) { struct snd_card *card = chip->card; struct snd_ctl_elem_id id1, id2; @@ -169,7 +169,7 @@ static int __init snd_gusextreme_mixer(struct snd_es1688 *chip) return 0; } -static int __init snd_gusextreme_probe(struct platform_device *pdev) +static int __devinit snd_gusextreme_probe(struct platform_device *pdev) { int dev = pdev->id; static int possible_ess_irqs[] = {5, 9, 10, 7, -1}; @@ -321,7 +321,7 @@ static int __init snd_gusextreme_probe(struct platform_device *pdev) return err; } -static int snd_gusextreme_remove(struct platform_device *devptr) +static int __devexit snd_gusextreme_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -332,7 +332,7 @@ static int snd_gusextreme_remove(struct platform_device *devptr) static struct platform_driver snd_gusextreme_driver = { .probe = snd_gusextreme_probe, - .remove = snd_gusextreme_remove, + .remove = __devexit_p(snd_gusextreme_remove), /* FIXME: suspend/resume */ .driver = { .name = GUSEXTREME_DRIVER diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index c1c69e3cbfd..d1ad90ca035 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c @@ -85,7 +85,7 @@ struct snd_gusmax { #define PFX "gusmax: " -static int __init snd_gusmax_detect(struct snd_gus_card * gus) +static int __devinit snd_gusmax_detect(struct snd_gus_card * gus) { unsigned char d; @@ -127,7 +127,8 @@ static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id) return IRQ_RETVAL(handled); } -static void __init snd_gusmax_init(int dev, struct snd_card *card, struct snd_gus_card * gus) +static void __devinit snd_gusmax_init(int dev, struct snd_card *card, + struct snd_gus_card * gus) { gus->equal_irq = 1; gus->codec_flag = 1; @@ -145,7 +146,7 @@ static void __init snd_gusmax_init(int dev, struct snd_card *card, struct snd_gu #define CS4231_PRIVATE( left, right, shift, mute ) \ ((left << 24)|(right << 16)|(shift<<8)|mute) -static int __init snd_gusmax_mixer(struct snd_cs4231 *chip) +static int __devinit snd_gusmax_mixer(struct snd_cs4231 *chip) { struct snd_card *card = chip->card; struct snd_ctl_elem_id id1, id2; @@ -204,7 +205,7 @@ static void snd_gusmax_free(struct snd_card *card) free_irq(maxcard->irq, (void *)maxcard); } -static int __init snd_gusmax_probe(struct platform_device *pdev) +static int __devinit snd_gusmax_probe(struct platform_device *pdev) { int dev = pdev->id; 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) return err; } -static int snd_gusmax_remove(struct platform_device *devptr) +static int __devexit snd_gusmax_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -359,7 +360,7 @@ static int snd_gusmax_remove(struct platform_device *devptr) static struct platform_driver snd_gusmax_driver = { .probe = snd_gusmax_probe, - .remove = snd_gusmax_remove, + .remove = __devexit_p(snd_gusmax_remove), /* FIXME: suspend/resume */ .driver = { .name = GUSMAX_DRIVER diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 1e30713d2ca..f3db686b1c0 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) return 0; } -static int snd_opl3sa2_nonpnp_remove(struct platform_device *devptr) +static int __devexit snd_opl3sa2_nonpnp_remove(struct platform_device *devptr) { snd_card_free(platform_get_drvdata(devptr)); platform_set_drvdata(devptr, NULL); @@ -942,7 +942,7 @@ static int snd_opl3sa2_nonpnp_resume(struct platform_device *dev) static struct platform_driver snd_opl3sa2_nonpnp_driver = { .probe = snd_opl3sa2_nonpnp_probe, - .remove = snd_opl3sa2_nonpnp_remove, + .remove = __devexit( snd_opl3sa2_nonpnp_remove), #ifdef CONFIG_PM .suspend = snd_opl3sa2_nonpnp_suspend, .resume = snd_opl3sa2_nonpnp_resume, diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index 268ebd34703..be1e83e6dea 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) release_and_free_resource(acard->fm_res); } -static int __init snd_sb8_probe(struct platform_device *pdev) +static int __devinit snd_sb8_probe(struct platform_device *pdev) { int dev = pdev->id; struct snd_sb *chip; @@ -193,7 +193,7 @@ static int __init snd_sb8_probe(struct platform_device *pdev) return err; } -static int snd_sb8_remove(struct platform_device *pdev) +static int __devexit snd_sb8_remove(struct platform_device *pdev) { snd_card_free(platform_get_drvdata(pdev)); platform_set_drvdata(pdev, NULL); @@ -230,7 +230,7 @@ static int snd_sb8_resume(struct platform_device *dev) static struct platform_driver snd_sb8_driver = { .probe = snd_sb8_probe, - .remove = snd_sb8_remove, + .remove = __devexit_p(snd_sb8_remove), #ifdef CONFIG_PM .suspend = snd_sb8_suspend, .resume = snd_sb8_resume, diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c index 602db497929..fef56cac06c 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) struct ac97_codec *ac97_alloc_codec(void) { - struct ac97_codec *codec = kmalloc(sizeof(struct ac97_codec), GFP_KERNEL); + struct ac97_codec *codec = kzalloc(sizeof(struct ac97_codec), GFP_KERNEL); if(!codec) return NULL; - memset(codec, 0, sizeof(*codec)); spin_lock_init(&codec->lock); INIT_LIST_HEAD(&codec->list); return codec; diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c index f0724327493..c0730a3563a 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) struct dmabuf *dmabuf; int i; - if ((dev = kmalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL) + if ((dev = kzalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL) return NULL; - memset(dev, 0, sizeof(ad1889_dev_t)); spin_lock_init(&dev->lock); dev->pci = pci; diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c index f845528e1fa..f813ae9c213 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, return -EBUSY; } - bta = kmalloc(sizeof(*bta),GFP_ATOMIC); + bta = kzalloc(sizeof(*bta),GFP_ATOMIC); if (!bta) { rc = -ENOMEM; goto fail0; } - memset(bta,0,sizeof(*bta)); bta->pci = pci_dev; bta->irq = pci_dev->irq; diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 147c8a95113..2a1f0d9ac96 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) CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") ); if (card->states[0] == NULL) { state = card->states[0] = - kmalloc(sizeof(struct cs_state), GFP_KERNEL); + kzalloc(sizeof(struct cs_state), GFP_KERNEL); if (state == NULL) return -ENOMEM; - memset(state, 0, sizeof(struct cs_state)); mutex_init(&state->sem); dmabuf = &state->dmabuf; dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); @@ -3114,10 +3113,9 @@ static int cs_open(struct inode *inode, struct file *file) CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") ); if (card->states[1] == NULL) { state = card->states[1] = - kmalloc(sizeof(struct cs_state), GFP_KERNEL); + kzalloc(sizeof(struct cs_state), GFP_KERNEL); if (state == NULL) return -ENOMEM; - memset(state, 0, sizeof(struct cs_state)); mutex_init(&state->sem); dmabuf = &state->dmabuf; dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); @@ -5075,11 +5073,10 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev, pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor); pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card); - if ((card = kmalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { + if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) { printk(KERN_ERR "cs46xx: out of memory\n"); return -ENOMEM; } - memset(card, 0, sizeof(*card)); card->ba0_addr = RSRCADDRESS(pci_dev, 0); card->ba1_addr = RSRCADDRESS(pci_dev, 1); card->pci_dev = pci_dev; diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c index 7360d8954d6..0f0d03a55da 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) struct i2c_client *new_client; int rc = -ENODEV; - new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); + new_client = kzalloc(sizeof(*new_client), GFP_KERNEL); if (!new_client) return -ENOMEM; - memset(new_client, 0, sizeof(*new_client)); new_client->addr = address; new_client->adapter = adapter; diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c index 2f21a3c0037..4b7dbdd2a43 100644 --- a/sound/oss/dmasound/tas3001c.c +++ b/sound/oss/dmasound/tas3001c.c @@ -807,10 +807,9 @@ tas3001c_init(struct i2c_client *client) size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t)); int i, j; - self = kmalloc(sz, GFP_KERNEL); + self = kzalloc(sz, GFP_KERNEL); if (!self) return -ENOMEM; - memset(self, 0, sz); self->super.client = client; self->super.shadow = (tas_shadow_t *)(self+1); diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c index af34fb39bc2..678bf0ff6da 100644 --- a/sound/oss/dmasound/tas3004.c +++ b/sound/oss/dmasound/tas3004.c @@ -1092,10 +1092,9 @@ tas3004_init(struct i2c_client *client) char mcr2 = 0; int i, j; - self = kmalloc(sz, GFP_KERNEL); + self = kzalloc(sz, GFP_KERNEL); if (!self) return -ENOMEM; - memset(self, 0, sz); self->super.client = client; 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 882ae98a41b..665e85b5562 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) return -ENODEV; } - new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); + new_client = kzalloc(sizeof(*new_client), GFP_KERNEL); if (!new_client) return -ENOMEM; - memset(new_client, 0, sizeof(*new_client)); new_client->addr = address; new_client->adapter = adapter; diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c index 6c59df7b000..16ac02540a3 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) { int ret; - card->mpuout = kmalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); + card->mpuout = kzalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL); if (card->mpuout == NULL) { printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n"); ret = -ENOMEM; goto err_out1; } - memset(card->mpuout, 0, sizeof(struct emu10k1_mpuout)); - card->mpuout->intr = 1; card->mpuout->status = FLAGS_AVAILABLE; card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT; @@ -472,15 +470,13 @@ static int __devinit emu10k1_midi_init(struct emu10k1_card *card) spin_lock_init(&card->mpuout->lock); - card->mpuin = kmalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); + card->mpuin = kzalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL); if (card->mpuin == NULL) { printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n"); ret = -ENOMEM; goto err_out2; } - memset(card->mpuin, 0, sizeof(struct emu10k1_mpuin)); - card->mpuin->status = FLAGS_AVAILABLE; 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 pci_set_master(pci_dev); - if ((card = kmalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { + if ((card = kzalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) { printk(KERN_ERR "emu10k1: out of memory\n"); return -ENOMEM; } - memset(card, 0, sizeof(struct emu10k1_card)); card->iobase = pci_resource_start(pci_dev, 0); card->length = pci_resource_len(pci_dev, 0); diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index e1fbcca8e72..974dd732b14 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 printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n"); return i; } - if (!(s = kmalloc(sizeof(struct es1371_state), GFP_KERNEL))) { + if (!(s = kzalloc(sizeof(struct es1371_state), GFP_KERNEL))) { printk(KERN_WARNING PFX "out of memory\n"); return -ENOMEM; } - memset(s, 0, sizeof(struct es1371_state)); s->codec = ac97_alloc_codec(); if(s->codec == NULL) diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c index 80a42773c64..a94b9df489d 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) int ret = 0; struct hal2_card *hal2; - hal2 = kmalloc(sizeof(struct hal2_card), GFP_KERNEL); + hal2 = kzalloc(sizeof(struct hal2_card), GFP_KERNEL); if (!hal2) return -ENOMEM; - memset(hal2, 0, sizeof(struct hal2_card)); hal2->ctl_regs = (struct hal2_ctl_regs *)hpc3->pbus_extregs[0]; 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 c3c8a720d55..f5e31f11973 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) for (i = 0; i < NR_HW_CH && card && !card->initializing; i++) { if (card->states[i] == NULL) { state = card->states[i] = (struct i810_state *) - kmalloc(sizeof(struct i810_state), GFP_KERNEL); + kzalloc(sizeof(struct i810_state), GFP_KERNEL); if (state == NULL) return -ENOMEM; - memset(state, 0, sizeof(struct i810_state)); dmabuf = &state->dmabuf; goto found_virt; } @@ -3205,10 +3204,9 @@ static void __devinit i810_configure_clocking (void) */ if(card != NULL) { state = card->states[0] = (struct i810_state *) - kmalloc(sizeof(struct i810_state), GFP_KERNEL); + kzalloc(sizeof(struct i810_state), GFP_KERNEL); if (state == NULL) return; - memset(state, 0, sizeof(struct i810_state)); dmabuf = &state->dmabuf; 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 return -ENODEV; } - if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) { + if ((card = kzalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) { printk(KERN_ERR "i810_audio: out of memory\n"); return -ENOMEM; } - memset(card, 0, sizeof(*card)); card->initializing = 1; card->pci_dev = pci_dev; diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c index 12e7b3038be..dfe670f12e6 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 printk(KERN_INFO "kahlua: XpressAudio on IRQ %d, DMA %d, %d\n", irq, dma8, dma16); - hw_config = kmalloc(sizeof(struct address_info), GFP_KERNEL); + hw_config = kzalloc(sizeof(struct address_info), GFP_KERNEL); if(hw_config == NULL) { printk(KERN_ERR "kahlua: out of memory.\n"); return 1; } - memset(hw_config, 0, sizeof(*hw_config)); pci_set_drvdata(pdev, hw_config); diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c index d459bdb1415..27b4ba3aaa7 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, if (pcidev->irq == 0) return -1; - if (!(s = kmalloc(sizeof(struct vrc5477_ac97_state), GFP_KERNEL))) { + if (!(s = kzalloc(sizeof(struct vrc5477_ac97_state), GFP_KERNEL))) { printk(KERN_ERR PFX "alloc of device struct failed\n"); return -1; } - memset(s, 0, sizeof(struct vrc5477_ac97_state)); init_waitqueue_head(&s->dma_adc.wait); init_waitqueue_head(&s->dma_dac.wait); diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index 2e8cfa5481f..fc273e55094 100644 --- a/sound/oss/opl3.c +++ b/sound/oss/opl3.c @@ -166,7 +166,7 @@ int opl3_detect(int ioaddr, int *osp) return 0; } - devc = kmalloc(sizeof(*devc), GFP_KERNEL); + devc = kzalloc(sizeof(*devc), GFP_KERNEL); if (devc == NULL) { @@ -175,7 +175,6 @@ int opl3_detect(int ioaddr, int *osp) return 0; } - memset(devc, 0, sizeof(*devc)); strcpy(devc->fm_info.name, "OPL2"); if (!request_region(ioaddr, 4, devc->fm_info.name)) { diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c index 8666291c005..27acd6f29b9 100644 --- a/sound/oss/sb_card.c +++ b/sound/oss/sb_card.c @@ -137,11 +137,10 @@ static int __init sb_init_legacy(void) { struct sb_module_options sbmo = {0}; - if((legacy = kmalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { + if((legacy = kzalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { printk(KERN_ERR "sb: Error: Could not allocate memory\n"); return -ENOMEM; } - memset(legacy, 0, sizeof(struct sb_card_config)); legacy->conf.io_base = io; legacy->conf.irq = irq; @@ -247,11 +246,10 @@ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device return -EBUSY; } - if((scc = kmalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { + if((scc = kzalloc(sizeof(struct sb_card_config), GFP_KERNEL)) == NULL) { printk(KERN_ERR "sb: Error: Could not allocate memory\n"); return -ENOMEM; } - memset(scc, 0, sizeof(struct sb_card_config)); printk(KERN_INFO "sb: PnP: Found Card Named = \"%s\", Card PnP id = " \ "%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 9f7e5f59ac8..016b918329a 100644 --- a/sound/oss/swarm_cs4297a.c +++ b/sound/oss/swarm_cs4297a.c @@ -616,25 +616,23 @@ static int init_serdma(serdma_t *dma) /* Descriptors */ dma->ringsz = DMA_DESCR; - dma->descrtab = kmalloc(dma->ringsz * sizeof(serdma_descr_t), GFP_KERNEL); + dma->descrtab = kzalloc(dma->ringsz * sizeof(serdma_descr_t), GFP_KERNEL); if (!dma->descrtab) { - printk(KERN_ERR "cs4297a: kmalloc descrtab failed\n"); + printk(KERN_ERR "cs4297a: kzalloc descrtab failed\n"); return -1; } - memset(dma->descrtab, 0, dma->ringsz * sizeof(serdma_descr_t)); dma->descrtab_end = dma->descrtab + dma->ringsz; /* XXX bloddy mess, use proper DMA API here ... */ dma->descrtab_phys = CPHYSADDR((long)dma->descrtab); dma->descr_add = dma->descr_rem = dma->descrtab; /* Frame buffer area */ - dma->dma_buf = kmalloc(DMA_BUF_SIZE, GFP_KERNEL); + dma->dma_buf = kzalloc(DMA_BUF_SIZE, GFP_KERNEL); if (!dma->dma_buf) { - printk(KERN_ERR "cs4297a: kmalloc dma_buf failed\n"); + printk(KERN_ERR "cs4297a: kzalloc dma_buf failed\n"); kfree(dma->descrtab); return -1; } - memset(dma->dma_buf, 0, DMA_BUF_SIZE); dma->dma_buf_phys = CPHYSADDR((long)dma->dma_buf); /* Samples buffer area */ @@ -2619,12 +2617,11 @@ static int __init cs4297a_init(void) udelay(100); #endif - if (!(s = kmalloc(sizeof(struct cs4297a_state), GFP_KERNEL))) { + if (!(s = kzalloc(sizeof(struct cs4297a_state), GFP_KERNEL))) { CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR "cs4297a: probe() no memory for state struct.\n")); return -1; } - memset(s, 0, sizeof(struct cs4297a_state)); s->magic = CS4297a_MAGIC; init_waitqueue_head(&s->dma_adc.wait); init_waitqueue_head(&s->dma_dac.wait); diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 6b1f8c9cdcf..72a8a0ed36a 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c @@ -2729,12 +2729,11 @@ trident_open(struct inode *inode, struct file *file) } for (i = 0; i < NR_HW_CH; i++) { if (card->states[i] == NULL) { - state = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); + state = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL); if (state == NULL) { mutex_unlock(&card->open_mutex); return -ENOMEM; } - memset(state, 0, sizeof(*state)); mutex_init(&state->sem); dmabuf = &state->dmabuf; goto found_virt; @@ -3618,7 +3617,7 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums) } return -EBUSY; } - s = card->states[i] = kmalloc(sizeof(*state), GFP_KERNEL); + s = card->states[i] = kzalloc(sizeof(*state), GFP_KERNEL); if (!s) { num = ali_multi_channels_5_1[state_count]; ali_free_pcm_channel(card, num); @@ -3630,7 +3629,6 @@ ali_allocate_other_states_resources(struct trident_state *state, int chan_nums) } return -ENOMEM; } - memset(s, 0, sizeof(*state)); s->dmabuf.channel = channel; s->dmabuf.ossfragshift = s->dmabuf.ossmaxfrags = @@ -4399,11 +4397,10 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) } rc = -ENOMEM; - if ((card = kmalloc(sizeof(*card), GFP_KERNEL)) == NULL) { + if ((card = kzalloc(sizeof(*card), GFP_KERNEL)) == NULL) { printk(KERN_ERR "trident: out of memory\n"); goto out_release_region; } - memset(card, 0, sizeof (*card)); init_timer(&card->timer); card->iobase = iobase; diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c index 26a7c6af95b..b48c72923a1 100644 --- a/sound/oss/waveartist.c +++ b/sound/oss/waveartist.c @@ -1267,12 +1267,10 @@ static int __init waveartist_init(wavnc_info *devc) conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, devc->hw.dma, devc->hw.dma2); - portc = kmalloc(sizeof(wavnc_port_info), GFP_KERNEL); + portc = kzalloc(sizeof(wavnc_port_info), GFP_KERNEL); if (portc == NULL) goto nomem; - memset(portc, 0, sizeof(wavnc_port_info)); - my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, dev_name, &waveartist_audio_driver, sizeof(struct audio_driver), 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 74ed8108147..a9eec2a2357 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[] = { { 0x43525970, 0xfffffff8, "CS4202", NULL, NULL }, { 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, // SmartMC II { 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, // SmartAMC fixme: the mask might be different +{ 0x43585431, 0xffffffff, "Cx20551", patch_cx20551, NULL }, { 0x44543031, 0xfffffff0, "DT0398", NULL, NULL }, { 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, // same as TR28028? { 0x45838308, 0xffffffff, "ESS1988", NULL, NULL }, diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 641d0c8d659..bfc2fed16da 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) return 0; } +int patch_cx20551(struct snd_ac97 *ac97) +{ + snd_ac97_update_bits(ac97, 0x5c, 0x01, 0x01); + return 0; +} + /* * Analog Device AD18xx, AD19xx codecs */ diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h index 94340daaaf1..555d1c9a98f 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); int patch_cirrus_cs4299(struct snd_ac97 * ac97); int patch_cirrus_spdif(struct snd_ac97 * ac97); int patch_conexant(struct snd_ac97 * ac97); +int patch_cx20551(struct snd_ac97 * ac97); int patch_ad1819(struct snd_ac97 * ac97); int patch_ad1881(struct snd_ac97 * ac97); int patch_ad1885(struct snd_ac97 * ac97); diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 73f4668238c..23a1c75085b 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -57,6 +57,7 @@ struct conexant_spec { * dig_out_nid and hp_nid are optional */ unsigned int cur_eapd; + unsigned int hp_present; unsigned int need_dac_fix; /* capture */ @@ -354,7 +355,7 @@ static struct hda_codec_ops conexant_patch_ops = { * the private value = nid | (invert << 8) */ -static int conexant_eapd_info(struct snd_kcontrol *kcontrol, +static int cxt_eapd_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; @@ -364,7 +365,7 @@ static int conexant_eapd_info(struct snd_kcontrol *kcontrol, return 0; } -static int conexant_eapd_get(struct snd_kcontrol *kcontrol, +static int cxt_eapd_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); @@ -375,9 +376,10 @@ static int conexant_eapd_get(struct snd_kcontrol *kcontrol, else ucontrol->value.integer.value[0] = spec->cur_eapd; return 0; + } -static int conexant_eapd_put(struct snd_kcontrol *kcontrol, +static int cxt_eapd_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); @@ -385,11 +387,13 @@ static int conexant_eapd_put(struct snd_kcontrol *kcontrol, int invert = (kcontrol->private_value >> 8) & 1; hda_nid_t nid = kcontrol->private_value & 0xff; unsigned int eapd; + eapd = ucontrol->value.integer.value[0]; if (invert) eapd = !eapd; if (eapd == spec->cur_eapd && !codec->in_resume) return 0; + spec->cur_eapd = eapd; snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, @@ -400,6 +404,15 @@ static int conexant_eapd_put(struct snd_kcontrol *kcontrol, /* controls for test mode */ #ifdef CONFIG_SND_DEBUG +#define CXT_EAPD_SWITCH(xname, nid, mask) \ + { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ + .info = cxt_eapd_info, \ + .get = cxt_eapd_get, \ + .put = cxt_eapd_put, \ + .private_value = nid | (mask<<16) } + + + static int conexant_ch_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { @@ -492,7 +505,7 @@ static int cxt_gpio_data_put(struct snd_kcontrol *kcontrol, .get = cxt_gpio_data_get, \ .put = cxt_gpio_data_put, \ .private_value = nid | (mask<<16) } - +#if 0 static int cxt_spdif_ctrl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { @@ -547,7 +560,7 @@ static int cxt_spdif_ctrl_put(struct snd_kcontrol *kcontrol, .get = cxt_spdif_ctrl_get, \ .put = cxt_spdif_ctrl_put, \ .private_value = nid | (mask<<16) } - +#endif #endif /* CONFIG_SND_DEBUG */ /* Conexant 5045 specific */ @@ -564,7 +577,7 @@ static struct hda_channel_mode cxt5045_modes[1] = { static struct hda_input_mux cxt5045_capture_source = { .num_items = 2, .items = { - { "ExtMic", 0x1 }, + { "IntMic", 0x1 }, { "LineIn", 0x2 }, } }; @@ -575,15 +588,20 @@ static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct conexant_spec *spec = codec->spec; + unsigned int bits; - if (!conexant_eapd_put(kcontrol, ucontrol)) + if (!cxt_eapd_put(kcontrol, ucontrol)) return 0; - /* toggle HP mute appropriately */ - snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0, - 0x80, spec->cur_eapd ? 0 : 0x80); - snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0, - 0x80, spec->cur_eapd ? 0 : 0x80); + /* toggle internal speakers mute depending of presence of + * the headphone jack + */ + bits = (!spec->hp_present && spec->cur_eapd) ? 0 : 0x80; + snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); + bits = spec->cur_eapd ? 0 : 0x80; + snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0, 0x80, bits); return 1; } @@ -610,14 +628,13 @@ static int cxt5045_hp_master_vol_put(struct snd_kcontrol *kcontrol, /* mute internal speaker if HP is plugged */ static void cxt5045_hp_automute(struct hda_codec *codec) { - unsigned int present; + struct conexant_spec *spec = codec->spec; + unsigned int bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; - present = snd_hda_codec_read(codec, 0x11, 0, + spec->hp_present = snd_hda_codec_read(codec, 0x11, 0, AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; - snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, - 0x80, present ? 0x80 : 0); - snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, - 0x80, present ? 0x80 : 0); + snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); } /* unsolicited event for HP jack sensing */ @@ -640,25 +657,27 @@ static struct snd_kcontrol_new cxt5045_mixers[] = { .get = conexant_mux_enum_get, .put = conexant_mux_enum_put }, - HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x17, 0x02, HDA_INPUT), - HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x17, 0x02, HDA_INPUT), - HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x02, HDA_INPUT), - HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("Int Mic Volume", 0x17, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("Int Mic Switch", 0x17, 0x01, HDA_INPUT), + HDA_CODEC_VOLUME("Ext Mic Volume", 0x17, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("Ext Mic Switch", 0x17, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x1a, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x1a, 0x0, HDA_INPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Volume", .info = snd_hda_mixer_amp_volume_info, .get = snd_hda_mixer_amp_volume_get, .put = cxt5045_hp_master_vol_put, - .private_value = HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT), + .private_value = HDA_COMPOSE_AMP_VAL(0x10, 3, 0, HDA_OUTPUT), }, { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", - .info = conexant_eapd_info, - .get = conexant_eapd_get, + .info = cxt_eapd_info, + .get = cxt_eapd_get, .put = cxt5045_hp_master_sw_put, - .private_value = 0x11, + .private_value = 0x10, }, {} @@ -669,22 +688,26 @@ static struct hda_verb cxt5045_init_verbs[] = { {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, /* HP, Amp */ - {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, - {0x1A, AC_VERB_SET_CONNECT_SEL,0x01}, - {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, - AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00}, - {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, + {0x17, AC_VERB_SET_CONNECT_SEL,0x01}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, + AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x01}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, + AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x02}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03}, - /* Record selector: Front mic */ - {0x14, AC_VERB_SET_CONNECT_SEL,0x03}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, + AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x04}, + /* Record selector: Int mic */ + {0x1a, AC_VERB_SET_CONNECT_SEL,0x0}, + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, /* SPDIF route: PCM */ { 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 }, /* pin sensing on HP and Mic jacks */ {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, /* EAPD */ - {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x0 }, /* default on */ + {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */ { } /* end */ }; @@ -706,8 +729,6 @@ static struct hda_input_mux cxt5045_test_capture_source = { static struct snd_kcontrol_new cxt5045_test_mixer[] = { /* Output controls */ - HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x19, 0x00, HDA_OUTPUT), - HDA_CODEC_MUTE("OutAmp-1 Switch", 0x19,0x00, HDA_OUTPUT), HDA_CODEC_VOLUME("Speaker Playback Volume", 0x10, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Speaker Playback Switch", 0x10, 0x0, HDA_OUTPUT), @@ -715,6 +736,9 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = { CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT), CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT), + /* EAPD Switch Control */ + CXT_EAPD_SWITCH("External Amplifier", 0x10, 0x0), + /* Loopback mixer controls */ HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x17, 0x01, HDA_INPUT), HDA_CODEC_MUTE("MIC1 Playback Switch", 0x17, 0x01, HDA_INPUT), @@ -725,17 +749,16 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = { HDA_CODEC_VOLUME("CD Playback Volume", 0x17, 0x04, HDA_INPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x17, 0x04, HDA_INPUT), - /* Controls for GPIO pins, assuming they exist and are configured as outputs */ - CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01), -#if 0 /* limit this to one GPIO pin for now */ - CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02), - CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04), - CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08), -#endif - CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x13, 0x01), - - HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_OUTPUT), - HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Capture-1 Volume", 0x17, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture-1 Switch", 0x17, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-2 Volume", 0x17, 0x1, HDA_INPUT), + HDA_CODEC_MUTE("Capture-2 Switch", 0x17, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-3 Volume", 0x17, 0x2, HDA_INPUT), + HDA_CODEC_MUTE("Capture-3 Switch", 0x17, 0x2, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-4 Volume", 0x17, 0x3, HDA_INPUT), + HDA_CODEC_MUTE("Capture-4 Switch", 0x17, 0x3, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-5 Volume", 0x17, 0x4, HDA_INPUT), + HDA_CODEC_MUTE("Capture-5 Switch", 0x17, 0x4, HDA_INPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Source", @@ -748,14 +771,9 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = { }; static struct hda_verb cxt5045_test_init_verbs[] = { - /* Enable all GPIOs as outputs with an initial value of 0 */ - {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f}, - {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, - {0x01, AC_VERB_SET_GPIO_MASK, 0x0f}, - /* Enable retasking pins as output, initially without power amp */ {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, - {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, /* Disable digital (SPDIF) pins initially, but users can enable * them via a mixer switch. In the case of SPDIF-out, this initverb @@ -823,6 +841,8 @@ static const char *cxt5045_models[CXT5045_MODELS] = { static struct snd_pci_quirk cxt5045_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30b7, "HP DV6000Z", CXT5045_LAPTOP), + SND_PCI_QUIRK(0x103c, 0x30bb, "HP DV8000", CXT5045_LAPTOP), + SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_LAPTOP), {} }; @@ -880,11 +900,11 @@ static int patch_cxt5045(struct hda_codec *codec) /* Conexant 5047 specific */ +#define CXT5047_SPDIF_OUT 0x11 -static hda_nid_t cxt5047_dac_nids[1] = { 0x10 }; +static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c }; static hda_nid_t cxt5047_adc_nids[1] = { 0x12 }; static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a }; -#define CXT5047_SPDIF_OUT 0x11 static struct hda_channel_mode cxt5047_modes[1] = { { 2, NULL }, @@ -893,15 +913,23 @@ static struct hda_channel_mode cxt5047_modes[1] = { static struct hda_input_mux cxt5047_capture_source = { .num_items = 2, .items = { - { "ExtMic", 0x1 }, - { "IntMic", 0x2 }, + { "ExtMic", 0x0 }, + { "IntMic", 0x1 }, } }; static struct hda_input_mux cxt5047_hp_capture_source = { .num_items = 1, .items = { - { "ExtMic", 0x1 }, + { "ExtMic", 0x2 }, + } +}; + +static struct hda_input_mux cxt5047_toshiba_capture_source = { + .num_items = 2, + .items = { + { "ExtMic", 0x2 }, + { "Line-In", 0x1 }, } }; @@ -911,20 +939,24 @@ static int cxt5047_hp_master_sw_put(struct snd_kcontrol *kcontrol, { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct conexant_spec *spec = codec->spec; + unsigned int bits; - if (!conexant_eapd_put(kcontrol, ucontrol)) + if (!cxt_eapd_put(kcontrol, ucontrol)) return 0; - /* toggle HP mute appropriately */ - snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, - 0x80, spec->cur_eapd ? 0 : 0x80); - snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0, - 0x80, spec->cur_eapd ? 0 : 0x80); + /* toggle internal speakers mute depending of presence of + * the headphone jack + */ + bits = (!spec->hp_present && spec->cur_eapd) ? 0 : 0x80; + snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); + bits = spec->cur_eapd ? 0 : 0x80; + snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0, 0x80, bits); return 1; } -#if 0 -/* bind volumes of both NID 0x13 and 0x1d */ +/* bind volumes of both NID 0x13 (Headphones) and 0x1d (Speakers) */ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -932,9 +964,9 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol, long *valp = ucontrol->value.integer.value; int change; - change = snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, + change = snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x7f, valp[0] & 0x7f); - change |= snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, + change |= snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x7f, valp[1] & 0x7f); snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0, 0x7f, valp[0] & 0x7f); @@ -942,19 +974,20 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol, 0x7f, valp[1] & 0x7f); return change; } -#endif /* mute internal speaker if HP is plugged */ static void cxt5047_hp_automute(struct hda_codec *codec) { - unsigned int present; + struct conexant_spec *spec = codec->spec; + unsigned int bits = spec->hp_present || !spec->cur_eapd ? 0x80 : 0; - present = snd_hda_codec_read(codec, 0x13, 0, + spec->hp_present = snd_hda_codec_read(codec, 0x13, 0, AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; - snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, - 0x80, present ? 0x80 : 0); - snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, - 0x80, present ? 0x80 : 0); + snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); + /* Mute/Unmute PCM 2 for good measure - some systems need this */ + snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0, 0x80, bits); + snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0, 0x80, bits); } /* toggle input of built-in and mic jack appropriately */ @@ -1009,12 +1042,55 @@ static struct snd_kcontrol_new cxt5047_mixers[] = { HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT), - HDA_CODEC_VOLUME("Master Playback Volume", 0x13, 0x00, HDA_OUTPUT), + HDA_CODEC_VOLUME("PCM-2 Volume", 0x1c, 0x00, HDA_OUTPUT), + HDA_CODEC_MUTE("PCM-2 Switch", 0x1c, 0x00, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Master Playback Volume", + .info = snd_hda_mixer_amp_volume_info, + .get = snd_hda_mixer_amp_volume_get, + .put = cxt5047_hp_master_vol_put, + .private_value = HDA_COMPOSE_AMP_VAL(0x13, 3, 0, HDA_OUTPUT), + }, { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", - .info = conexant_eapd_info, - .get = conexant_eapd_get, + .info = cxt_eapd_info, + .get = cxt_eapd_get, + .put = cxt5047_hp_master_sw_put, + .private_value = 0x13, + }, + + {} +}; + +static struct snd_kcontrol_new cxt5047_toshiba_mixers[] = { + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Capture Source", + .info = conexant_mux_enum_info, + .get = conexant_mux_enum_get, + .put = conexant_mux_enum_put + }, + HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), + HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), + HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Master Playback Volume", + .info = snd_hda_mixer_amp_volume_info, + .get = snd_hda_mixer_amp_volume_get, + .put = cxt5047_hp_master_vol_put, + .private_value = HDA_COMPOSE_AMP_VAL(0x13, 3, 0, HDA_OUTPUT), + }, + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Master Playback Switch", + .info = cxt_eapd_info, + .get = cxt_eapd_get, .put = cxt5047_hp_master_sw_put, .private_value = 0x13, }, @@ -1040,8 +1116,8 @@ static struct snd_kcontrol_new cxt5047_hp_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", - .info = conexant_eapd_info, - .get = conexant_eapd_get, + .info = cxt_eapd_info, + .get = cxt_eapd_get, .put = cxt5047_hp_master_sw_put, .private_value = 0x13, }, @@ -1053,19 +1129,23 @@ static struct hda_verb cxt5047_init_verbs[] = { {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 }, - /* HP, Amp */ + /* HP, Amp, Speaker */ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, - {0x1A, AC_VERB_SET_CONNECT_SEL,0x03}, + {0x1A, AC_VERB_SET_CONNECT_SEL,0x00}, {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00}, {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03}, + {0x1d, AC_VERB_SET_CONNECT_SEL,0x0}, /* Record selector: Front mic */ {0x12, AC_VERB_SET_CONNECT_SEL,0x03}, {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, /* SPDIF route: PCM */ { 0x18, AC_VERB_SET_CONNECT_SEL, 0x0 }, + /* Enable unsolicited events */ + {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, { } /* end */ }; @@ -1075,14 +1155,24 @@ static struct hda_verb cxt5047_toshiba_init_verbs[] = { /* pin sensing on HP and Mic jacks */ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, + /* Speaker routing */ + {0x1d, AC_VERB_SET_CONNECT_SEL,0x1}, + /* Change default to ExtMic for recording */ + {0x1a, AC_VERB_SET_CONNECT_SEL,0x2}, {} }; /* configuration for HP Laptops */ static struct hda_verb cxt5047_hp_init_verbs[] = { - /* pin sensing on HP and Mic jacks */ + /* pin sensing on HP jack */ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, - {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, + /* Record selector: Ext Mic */ + {0x12, AC_VERB_SET_CONNECT_SEL,0x03}, + {0x1a, AC_VERB_SET_CONNECT_SEL,0x02}, + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, + AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, + /* Speaker routing */ + {0x1d, AC_VERB_SET_CONNECT_SEL,0x1}, {} }; @@ -1091,53 +1181,56 @@ static struct hda_verb cxt5047_hp_init_verbs[] = { */ #ifdef CONFIG_SND_DEBUG static struct hda_input_mux cxt5047_test_capture_source = { - .num_items = 5, + .num_items = 4, .items = { - { "MIXER", 0x0 }, - { "LINE1 pin", 0x1 }, - { "MIC1 pin", 0x2 }, - { "MIC2 pin", 0x3 }, - { "CD pin", 0x4 }, + { "LINE1 pin", 0x0 }, + { "MIC1 pin", 0x1 }, + { "MIC2 pin", 0x2 }, + { "CD pin", 0x3 }, }, }; static struct snd_kcontrol_new cxt5047_test_mixer[] = { /* Output only controls */ - HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x10, 0x00, HDA_OUTPUT), - HDA_CODEC_MUTE("OutAmp-1 Switch", 0x10,0x00, HDA_OUTPUT), - HDA_CODEC_VOLUME("OutAmp-2 Volume", 0x1c, 0x00, HDA_OUTPUT), - HDA_CODEC_MUTE("OutAmp-2 Switch", 0x1c, 0x00, HDA_OUTPUT), + HDA_CODEC_VOLUME("OutAmp-1 Volume", 0x10, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("OutAmp-1 Switch", 0x10,0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("OutAmp-2 Volume", 0x1c, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("OutAmp-2 Switch", 0x1c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Speaker Playback Switch", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("HeadPhone Playback Volume", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("HeadPhone Playback Switch", 0x13, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Line1-Out Playback Volume", 0x14, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Line1-Out Playback Switch", 0x14, 0x0, HDA_OUTPUT), + HDA_CODEC_VOLUME("Line2-Out Playback Volume", 0x15, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Line2-Out Playback Switch", 0x15, 0x0, HDA_OUTPUT), /* Modes for retasking pin widgets */ CXT_PIN_MODE("LINE1 pin mode", 0x14, CXT_PIN_DIR_INOUT), CXT_PIN_MODE("MIC1 pin mode", 0x15, CXT_PIN_DIR_INOUT), - /* Loopback mixer controls */ - HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x19, 0x02, HDA_INPUT), - HDA_CODEC_MUTE("MIC1 Playback Switch", 0x19, 0x02, HDA_INPUT), - HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x19, 0x03, HDA_INPUT), - HDA_CODEC_MUTE("MIC2 Playback Switch", 0x19, 0x03, HDA_INPUT), - HDA_CODEC_VOLUME("LINE Playback Volume", 0x19, 0x01, HDA_INPUT), - HDA_CODEC_MUTE("LINE Playback Switch", 0x19, 0x01, HDA_INPUT), - HDA_CODEC_VOLUME("CD Playback Volume", 0x19, 0x04, HDA_INPUT), - HDA_CODEC_MUTE("CD Playback Switch", 0x19, 0x04, HDA_INPUT), - -#if 0 - /* Controls for GPIO pins, assuming they exist and are configured as outputs */ - CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01), - CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02), - CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04), - CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08), -#endif - CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x18, 0x01), + /* EAPD Switch Control */ + CXT_EAPD_SWITCH("External Amplifier", 0x13, 0x0), - HDA_CODEC_VOLUME("Capture Volume", 0x19, 0x0, HDA_OUTPUT), - HDA_CODEC_MUTE("Capture Switch", 0x19, 0x0, HDA_OUTPUT), + /* Loopback mixer controls */ + HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x12, 0x01, HDA_INPUT), + HDA_CODEC_MUTE("MIC1 Playback Switch", 0x12, 0x01, HDA_INPUT), + HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x12, 0x02, HDA_INPUT), + HDA_CODEC_MUTE("MIC2 Playback Switch", 0x12, 0x02, HDA_INPUT), + HDA_CODEC_VOLUME("LINE Playback Volume", 0x12, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("LINE Playback Switch", 0x12, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("CD Playback Volume", 0x12, 0x04, HDA_INPUT), + HDA_CODEC_MUTE("CD Playback Switch", 0x12, 0x04, HDA_INPUT), + + HDA_CODEC_VOLUME("Capture-1 Volume", 0x19, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture-1 Switch", 0x19, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-2 Volume", 0x19, 0x1, HDA_INPUT), + HDA_CODEC_MUTE("Capture-2 Switch", 0x19, 0x1, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-3 Volume", 0x19, 0x2, HDA_INPUT), + HDA_CODEC_MUTE("Capture-3 Switch", 0x19, 0x2, HDA_INPUT), + HDA_CODEC_VOLUME("Capture-4 Volume", 0x19, 0x3, HDA_INPUT), + HDA_CODEC_MUTE("Capture-4 Switch", 0x19, 0x3, HDA_INPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Source", @@ -1145,16 +1238,18 @@ static struct snd_kcontrol_new cxt5047_test_mixer[] = { .get = conexant_mux_enum_get, .put = conexant_mux_enum_put, }, + /* Controls for GPIO pins, assuming they exist and are configured + * as outputs + */ + CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01), + CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02), + CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04), + CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08), { } /* end */ }; static struct hda_verb cxt5047_test_init_verbs[] = { - /* Enable all GPIOs as outputs with an initial value of 0 */ - {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f}, - {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, - {0x01, AC_VERB_SET_GPIO_MASK, 0x0f}, - /* Enable retasking pins as output, initially without power amp */ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, @@ -1215,7 +1310,6 @@ static int cxt5047_hp_init(struct hda_codec *codec) { conexant_init(codec); cxt5047_hp_automute(codec); - cxt5047_hp_automic(codec); return 0; } @@ -1242,6 +1336,7 @@ static const char *cxt5047_models[CXT5047_MODELS] = { static struct snd_pci_quirk cxt5047_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30a0, "HP DV1000", CXT5047_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP), + SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2000Z", CXT5047_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP), SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD), {} @@ -1291,8 +1386,10 @@ static int patch_cxt5047(struct hda_codec *codec) codec->patch_ops.init = cxt5047_hp_init; break; case CXT5047_LAPTOP_EAPD: + spec->input_mux = &cxt5047_toshiba_capture_source; spec->num_init_verbs = 2; spec->init_verbs[1] = cxt5047_toshiba_init_verbs; + spec->mixers[0] = cxt5047_toshiba_mixers; break; #ifdef CONFIG_SND_DEBUG case CXT5047_TEST: @@ -1305,7 +1402,9 @@ static int patch_cxt5047(struct hda_codec *codec) } struct hda_codec_preset snd_hda_preset_conexant[] = { - { .id = 0x14f15045, .name = "CXT5045", .patch = patch_cxt5045 }, - { .id = 0x14f15047, .name = "CXT5047", .patch = patch_cxt5047 }, + { .id = 0x14f15045, .name = "CX20549 (Venice)", + .patch = patch_cxt5045 }, + { .id = 0x14f15047, .name = "CX20551 (Waikiki)", + .patch = patch_cxt5047 }, {} /* terminator */ }; diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 6f4a39273b9..f7ef9c5afe8 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[] = { "Dell Latitude 120L", STAC_REF), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cc, "Dell Latitude D820", STAC_REF), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cd, + "Dell Inspiron E1705/9400", STAC_REF), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ce, + "Dell XPS M1710", STAC_REF), {} /* terminator */ }; @@ -1800,6 +1804,7 @@ static int patch_stac925x(struct hda_codec *codec) spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, stac925x_models, stac925x_cfg_tbl); + again: if (spec->board_config < 0) { snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n"); err = stac92xx_save_bios_config_regs(codec); @@ -1825,6 +1830,15 @@ static int patch_stac925x(struct hda_codec *codec) spec->mixer = stac925x_mixer; err = stac92xx_parse_auto_config(codec, 0x8, 0x7); + if (!err) { + if (spec->board_config < 0) { + printk(KERN_WARNING "hda_codec: No auto-config is " + "available, default to model=ref\n"); + spec->board_config = STAC_925x_REF; + goto again; + } + err = -EINVAL; + } if (err < 0) { stac92xx_free(codec); return err; @@ -1850,6 +1864,7 @@ static int patch_stac922x(struct hda_codec *codec) spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, stac922x_models, stac922x_cfg_tbl); + again: if (spec->board_config < 0) { snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, " "using BIOS defaults\n"); @@ -1875,6 +1890,15 @@ static int patch_stac922x(struct hda_codec *codec) spec->multiout.dac_nids = spec->dac_nids; err = stac92xx_parse_auto_config(codec, 0x08, 0x09); + if (!err) { + if (spec->board_config < 0) { + printk(KERN_WARNING "hda_codec: No auto-config is " + "available, default to model=ref\n"); + spec->board_config = STAC_D945_REF; + goto again; + } + err = -EINVAL; + } if (err < 0) { stac92xx_free(codec); return err; @@ -1903,6 +1927,7 @@ static int patch_stac927x(struct hda_codec *codec) spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, stac927x_models, stac927x_cfg_tbl); + again: if (spec->board_config < 0) { snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC927x, using BIOS defaults\n"); err = stac92xx_save_bios_config_regs(codec); @@ -1945,6 +1970,15 @@ static int patch_stac927x(struct hda_codec *codec) spec->multiout.dac_nids = spec->dac_nids; err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); + if (!err) { + if (spec->board_config < 0) { + printk(KERN_WARNING "hda_codec: No auto-config is " + "available, default to model=ref\n"); + spec->board_config = STAC_D965_REF; + goto again; + } + err = -EINVAL; + } if (err < 0) { stac92xx_free(codec); return err; @@ -1970,6 +2004,7 @@ static int patch_stac9205(struct hda_codec *codec) spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS, stac9205_models, stac9205_cfg_tbl); + again: if (spec->board_config < 0) { snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9205, using BIOS defaults\n"); err = stac92xx_save_bios_config_regs(codec); @@ -2008,6 +2043,15 @@ static int patch_stac9205(struct hda_codec *codec) AC_VERB_SET_GPIO_MASK, 0x00000001); err = stac92xx_parse_auto_config(codec, 0x1f, 0x20); + if (!err) { + if (spec->board_config < 0) { + printk(KERN_WARNING "hda_codec: No auto-config is " + "available, default to model=ref\n"); + spec->board_config = STAC_9205_REF; + goto again; + } + err = -EINVAL; + } if (err < 0) { stac92xx_free(codec); return err; diff --git a/sound/soc/at91/at91-i2s.c b/sound/soc/at91/at91-i2s.c index fcc544a96ba..9fc0c038888 100644 --- a/sound/soc/at91/at91-i2s.c +++ b/sound/soc/at91/at91-i2s.c @@ -20,6 +20,8 @@ #include <linux/device.h> #include <linux/delay.h> #include <linux/clk.h> +#include <linux/atmel_pdc.h> + #include <sound/driver.h> #include <sound/core.h> #include <sound/pcm.h> @@ -29,7 +31,6 @@ #include <asm/arch/hardware.h> #include <asm/arch/at91_pmc.h> #include <asm/arch/at91_ssc.h> -#include <asm/arch/at91_pdc.h> #include "at91-pcm.h" #include "at91-i2s.h" @@ -51,17 +52,17 @@ * SSC PDC registers required by the PCM DMA engine. */ static struct at91_pdc_regs pdc_tx_reg = { - .xpr = AT91_PDC_TPR, - .xcr = AT91_PDC_TCR, - .xnpr = AT91_PDC_TNPR, - .xncr = AT91_PDC_TNCR, + .xpr = ATMEL_PDC_TPR, + .xcr = ATMEL_PDC_TCR, + .xnpr = ATMEL_PDC_TNPR, + .xncr = ATMEL_PDC_TNCR, }; static struct at91_pdc_regs pdc_rx_reg = { - .xpr = AT91_PDC_RPR, - .xcr = AT91_PDC_RCR, - .xnpr = AT91_PDC_RNPR, - .xncr = AT91_PDC_RNCR, + .xpr = ATMEL_PDC_RPR, + .xcr = ATMEL_PDC_RCR, + .xnpr = ATMEL_PDC_RNPR, + .xncr = ATMEL_PDC_RNCR, }; /* @@ -72,8 +73,8 @@ static struct at91_ssc_mask ssc_tx_mask = { .ssc_disable = AT91_SSC_TXDIS, .ssc_endx = AT91_SSC_ENDTX, .ssc_endbuf = AT91_SSC_TXBUFE, - .pdc_enable = AT91_PDC_TXTEN, - .pdc_disable = AT91_PDC_TXTDIS, + .pdc_enable = ATMEL_PDC_TXTEN, + .pdc_disable = ATMEL_PDC_TXTDIS, }; static struct at91_ssc_mask ssc_rx_mask = { @@ -81,8 +82,8 @@ static struct at91_ssc_mask ssc_rx_mask = { .ssc_disable = AT91_SSC_RXDIS, .ssc_endx = AT91_SSC_ENDRX, .ssc_endbuf = AT91_SSC_RXBUFF, - .pdc_enable = AT91_PDC_RXTEN, - .pdc_disable = AT91_PDC_RXTDIS, + .pdc_enable = ATMEL_PDC_RXTEN, + .pdc_disable = ATMEL_PDC_RXTDIS, }; @@ -508,14 +509,14 @@ static int at91_i2s_hw_params(struct snd_pcm_substream *substream, /* Reset the SSC and its PDC registers */ at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RPR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RCR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNPR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_RNCR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TPR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TCR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNPR, 0); - at91_ssc_write(ssc_p->ssc.base + AT91_PDC_TNCR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RPR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RCR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNPR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNCR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TPR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TCR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNPR, 0); + at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNCR, 0); if ((ret = request_irq(ssc_p->ssc.pid, at91_i2s_interrupt, 0, ssc_p->name, ssc_p)) < 0) { diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c index e88b12e7cc4..b39b95a4704 100644 --- a/sound/soc/at91/at91-pcm.c +++ b/sound/soc/at91/at91-pcm.c @@ -21,6 +21,7 @@ #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/dma-mapping.h> +#include <linux/atmel_pdc.h> #include <sound/driver.h> #include <sound/core.h> @@ -30,7 +31,6 @@ #include <asm/arch/hardware.h> #include <asm/arch/at91_ssc.h> -#include <asm/arch/at91_pdc.h> #include "at91-pcm.h" @@ -83,7 +83,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr, params->name, ssc_sr, count); /* re-start the PDC */ - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); prtd->period_ptr += prtd->period_size; if (prtd->period_ptr >= prtd->dma_buffer_end) { @@ -94,7 +94,7 @@ static void at91_pcm_dma_irq(u32 ssc_sr, at91_ssc_write(params->ssc_base + params->pdc->xcr, prtd->period_size / params->pdc_xfer_size); - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); } if (ssc_sr & params->mask->ssc_endx) { @@ -143,7 +143,7 @@ static int at91_pcm_hw_free(struct snd_pcm_substream *substream) struct at91_pcm_dma_params *params = prtd->params; if (params != NULL) { - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); prtd->params->dma_intr_handler = NULL; } @@ -158,7 +158,7 @@ static int at91_pcm_prepare(struct snd_pcm_substream *substream) at91_ssc_write(params->ssc_base + AT91_SSC_IDR, params->mask->ssc_endx | params->mask->ssc_endbuf); - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); return 0; } @@ -192,7 +192,7 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, at91_ssc_write(params->ssc_base + AT91_SSC_IER, params->mask->ssc_endx | params->mask->ssc_endbuf); - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); DBG("sr=%lx imr=%lx\n", at91_ssc_read(params->ssc_base + AT91_SSC_SR), at91_ssc_read(params->ssc_base + AT91_SSC_IER)); @@ -201,12 +201,12 @@ static int at91_pcm_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); break; case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); break; default: @@ -379,7 +379,7 @@ static int at91_pcm_suspend(struct platform_device *pdev, /* disable the PDC and save the PDC registers */ - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_disable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable); prtd->pdc_xpr_save = at91_ssc_read(params->ssc_base + params->pdc->xpr); 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, at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save); at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save); - at91_ssc_write(params->ssc_base + AT91_PDC_PTCR, params->mask->pdc_enable); + at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable); return 0; } #else diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 78ac2688e12..ec2a2787957 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1,15 +1,15 @@ config SND_SOC_AC97_CODEC tristate - depends SND_SOC + depends on SND_SOC config SND_SOC_WM8731 tristate - depends SND_SOC + depends on SND_SOC config SND_SOC_WM8750 tristate - depends SND_SOC + depends on SND_SOC config SND_SOC_WM9712 tristate - depends SND_SOC + depends on SND_SOC diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index 573e3701c14..ebcac13fd39 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/wait.h> -#include <linux/sched.h> #include <linux/slab.h> #include <linux/string.h> #include <sound/core.h> diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c index 59144ec026e..680f2b7fec2 100644 --- a/sound/synth/emux/emux_proc.c +++ b/sound/synth/emux/emux_proc.c @@ -20,7 +20,6 @@ #include <sound/driver.h> #include <linux/wait.h> -#include <linux/sched.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/emux_synth.h> diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 4dfb91d4398..b6d886373bb 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, } urb->transfer_buffer_length = offs; urb->number_of_packets = ctx->packets; -#if 0 // for check - if (! urb->bandwidth) { - int bustime; - bustime = usb_check_bandwidth(urb->dev, urb); - if (bustime < 0) - return bustime; - printk("urb %d: bandwidth = %d (packets = %d)\n", ctx->index, bustime, urb->number_of_packets); - usb_claim_bandwidth(urb->dev, urb, bustime, 1); - } -#endif // for check return 0; } diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 25b4ab4f61e..858262068f4 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h @@ -948,6 +948,29 @@ YAMAHA_DEVICE(0x7010, "UB99"), }, /* TODO: add Edirol M-100FX support */ { + /* has ID 0x004e when not in "Advanced Driver" mode */ + USB_DEVICE(0x0582, 0x004c), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "EDIROL", + .product_name = "PCR-A", + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 1, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = 2, + .type = QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum = -1 + } + } + } +}, +{ /* has ID 0x004f when not in "Advanced Driver" mode */ USB_DEVICE(0x0582, 0x004d), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |