diff options
Diffstat (limited to 'sound/parisc')
| -rw-r--r-- | sound/parisc/Kconfig | 13 | ||||
| -rw-r--r-- | sound/parisc/harmony.c | 35 |
2 files changed, 26 insertions, 22 deletions
diff --git a/sound/parisc/Kconfig b/sound/parisc/Kconfig index a5a7f9d75d0..9b61d95010f 100644 --- a/sound/parisc/Kconfig +++ b/sound/parisc/Kconfig @@ -1,15 +1,20 @@ # ALSA PA-RISC drivers -menu "GSC devices" - depends on SND!=n && GSC +menuconfig SND_GSC + bool "GSC sound devices" + depends on GSC + default y + help + Support for GSC sound devices on PA-RISC architectures. + +if SND_GSC config SND_HARMONY tristate "Harmony/Vivace sound chip" - depends on SND select SND_PCM help Say 'Y' or 'M' to include support for the Harmony/Vivace sound chip found in most GSC-based PA-RISC workstations. It's frequently provided as part of the Lasi multi-function IC. -endmenu +endif # SND_GSC diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index ce73f3eae78..4b20be79c1d 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -45,7 +45,6 @@ #include <linux/spinlock.h> #include <linux/dma-mapping.h> -#include <sound/driver.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/control.h> @@ -193,7 +192,7 @@ harmony_set_control(struct snd_harmony *h) } static irqreturn_t -snd_harmony_interrupt(int irq, void *dev, struct pt_regs *regs) +snd_harmony_interrupt(int irq, void *dev) { u32 dstatus; struct snd_harmony *h = dev; @@ -625,6 +624,9 @@ snd_harmony_pcm_init(struct snd_harmony *h) struct snd_pcm *pcm; int err; + if (snd_BUG_ON(!h)) + return -EINVAL; + harmony_disable_interrupts(h); err = snd_pcm_new(h->card, "harmony", 0, 1, 1, &pcm); @@ -854,7 +856,7 @@ static struct snd_kcontrol_new snd_harmony_controls[] = { HARMONY_GAIN_HE_SHIFT, 1, 0), }; -static void __init +static void snd_harmony_mixer_reset(struct snd_harmony *h) { harmony_mute(h); @@ -863,13 +865,15 @@ snd_harmony_mixer_reset(struct snd_harmony *h) harmony_unmute(h); } -static int __init +static int snd_harmony_mixer_init(struct snd_harmony *h) { - struct snd_card *card = h->card; + struct snd_card *card; int idx, err; - snd_assert(h != NULL, return -EINVAL); + if (snd_BUG_ON(!h)) + return -EINVAL; + card = h->card; strcpy(card->mixername, "Harmony Gain control interface"); for (idx = 0; idx < HARMONY_CONTROLS; idx++) { @@ -898,8 +902,6 @@ snd_harmony_free(struct snd_harmony *h) if (h->iobase) iounmap(h->iobase); - parisc_set_drvdata(h->dev, NULL); - kfree(h); return 0; } @@ -911,7 +913,7 @@ snd_harmony_dev_free(struct snd_device *dev) return snd_harmony_free(h); } -static int __devinit +static int snd_harmony_create(struct snd_card *card, struct parisc_device *padev, struct snd_harmony **rchip) @@ -935,7 +937,7 @@ snd_harmony_create(struct snd_card *card, h->iobase = ioremap_nocache(padev->hpa.start, HARMONY_SIZE); if (h->iobase == NULL) { printk(KERN_ERR PFX "unable to remap hpa 0x%lx\n", - padev->hpa.start); + (unsigned long)padev->hpa.start); err = -EBUSY; goto free_and_ret; } @@ -957,8 +959,6 @@ snd_harmony_create(struct snd_card *card, goto free_and_ret; } - snd_card_set_dev(card, &padev->dev); - *rchip = h; return 0; @@ -968,16 +968,16 @@ free_and_ret: return err; } -static int __devinit +static int snd_harmony_probe(struct parisc_device *padev) { int err; struct snd_card *card; struct snd_harmony *h; - card = snd_card_new(index, id, THIS_MODULE, 0); - if (card == NULL) - return -ENOMEM; + err = snd_card_new(&padev->dev, index, id, THIS_MODULE, 0, &card); + if (err < 0) + return err; err = snd_harmony_create(card, padev, &h); if (err < 0) @@ -1008,11 +1008,10 @@ free_and_ret: return err; } -static int __devexit +static int snd_harmony_remove(struct parisc_device *padev) { snd_card_free(parisc_get_drvdata(padev)); - parisc_set_drvdata(padev, NULL); return 0; } |
