Changeset 290


Ignore:
Timestamp:
Feb 16, 2008, 7:40:20 AM (17 years ago)
Author:
Brendan Oakley
Message:

Merged to ALSA 1.0.2

Location:
GPL/branches/alsa-resync1/alsa-kernel
Files:
57 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/core/control.c

    r277 r290  
    4343
    4444#define snd_kctl_ioctl(n) list_entry(n, snd_kctl_ioctl_t, list)
    45 
    46 /* find id without lock */
    47 static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id);
    4845
    4946static DECLARE_RWSEM(snd_ioctl_rwsem);
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_lib.c

    r260 r290  
    182182        else
    183183            xrun(substream);
     184#ifdef CONFIG_SND_DEBUG
     185                if (substream->pstr->xrun_debug) {
     186                        snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
     187                                   substream->pcm->card->number,
     188                                   substream->pcm->device,
     189                                   substream->stream ? 'c' : 'p');
     190                        dump_stack();
     191                }
     192#endif
    184193        return -EPIPE;
    185194    }
  • GPL/branches/alsa-resync1/alsa-kernel/core/sound.c

    r281 r290  
    4141int snd_major;
    4242static int cards_limit = 1;
    43 #ifdef CONFIG_DEVFS_FS
    4443static int device_mode = S_IFCHR | S_IRUGO | S_IWUGO;
    45 #endif
    4644
    4745MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     
    7371static DECLARE_MUTEX(sound_mutex);
    7472
    75 #ifdef CONFIG_DEVFS_FS
    7673extern struct class_simple *sound_class;
    77 #endif
     74
    7875
    7976#ifdef CONFIG_KMOD
     
    240237    }
    241238    list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);
    242 #ifdef CONFIG_DEVFS_FS
     239#ifndef TARGET_OS2
    243240    if (strncmp(name, "controlC", 8) || card->number >= cards_limit) {
    244241        devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
     
    276273        return -EINVAL;
    277274    }
    278 #ifdef CONFIG_DEVFS_FS
    279     if (strncmp(name, "controlC", 8) || card->number >= cards_limit) {
     275#ifndef TARGET_OS2
     276        if (strncmp(mptr->name, "controlC", 8) || card->number >= cards_limit) { /* created in sound.c */
    280277        devfs_remove("snd/%s", mptr->name);
    281278        class_simple_device_remove(MKDEV(major, minor));
     
    347344static int __init alsa_sound_init(void)
    348345{
    349 #ifdef CONFIG_DEVFS_FS
    350346    short controlnum;
    351 #endif
    352347#ifdef CONFIG_SND_OSSEMUL
    353348    int err;
     
    391386    snd_info_minor_register();
    392387#endif
    393 #ifdef CONFIG_DEVFS_FS
     388#ifndef TARGET_OS2
    394389    for (controlnum = 0; controlnum < cards_limit; controlnum++) {
    395390        devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum);
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c

    r281 r290  
    357357
    358358        uart->res_base = request_region(io_base, 8, "Serial MIDI");
    359         if (uart->res_base == NULL)
     359        if (uart->res_base == NULL) {
     360                snd_printk(KERN_ERR "u16550: can't grab port 0x%lx\n", io_base);
    360361                return -EBUSY;
     362        }
    361363
    362364    ok = 1;                     /* uart detected unless one of the following tests should fail */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/adriver.h

    r281 r290  
    8787#include <asm/page.h>
    8888#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3)
    89 #define pci_set_dma_mask(pci, mask) pci->dma_mask = mask
     89#define pci_set_dma_mask(pci, mask) (pci->dma_mask = mask, 0)
    9090#endif
    9191#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 7)
     
    157157#endif
    158158
    159 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
    160 #ifdef TARGET_OS2
    161 #include "isapnp.h"
    162 #else /* !TARGET_OS2 */
    163 #include <linux/isapnp.h>
    164 #endif /* !TARGET_OS2 */
    165 #ifndef CONFIG_PNP
    166 #define CONFIG_PNP
    167 #endif
    168 #if (defined(CONFIG_ISAPNP_KERNEL) && defined(ALSA_BUILD)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 30) && !defined(ALSA_BUILD))
    169 #define isapnp_dev pci_dev
    170 #define isapnp_card pci_bus
    171 #endif
    172 #undef __ISAPNP__
    173 #define __ISAPNP__
    174 #else
     159/* isapnp support for 2.2 kernels */
     160#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
     161#undef CONFIG_ISAPNP
     162#ifdef CONFIG_SND_ISAPNP
     163#define CONFIG_ISAPNP
     164#endif
     165#endif
     166
     167/* support of pnp compatible layer for 2.2/2.4 kernels */
    175168#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
    176169#undef CONFIG_PNP
     170#ifdef CONFIG_SND_PNP
     171#define CONFIG_PNP
    177172#endif
    178173#endif
     
    288283
    289284#ifndef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
    290 #define pci_set_consistent_dma_mask(p,x) pci_set_dma_mask(p,x)
     285#define pci_set_consistent_dma_mask(p,x) 0 /* success */
     286#endif
     287
     288/* sysfs */
     289#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2)
     290struct class_simple;
     291static inline void class_simple_device_add(struct class_simple *class, int devnum, ...) { return; }
     292static inline void class_simple_device_remove(int devnum) { return; }
    291293#endif
    292294
     
    298300#define ssleep(x) msleep((unsigned int)(x) * 1000)
    299301#endif
     302#endif
     303
     304#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
     305#define snd_card_set_dev(card,dev) /* no struct device */
    300306#endif
    301307
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/compat_22.h

    r281 r290  
    506506        { restore_flags(flags); }
    507507
    508 #ifndef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK
    509 #define pci_set_consistent_dma_mask(p,x) pci_set_dma_mask(p,x)
    510 #endif
    511 
    512508struct completion {
    513509        unsigned int done;
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/config.h

    r281 r290  
    175175#endif
    176176
    177 #ifndef snd_card_set_dev
    178 #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
    179 #endif
    180 
    181177/* for easier backward-porting */
    182178#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/core.h

    r260 r290  
    310310int snd_card_file_remove(struct snd_card *card, struct file *file);
    311311
     312#ifndef snd_card_set_dev
     313#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
     314#endif
     315
    312316/* device.c */
    313317
     
    333337int snd_task_name(struct task_struct *task, char *name, size_t size);
    334338#ifdef CONFIG_SND_VERBOSE_PRINTK
    335 void snd_verbose_printk(const char *file, int line, const char *format, ...);
     339void snd_verbose_printk(const char *file, int line, const char *format, ...)
     340     __attribute__ ((format (printf, 3, 4)));
    336341#endif
    337342#if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK)
    338 void snd_verbose_printd(const char *file, int line, const char *format, ...);
     343void snd_verbose_printd(const char *file, int line, const char *format, ...)
     344     __attribute__ ((format (printf, 3, 4)));
    339345#endif
    340346
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/emu8000.h

    r96 r290  
    114114void snd_emu8000_update_reverb_mode(emu8000_t *emu);
    115115void snd_emu8000_update_equalizer(emu8000_t *emu);
    116 int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void *buf, long len);
    117 int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void *buf, long len);
     116int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
     117int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len);
    118118
    119119#endif /* __SOUND_EMU8000_H */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm.h

    r61 r290  
    411411        struct snd_info_entry *proc_xrun_debug_entry;
    412412#endif
     413#ifdef CONFIG_SND_DEBUG
     414        unsigned int xrun_debug: 1;
     415        snd_info_entry_t *proc_xrun_debug_entry;
     416#endif
    413417};
    414418
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/version.h

    r281 r290  
    11/* include/version.h.  Generated by configure.  */
    2 #define CONFIG_SND_VERSION "1.0.1"
     2#define CONFIG_SND_VERSION "1.0.2"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a.c

    r277 r290  
    211211                return error;
    212212        }
     213        snd_card_set_dev(card, &pcard->card->dev);
    213214
    214215        if ((error = snd_ad1816a_create(card, port[dev],
     
    220221                return error;
    221222        }
     223
     224        strcpy(card->driver, "AD1816A");
     225        strcpy(card->shortname, "ADI SoundPort AD1816A");
     226        sprintf(card->longname, "%s, SS at 0x%lx, irq %d, dma %d&%d",
     227                card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
    222228
    223229        if ((error = snd_ad1816a_pcm(chip, 0, NULL)) < 0) {
     
    255261        }
    256262
    257         strcpy(card->driver, "AD1816A");
    258         strcpy(card->shortname, "ADI SoundPort AD1816A");
    259         sprintf(card->longname, "%s soundcard, SS at 0x%lx, irq %d, dma %d&%d",
    260                 card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
    261 
    262263        if ((error = snd_card_register(card)) < 0) {
    263264                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a_lib.c

    r256 r290  
    594594
    595595        if ((chip->res_port = request_region(port, 16, "AD1816A")) == NULL) {
     596                snd_printk(KERN_ERR "ad1816a: can't grab port 0x%lx\n", port);
    596597                snd_ad1816a_free(chip);
    597598                return -EBUSY;
    598599        }
    599600        if (request_irq(irq, snd_ad1816a_interrupt, SA_INTERRUPT, "AD1816A", (void *) chip)) {
     601                snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq);
    600602                snd_ad1816a_free(chip);
    601603                return -EBUSY;
     
    603605        chip->irq = irq;
    604606        if (request_dma(dma1, "AD1816A - 1")) {
     607                snd_printk(KERN_ERR "ad1816a: can't grab DMA1 %d\n", dma1);
    605608                snd_ad1816a_free(chip);
    606609                return -EBUSY;
     
    608611        chip->dma1 = dma1;
    609612        if (request_dma(dma2, "AD1816A - 2")) {
     613                snd_printk(KERN_ERR "ad1816a: can't grab DMA2 %d\n", dma2);
    610614                snd_ad1816a_free(chip);
    611615                return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848_lib.c

    r281 r290  
    953953       
    954954        if ((chip->res_port = request_region(port, 4, "AD1848")) == NULL) {
     955                snd_printk(KERN_ERR "ad1848: can't grab port 0x%lx\n", port);
    955956                snd_ad1848_free(chip);
    956957                return -EBUSY;
    957958        }
    958959        if (request_irq(irq, snd_ad1848_interrupt, SA_INTERRUPT, "AD1848", (void *) chip)) {
     960                snd_printk(KERN_ERR "ad1848: can't grab IRQ %d\n", irq);
    959961                snd_ad1848_free(chip);
    960962                return -EBUSY;
     
    962964        chip->irq = irq;
    963965        if (request_dma(dma, "AD1848")) {
     966                snd_printk(KERN_ERR "ad1848: can't grab DMA %d\n", dma);
    964967                snd_ad1848_free(chip);
    965968                return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/als100.c

    r281 r290  
    229229                return error;
    230230        }
     231        snd_card_set_dev(card, &pcard->card->dev);
    231232
    232233        if ((error = snd_sbdsp_create(card, port[dev],
     
    239240                return error;
    240241        }
     242
     243        strcpy(card->driver, "ALS100");
     244        strcpy(card->shortname, "Avance Logic ALS100");
     245        sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
     246                card->shortname, chip->name, chip->port,
     247                irq[dev], dma8[dev], dma16[dev]);
    241248
    242249        if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
     
    276283        }
    277284
    278         strcpy(card->driver, "ALS100");
    279         strcpy(card->shortname, "Avance Logic ALS100");
    280         sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d&%d",
    281                 card->shortname, chip->name, chip->port,
    282                 irq[dev], dma8[dev], dma16[dev]);
    283285        if ((error = snd_card_register(card)) < 0) {
    284286                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/azt2320.c

    r281 r290  
    256256                return error;
    257257        }
     258        snd_card_set_dev(card, &pcard->card->dev);
    258259
    259260        if ((error = snd_card_azt2320_enable_wss(port[dev]))) {
     
    270271                return error;
    271272        }
     273
     274        strcpy(card->driver, "AZT2320");
     275        strcpy(card->shortname, "Aztech AZT2320");
     276        sprintf(card->longname, "%s, WSS at 0x%lx, irq %i, dma %i&%i",
     277                card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
    272278
    273279        if ((error = snd_cs4231_pcm(chip, 0, NULL)) < 0) {
     
    310316        }
    311317
    312         strcpy(card->driver, "AZT2320");
    313         strcpy(card->shortname, "Aztech AZT2320");
    314         sprintf(card->longname, "%s soundcard, WSS at 0x%lx, irq %i, dma %i&%i",
    315                 card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
    316 
    317318        if ((error = snd_card_register(card)) < 0) {
    318319                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cmi8330.c

    r277 r290  
    486486
    487487#ifdef CONFIG_PNP
    488         if (isapnp[dev] && (err = snd_cmi8330_pnp(dev, acard, pcard, pid)) < 0) {
     488        if (isapnp[dev]) {
     489                if ((err = snd_cmi8330_pnp(dev, acard, pcard, pid)) < 0) {
    489490                snd_printk("PnP detection failed\n");
    490491                snd_card_free(card);
    491492                return err;
     493        }
     494                snd_card_set_dev(card, &pcard->card->dev);
    492495        }
    493496#endif
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231.c

    r281 r290  
    118118                return err;
    119119        }
     120
     121        strcpy(card->driver, "CS4231");
     122        strcpy(card->shortname, pcm->name);
     123        sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
     124                pcm->name, chip->port, irq[dev], dma1[dev]);
     125        if (dma2[dev] >= 0)
     126                sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
     127
    120128        if ((err = snd_cs4231_mixer(chip)) < 0) {
    121129                snd_card_free(card);
     
    137145                        printk(KERN_ERR "cs4231: MPU401 not detected\n");
    138146        }
    139         strcpy(card->driver, "CS4231");
    140         strcpy(card->shortname, pcm->name);
    141         sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
    142                 pcm->name, chip->port, irq[dev], dma1[dev]);
    143         if (dma2[dev] >= 0)
    144                 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
    145147        if ((err = snd_card_register(card)) < 0) {
    146148                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c

    r250 r290  
    15321532
    15331533        if ((chip->res_port = request_region(port, 4, "CS4231")) == NULL) {
     1534                snd_printk(KERN_ERR "cs4231: can't grab port 0x%lx\n", port);
    15341535                snd_cs4231_free(chip);
    15351536                return -EBUSY;
     
    15371538        chip->port = port;
    15381539        if ((long)cport >= 0 && (chip->res_cport = request_region(cport, 8, "CS4232 Control")) == NULL) {
     1540                snd_printk(KERN_ERR "cs4231: can't grab control port 0x%lx\n", cport);
    15391541                snd_cs4231_free(chip);
    15401542                return -ENODEV;
     
    15421544        chip->cport = cport;
    15431545        if (!(hwshare & CS4231_HWSHARE_IRQ) && request_irq(irq, snd_cs4231_interrupt, SA_INTERRUPT, "CS4231", (void *) chip)) {
     1546                snd_printk(KERN_ERR "cs4231: can't grab IRQ %d\n", irq);
    15441547                snd_cs4231_free(chip);
    15451548                return -EBUSY;
     
    15471550        chip->irq = irq;
    15481551        if (!(hwshare & CS4231_HWSHARE_DMA1) && request_dma(dma1, "CS4231 - 1")) {
     1552                snd_printk(KERN_ERR "cs4231: can't grab DMA1 %d\n", dma1);
    15491553                snd_cs4231_free(chip);
    15501554                return -EBUSY;
     
    15521556        chip->dma1 = dma1;
    15531557        if (!(hwshare & CS4231_HWSHARE_DMA2) && dma1 != dma2 && dma2 >= 0 && request_dma(dma2, "CS4231 - 2")) {
     1558                snd_printk(KERN_ERR "cs4231: can't grab DMA2 %d\n", dma2);
    15541559                snd_cs4231_free(chip);
    15551560                return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236.c

    r281 r290  
    459459        card->private_free = snd_card_cs4236_free;
    460460#ifdef CONFIG_PNP
    461         if (isapnp[dev] && (err = snd_card_cs4236_pnp(dev, acard, pcard, pid))<0) {
     461        if (isapnp[dev]) {
     462                if ((err = snd_card_cs4236_pnp(dev, acard, pcard, pid))<0) {
    462463                printk(KERN_ERR "isapnp detection failed and probing for " IDENT " is not supported\n");
    463464                snd_card_free(card);
    464465                return -ENXIO;
     466        }
     467                snd_card_set_dev(card, &pcard->card->dev);
    465468        }
    466469#endif
     
    516519        }
    517520#endif
     521        strcpy(card->driver, pcm->name);
     522        strcpy(card->shortname, pcm->name);
     523        sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
     524                pcm->name,
     525                chip->port,
     526                irq[dev],
     527                dma1[dev]);
     528        if (dma2[dev] >= 0)
     529                sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
    518530
    519531        if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0) {
     
    544556                        printk(KERN_ERR IDENT ": MPU401 not detected\n");
    545557        }
    546         strcpy(card->driver, pcm->name);
    547         strcpy(card->shortname, pcm->name);
    548         sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
    549                 pcm->name,
    550                 chip->port,
    551                 irq[dev],
    552                 dma1[dev]);
    553         if (dma2[dev] >= 0)
    554                 sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
    555558        if ((err = snd_card_register(card)) < 0) {
    556559                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c

    r281 r290  
    211211        acard = (struct snd_card_dt019x *)card->private_data;
    212212
     213        snd_card_set_dev(card, &pcard->card->dev);
    213214        if ((error = snd_card_dt019x_pnp(dev, acard, pcard, pid))) {
    214215                snd_card_free(card);
     
    226227                return error;
    227228        }
     229
     230        strcpy(card->driver, "DT-019X");
     231        strcpy(card->shortname, "Diamond Tech. DT-019X");
     232        sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
     233                card->shortname, chip->name, chip->port,
     234                irq[dev], dma8[dev]);
    228235
    229236        if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
     
    268275        }
    269276
    270         strcpy(card->driver, "DT-019X");
    271         strcpy(card->shortname, "Diamond Tech. DT-019X");
    272         sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
    273                 card->shortname, chip->name, chip->port,
    274                 irq[dev], dma8[dev]);
    275277        if ((error = snd_card_register(card)) < 0) {
    276278                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688.c

    r277 r290  
    135135        }
    136136
     137        strcpy(card->driver, "ES1688");
     138        strcpy(card->shortname, pcm->name);
     139        sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, xirq, xdma);
     140
    137141        if ((snd_opl3_create(card, chip->port, chip->port + 2, OPL3_HW_OPL3, 0, &opl3)) < 0) {
    138142                printk(KERN_ERR "es1688: opl3 not detected at 0x%lx\n", chip->port);
     
    154158                }
    155159        }
    156         strcpy(card->driver, "ES1688");
    157         strcpy(card->shortname, pcm->name);
    158         sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, xirq, xdma);
    159160        if ((err = snd_card_register(card)) < 0) {
    160161                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688_lib.c

    r246 r290  
    660660       
    661661        if ((chip->res_port = request_region(port + 4, 12, "ES1688")) == NULL) {
     662                snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4);
    662663                snd_es1688_free(chip);
    663664                return -EBUSY;
    664665        }
    665666        if (request_irq(irq, snd_es1688_interrupt, SA_INTERRUPT, "ES1688", (void *) chip)) {
     667                snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
    666668                snd_es1688_free(chip);
    667669                return -EBUSY;
     
    669671        chip->irq = irq;
    670672        if (request_dma(dma8, "ES1688")) {
     673                snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8);
    671674                snd_es1688_free(chip);
    672675                return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c

    r277 r290  
    14721472                chip->ctrl_port += inb(chip->port + 0x05);
    14731473
    1474                 if ((chip->res_ctrl_port = request_region(chip->ctrl_port, 8, "ES18xx - CTRL")) == NULL)
     1474                if ((chip->res_ctrl_port = request_region(chip->ctrl_port, 8, "ES18xx - CTRL")) == NULL) {
     1475                        snd_printk(KERN_ERR PFX "unable go grab port 0x%lx\n", chip->ctrl_port);
    14751476                        return -EBUSY;
     1477                }
    14761478
    14771479                return 0;
     
    20642066        acard = (struct snd_audiodrive *)card->private_data;
    20652067#ifdef CONFIG_PNP
    2066         if (isapnp[dev] && (err = snd_audiodrive_pnp(dev, acard, pcard, pid)) < 0) {
     2068        if (isapnp[dev]) {
     2069                if ((err = snd_audiodrive_pnp(dev, acard, pcard, pid)) < 0) {
    20672070                snd_card_free(card);
    20682071                return err;
     2072        }
     2073                snd_card_set_dev(card, &pcard->card->dev);
    20692074        }
    20702075#endif
     
    21042109                return err;
    21052110        }
     2111
     2112        sprintf(card->driver, "ES%x", chip->version);
     2113        sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
     2114        if (xdma1 != xdma2)
     2115                sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
     2116                        card->shortname,
     2117                        chip->port,
     2118                        xirq, xdma1, xdma2);
     2119        else
     2120                sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
     2121                        card->shortname,
     2122                        chip->port,
     2123                        xirq, xdma1);
     2124
    21062125        if ((err = snd_es18xx_pcm(chip, 0, NULL)) < 0) {
    21072126                snd_card_free(card);
     
    21452164        }
    21462165#endif
    2147         sprintf(card->driver, "ES%x", chip->version);
    2148         sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
    2149         if (xdma1 != xdma2)
    2150         sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
    2151                 card->shortname,
    2152                 chip->port,
    2153                 xirq, xdma1, xdma2);
    2154         else
    2155                 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
    2156                         card->shortname,
    2157                         chip->port,
    2158                         xirq, xdma1);
    21592166        if ((err = snd_card_register(card)) < 0) {
    21602167                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_main.c

    r256 r290  
    179179        /* allocate resources */
    180180        if ((gus->gf1.res_port1 = request_region(port, 16, "GUS GF1 (Adlib/SB)")) == NULL) {
     181                snd_printk(KERN_ERR "gus: can't grab SB port 0x%lx\n", port);
    181182                snd_gus_free(gus);
    182183                return -EBUSY;
    183184        }
    184185        if ((gus->gf1.res_port2 = request_region(port + 0x100, 12, "GUS GF1 (Synth)")) == NULL) {
     186                snd_printk(KERN_ERR "gus: can't grab synth port 0x%lx\n", port + 0x100);
    185187                snd_gus_free(gus);
    186188                return -EBUSY;
    187189        }
    188190        if (irq >= 0 && request_irq(irq, snd_gus_interrupt, SA_INTERRUPT, "GUS GF1", (void *) gus)) {
     191                snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
    189192                snd_gus_free(gus);
    190193                return -EBUSY;
     
    192195        gus->gf1.irq = irq;
    193196        if (request_dma(dma1, "GUS - 1")) {
     197                snd_printk(KERN_ERR "gus: can't grab DMA1 %d\n", dma1);
    194198                snd_gus_free(gus);
    195199                return -EBUSY;
     
    198202        if (dma2 >= 0 && dma1 != dma2) {
    199203                if (request_dma(dma2, "GUS - 2")) {
     204                        snd_printk(KERN_ERR "gus: can't grab DMA2 %d\n", dma2);
    200205                        snd_gus_free(gus);
    201206                        return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/interwave.c

    r281 r290  
    245245                iwcard->i2c_res = request_region(port, 1, "InterWave (I2C bus)");
    246246        }
    247         if (iwcard->i2c_res == NULL)
     247        if (iwcard->i2c_res == NULL) {
     248                snd_printk(KERN_ERR "interwave: can't grab i2c bus port\n");
    248249                return -ENODEV;
     250        }
    249251
    250252        sprintf(name, "InterWave-%i", card->number);
     
    712714        card->private_free = snd_interwave_free;
    713715#ifdef CONFIG_PNP
    714         if (isapnp[dev] && snd_interwave_pnp(dev, iwcard, pcard, pid)) {
     716        if (isapnp[dev]) {
     717                if (snd_interwave_pnp(dev, iwcard, pcard, pid)) {
    715718                snd_card_free(card);
    716719                return -ENODEV;
     720        }
     721                snd_card_set_dev(card, &pcard->card->dev);
    717722        }
    718723#endif
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c

    r277 r290  
    245245        card = chip->card;
    246246        port = chip->port;
    247         if ((chip->res_port = request_region(port, 2, "OPL3-SA control")) == NULL)
     247        if ((chip->res_port = request_region(port, 2, "OPL3-SA control")) == NULL) {
     248                snd_printk(KERN_ERR "opl3sa2: can't grab port 0x%lx\n", port);
    248249                return -EBUSY;
     250        }
    249251        // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a));
    250252        chip->version = 0;
     
    726728                goto __error;
    727729#ifdef CONFIG_PNP
    728         if (isapnp[dev] && (err = snd_opl3sa2_pnp(dev, chip, pcard, pid)) < 0)
    729                 goto __error;
     730        if (isapnp[dev]) {
     731                if ((err = snd_opl3sa2_pnp(dev, chip, pcard, pid)) < 0)
     732                goto __error;
     733                snd_card_set_dev(card, &pcard->card->dev);
     734        }
    730735#endif
    731736        chip->ymode = opl3sa3_ymode[dev] & 0x03 ; /* initialise this card from supplied (or default) parameter*/
     
    740745                goto __error;
    741746        if (request_irq(xirq, snd_opl3sa2_interrupt, SA_INTERRUPT, "OPL3-SA2/3", (void *)chip)) {
     747                snd_printk(KERN_ERR "opl3sa2: can't grab IRQ %d\n", xirq);
    742748                err = -ENODEV;
    743749                goto __error;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c

    r281 r290  
    13061306
    13071307        if ((codec->res_port = request_region(chip->wss_base + 4, 4, "OPTI93x CODEC")) == NULL) {
     1308                snd_printk(KERN_ERR "opti9xx: can't grab port 0x%lx\n", chip->wss_base + 4);
    13081309                snd_opti93x_free(codec);
    13091310                return -EBUSY;
    13101311        }
    13111312        if (request_dma(dma1, "OPTI93x - 1")) {
     1313                snd_printk(KERN_ERR "opti9xx: can't grab DMA1 %d\n", dma1);
    13121314                snd_opti93x_free(codec);
    13131315                return -EBUSY;
     
    13151317        codec->dma1 = chip->dma1;
    13161318        if (request_dma(dma2, "OPTI93x - 2")) {
     1319                snd_printk(KERN_ERR "opti9xx: can't grab DMA2 %d\n", dma2);
    13171320                snd_opti93x_free(codec);
    13181321                return -EBUSY;
     
    13211324
    13221325        if (request_irq(chip->irq, snd_opti93x_interrupt, SA_INTERRUPT, DRIVER_NAME" - WSS", codec)) {
     1326                snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", chip->irq);
    13231327          snd_opti93x_free(codec);
    13241328          return -EBUSY;
     
    19701974                if (hw <= OPTi9XX_HW_82C930)
    19711975                        chip->mc_base -= 0x80;
     1976                snd_card_set_dev(card, &pcard->card->dev);
    19721977        } else {
    19731978#endif  /* CONFIG_PNP */
     
    21022107        }
    21032108#endif
     2109        strcpy(card->driver, chip->name);
     2110        sprintf(card->shortname, "OPTi %s", card->driver);
     2111#if defined(CS4231) || defined(OPTi93X)
     2112        sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
     2113                card->shortname, pcm->name, chip->wss_base + 4,
     2114                chip->irq, chip->dma1, chip->dma2);
     2115#else
     2116        sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
     2117                card->shortname, pcm->name, chip->wss_base + 4,
     2118                chip->irq, chip->dma1);
     2119#endif  /* CS4231 || OPTi93X */
    21042120
    21052121        if (chip->mpu_port <= 0 || chip->mpu_port == SNDRV_AUTO_PORT)
     
    21552171        }
    21562172
    2157         strcpy(card->driver, chip->name);
    2158         sprintf(card->shortname, "OPTi %s", card->driver);
    2159 #if defined(CS4231) || defined(OPTi93X)
    2160         sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d&%d",
    2161                 card->shortname, pcm->name, chip->wss_base + 4,
    2162                 chip->irq, chip->dma1, chip->dma2);
    2163 #else
    2164         sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
    2165                 card->shortname, pcm->name, chip->wss_base + 4,
    2166                 chip->irq, chip->dma1);
    2167 #endif  /* CS4231 || OPTi93X */
    21682173        if ((error = snd_card_register(card))) {
    21692174                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c

    r277 r290  
    656656
    657657/*exported*/ int
    658 snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void *buf, long len)
     658snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
    659659{
    660660        soundfont_chorus_fx_t rec;
     
    783783
    784784/*exported*/ int
    785 snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void *buf, long len)
     785snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len)
    786786{
    787787        soundfont_reverb_fx_t rec;
     
    11131113            !(hw->res_port2 = request_region(hw->port2, 4, "Emu8000-2")) ||
    11141114            !(hw->res_port3 = request_region(hw->port3, 4, "Emu8000-3"))) {
     1115                snd_printk(KERN_ERR "sbawe: can't grab ports 0x%lx, 0x%lx, 0x%lx\n", hw->port1, hw->port2, hw->port3);
    11151116                snd_emu8000_free(hw);
    11161117                return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_callback.c

    r210 r290  
    3737static int oss_ioctl(snd_emux_t *emu, int cmd, int p1, int p2);
    3838#endif
    39 static int load_fx(snd_emux_t *emu, int type, int mode, const void *buf, long len);
     39static int load_fx(snd_emux_t *emu, int type, int mode, const void __user *buf, long len);
    4040
    4141static void set_pitch(emu8000_t *hw, snd_emux_voice_t *vp);
     
    524524
    525525static int
    526 load_fx(snd_emux_t *emu, int type, int mode, const void *buf, long len)
     526load_fx(snd_emux_t *emu, int type, int mode, const void __user *buf, long len)
    527527{
    528528        emu8000_t *hw;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_local.h

    r207 r290  
    3333
    3434/* emu8000_patch.c */
    35 int snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *data, long count);
     35int snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
    3636int snd_emu8000_sample_free(snd_emux_t *rec, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
    3737void snd_emu8000_sample_reset(snd_emux_t *rec);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_patch.c

    r277 r290  
    8383 */
    8484static unsigned short
    85 read_word(const void *buf, int offset, int mode)
     85read_word(const void __user *buf, int offset, int mode)
    8686{
    8787        unsigned short c;
     
    147147int
    148148snd_emu8000_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp,
    149                        snd_util_memhdr_t *hdr, const void *data, long count)
     149                       snd_util_memhdr_t *hdr, const void __user *data, long count)
    150150{
    151151        int  i;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_synth.c

    r207 r290  
    7272        emu->midi_devidx = 1;
    7373        emu->linear_panning = 1;
     74        emu->hwdep_idx = 2; /* FIXED */
    7475
    7576        if (snd_emux_register(emu, dev->card, hw->index, "Emu8000") < 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c

    r277 r290  
    150150                return error;
    151151        }
     152        snd_card_set_dev(card, &pcard->card->dev);
    152153
    153154        if ((error = snd_sbdsp_create(card, port[dev],
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c

    r281 r290  
    8282#endif
    8383static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* 0x220,0x240,0x260,0x280 */
    84 #ifdef TARGET_OS2
    85 static long mpu_port[SNDRV_CARDS] = {0x330, 0x300, -1,-1,-1,-1,-1,-1};
    86 #else
    87 static long mpu_port[SNDRV_CARDS] = {0x330, 0x300,[2 ... (SNDRV_CARDS - 1)] = -1};
    88 #endif
     84static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */
    8985static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
    9086#ifdef SNDRV_SBAWE_EMU8000
     
    175171
    176172static snd_card_t *snd_sb16_legacy[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
     173
     174#ifdef CONFIG_PNP
    177175
    178176static struct pnp_card_device_id snd_sb16_pnpids[] = {
     
    269267MODULE_DEVICE_TABLE(pnp_card, snd_sb16_pnpids);
    270268
     269#endif /* CONFIG_PNP */
     270
    271271#ifdef SNDRV_SBAWE_EMU8000
    272272#define DRIVER_NAME     "snd-card-sbawe"
     
    412412                        return err;
    413413                }
     414                snd_card_set_dev(card, &pcard->card->dev);
    414415        }
    415416#endif
     
    484485        }
    485486
    486         if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
    487             if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
    488                                            chip->mpu_port, 0,
    489                                                xirq, 0, &chip->rmidi)) < 0) {
    490                 snd_card_free(card);
    491                 return -ENXIO;
    492             }
    493                 chip->rmidi_callback = snd_mpu401_uart_interrupt;
    494         }
    495 
    496 #ifdef SNDRV_SBAWE_EMU8000
    497         if (awe_port[dev] == SNDRV_AUTO_PORT)
    498                 awe_port[dev] = 0; /* disable */
    499 #endif
    500 
    501         if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
    502                 if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
    503                                     OPL3_HW_OPL3,
    504                                     fm_port[dev] == port[dev] || fm_port[dev] == 0x388,
    505                                 &opl3) < 0) {
    506                         snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
    507                                    fm_port[dev], fm_port[dev] + 2);
    508             } else {
    509 #ifdef SNDRV_SBAWE_EMU8000
    510                         int seqdev = awe_port[dev] > 0 ? 2 : 1;
    511 #else
    512                 int seqdev = 1;
    513 #endif
    514                 if ((err = snd_opl3_hwdep_new(opl3, 0, seqdev, &synth)) < 0) {
    515                     snd_card_free(card);
    516                     return -ENXIO;
    517                 }
    518             }
    519         }
    520 
    521         if ((err = snd_sbmixer_new(chip)) < 0) {
    522             snd_card_free(card);
    523             return -ENXIO;
    524         }
    525 
    526 #ifdef CONFIG_SND_SB16_CSP
    527         /* CSP chip on SB16ASP/AWE32 */
    528         if ((chip->hardware == SB_HW_16) && csp[dev]) {
    529                 snd_sb_csp_new(chip, synth != NULL ? 1 : 0, &xcsp);
    530                 if (xcsp) {
    531                         chip->csp = xcsp->private_data;
    532                 chip->hardware = SB_HW_16CSP;
    533             } else {
    534                         snd_printk(KERN_INFO PFX "warning - CSP chip not detected on soundcard #%i\n", dev + 1);
    535             }
    536         }
    537 #endif
    538 #ifdef SNDRV_SBAWE_EMU8000
    539         if (awe_port[dev] > 0) {
    540                 if (snd_emu8000_new(card, 1, awe_port[dev],
    541                                     seq_ports[dev], NULL) < 0) {
    542                         snd_printk(KERN_ERR PFX "fatal error - EMU-8000 synthesizer not detected at 0x%lx\n", awe_port[dev]);
    543                 snd_card_free(card);
    544                 return -ENXIO;
    545             }
    546         }
    547 #endif
    548 
    549         /* setup Mic AGC */
    550         spin_lock_irqsave(&chip->mixer_lock, flags);
    551         snd_sbmixer_write(chip, SB_DSP4_MIC_AGC,
    552                           (snd_sbmixer_read(chip, SB_DSP4_MIC_AGC) & 0x01) |
    553                 (mic_agc[dev] ? 0x00 : 0x01));
    554         spin_unlock_irqrestore(&chip->mixer_lock, flags);
    555 
    556         strcpy(card->driver,
     487        strcpy(card->driver,
    557488#ifdef SNDRV_SBAWE_EMU8000
    558489                        awe_port[dev] > 0 ? "SB AWE" :
     
    569500            sprintf(card->longname + strlen(card->longname), "%s%d",
    570501                        xdma8 >= 0 ? "&" : "", xdma16);
     502
     503        if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
     504                if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
     505                                               chip->mpu_port, 0,
     506                                               xirq, 0, &chip->rmidi)) < 0) {
     507                        snd_card_free(card);
     508                        return -ENXIO;
     509                }
     510                chip->rmidi_callback = snd_mpu401_uart_interrupt;
     511        }
     512
     513#ifdef SNDRV_SBAWE_EMU8000
     514        if (awe_port[dev] == SNDRV_AUTO_PORT)
     515                awe_port[dev] = 0; /* disable */
     516#endif
     517
     518        if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
     519                if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
     520                                    OPL3_HW_OPL3,
     521                                    acard->fm_res != NULL || fm_port[dev] == port[dev],
     522                                    &opl3) < 0) {
     523                        snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
     524                                   fm_port[dev], fm_port[dev] + 2);
     525                } else {
     526#ifdef SNDRV_SBAWE_EMU8000
     527                        int seqdev = awe_port[dev] > 0 ? 2 : 1;
     528#else
     529                        int seqdev = 1;
     530#endif
     531                        if ((err = snd_opl3_hwdep_new(opl3, 0, seqdev, &synth)) < 0) {
     532                                snd_card_free(card);
     533                                return -ENXIO;
     534                        }
     535                }
     536        }
     537
     538        if ((err = snd_sbmixer_new(chip)) < 0) {
     539                snd_card_free(card);
     540                return -ENXIO;
     541        }
     542
     543#ifdef CONFIG_SND_SB16_CSP
     544        /* CSP chip on SB16ASP/AWE32 */
     545        if ((chip->hardware == SB_HW_16) && csp[dev]) {
     546                snd_sb_csp_new(chip, synth != NULL ? 1 : 0, &xcsp);
     547                if (xcsp) {
     548                        chip->csp = xcsp->private_data;
     549                        chip->hardware = SB_HW_16CSP;
     550                } else {
     551                        snd_printk(KERN_INFO PFX "warning - CSP chip not detected on soundcard #%i\n", dev + 1);
     552                }
     553        }
     554#endif
     555#ifdef SNDRV_SBAWE_EMU8000
     556        if (awe_port[dev] > 0) {
     557                if (snd_emu8000_new(card, 1, awe_port[dev],
     558                                    seq_ports[dev], NULL) < 0) {
     559                        snd_printk(KERN_ERR PFX "fatal error - EMU-8000 synthesizer not detected at 0x%lx\n", awe_port[dev]);
     560                        snd_card_free(card);
     561                        return -ENXIO;
     562                }
     563        }
     564#endif
     565
     566        /* setup Mic AGC */
     567        spin_lock_irqsave(&chip->mixer_lock, flags);
     568        snd_sbmixer_write(chip, SB_DSP4_MIC_AGC,
     569                (snd_sbmixer_read(chip, SB_DSP4_MIC_AGC) & 0x01) |
     570                (mic_agc[dev] ? 0x00 : 0x01));
     571        spin_unlock_irqrestore(&chip->mixer_lock, flags);
     572
    571573        if ((err = snd_card_register(card)) < 0) {
    572574            snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb_common.c

    r256 r290  
    236236                    SA_INTERRUPT | SA_SHIRQ : SA_INTERRUPT,
    237237                    "SoundBlaster", (void *) chip)) {
     238                snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
    238239        snd_sbdsp_free(chip);
    239240        return -EBUSY;
     
    245246
    246247    if ((chip->res_port = request_region(port, 16, "SoundBlaster")) == NULL) {
     248                snd_printk(KERN_ERR "sb: can't grab port 0x%lx\n", port);
    247249        snd_sbdsp_free(chip);
    248250        return -EBUSY;
     
    251253#ifdef CONFIG_ISA
    252254    if (dma8 >= 0 && request_dma(dma8, "SoundBlaster - 8bit")) {
     255                snd_printk(KERN_ERR "sb: can't grab DMA8 %d\n", dma8);
    253256        snd_sbdsp_free(chip);
    254257        return -EBUSY;
     
    260263                        dma16 = -1;
    261264                } else if (request_dma(dma16, "SoundBlaster - 16bit")) {
     265                        snd_printk(KERN_ERR "sb: can't grab DMA16 %d\n", dma16);
    262266        snd_sbdsp_free(chip);
    263267        return -EBUSY;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sgalaxy.c

    r277 r290  
    151151                return -EINVAL;
    152152
    153         if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL))
     153        if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL)) {
     154                snd_printk(KERN_ERR "sgalaxy: can't grab irq %d\n", irq);
    154155                return -EIO;
     156        }
    155157
    156158        outb(tmp | 0x40, port);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c

    r281 r290  
    450450
    451451#ifdef CONFIG_PNP
    452         if (isapnp[dev] && snd_wavefront_pnp (dev, acard, pcard, pid) < 0) {
     452        if (isapnp[dev]) {
     453                if (snd_wavefront_pnp (dev, acard, pcard, pid) < 0) {
    453454                if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
    454455                        snd_printk ("isapnp detection failed\n");
     
    456457                        return -ENODEV;
    457458                }
     459        }
     460                snd_card_set_dev(card, &pcard->card->dev);
    458461        }
    459462#endif /* CONFIG_PNP */
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ac97/ac97_patch.c

    r206 r290  
    21612161        unsigned short misc;
    21622162
    2163         patch_ad1881(ac97);
    21642163        ac97->build_ops = &patch_ad1985_build_ops;
    21652164        misc = snd_ac97_read(ac97, AC97_AD_MISC);
     
    21672166        /* AD-compatible mode */
    21682167        /* Stereo mutes enabled */
     2168        /* in accordance with ADI driver: misc | 0x5c28 */
    21692169        snd_ac97_write_cache(ac97, AC97_AD_MISC, misc |
    21702170                             AC97_AD198X_LOSEL |
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ali5451/ali5451.c

    r210 r290  
    21162116        return err;
    21172117    /* check, if we can restrict PCI DMA transfers to 31 bits */
    2118     if (!pci_dma_supported(pci, 0x7fffffff)) {
     2118        if (pci_set_dma_mask(pci, 0x7fffffff) < 0 ||
     2119            pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) {
    21192120        snd_printk("architecture does not support 31bit PCI busmaster DMA\n");
    21202121        return -ENXIO;
    21212122    }
    2122     pci_set_dma_mask(pci, 0x7fffffff);
    21232123
    21242124    if ((codec = kcalloc(1, sizeof(*codec), GFP_KERNEL)) == NULL)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c

    r281 r290  
    626626    }
    627627    /* check, if we can restrict PCI DMA transfers to 24 bits */
    628     if (!pci_dma_supported(pci, 0x00ffffff)) {
     628        if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
     629            pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
    629630        snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
    630631        return -ENXIO;
    631632    }
    632     pci_set_dma_mask(pci, 0x00ffffff);
    633633
    634634    if ((err = pci_request_regions(pci, "ALS4000")) < 0)
     
    686686    chip->pci = pci;
    687687    chip->alt_port = gcr;
     688        snd_card_set_dev(card, &pci->dev);
    688689
    689690    snd_als4000_configure(chip);
     691
     692        strcpy(card->driver, "ALS4000");
     693        strcpy(card->shortname, "Avance Logic ALS4000");
     694        sprintf(card->longname, "%s at 0x%lx, irq %i",
     695                card->shortname, chip->alt_port, chip->irq);
    690696
    691697    if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000,
     
    723729        }
    724730#endif
    725     strcpy(card->driver, "ALS4000");
    726     strcpy(card->shortname, "Avance Logic ALS4000");
    727     sprintf(card->longname, "%s at 0x%lx, irq %i",
    728             card->shortname, chip->alt_port, chip->irq);
    729731
    730732    if ((err = snd_card_register(card)) < 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c

    r281 r290  
    15491549    runtime->hw.channels_max = cm->max_channels;
    15501550    snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000);
     1551        cm->dig_pcm_status = cm->dig_status;
    15511552    return 0;
    15521553}
     
    30053006        }
    30063007#endif
     3008        snd_card_set_dev(card, &pci->dev);
     3009
    30073010    *rcmipci = cm;
    30083011    return 0;
     
    32063209
    32073210/* format is: snd-cmipci=enable,index,id,
    3208                          mpu_port,fm_port,soft_ac3,joystick */
     3211                         mpu_port,fm_port,soft_ac3,joystick_port */
    32093212
    32103213static int __init alsa_card_cmipci_setup(char *str)
     
    32233226#endif
    32243227#ifdef SUPPORT_JOYSTICK
    3225                && get_option(&str,&joystick[nr_dev]) == 2
     3228               && get_option(&str,&joystick_port[nr_dev]) == 2
    32263229#endif
    32273230               );
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cs4281.c

    r250 r290  
    14471447    }
    14481448
     1449        snd_card_set_dev(card, &pci->dev);
     1450
    14491451    *rchip = chip;
    14501452    return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/memory.c

    r84 r290  
    539539 * copy_from_user(blk + offset, data, size)
    540540 */
    541 int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, snd_util_memblk_t *blk, int offset, const char *data, int size)
     541int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, snd_util_memblk_t *blk, int offset, const char __user *data, int size)
    542542{
    543543        int page, nextofs, end_offset, temp, temp1;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/es1968.c

    r277 r290  
    25732573                                       es1968_t **chip_ret)
    25742574{
    2575 #ifdef TARGET_OS2
    25762575    static snd_device_ops_t ops = {
    25772576                .dev_free =     snd_es1968_dev_free,
    25782577    };
    2579 #else
    2580     static snd_device_ops_t ops = {
    2581     dev_free:       snd_es1968_dev_free,
    2582     };
    2583 #endif
    25842578    es1968_t *chip;
    25852579    int i, err;
     
    25912585        return err;
    25922586    /* check, if we can restrict PCI DMA transfers to 28 bits */
    2593     if (!pci_dma_supported(pci, 0x0fffffff)) {
     2587        if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
     2588            pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
    25942589        snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
    25952590        return -ENXIO;
    25962591    }
    2597     pci_set_consistent_dma_mask(pci, 0x0fffffff);
    25982592
    25992593    chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
     
    26692663        return err;
    26702664    }
     2665
     2666        snd_card_set_dev(card, &pci->dev);
    26712667
    26722668    *chip_ret = chip;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ak4xxx.c

    r260 r290  
    176176}
    177177
     178static int __init alsa_ice1712_akm4xxx_module_init(void)
     179{
     180        return 0;
     181}
     182       
     183static void __exit alsa_ice1712_akm4xxx_module_exit(void)
     184{
     185}
     186       
     187module_init(alsa_ice1712_akm4xxx_module_init)
     188module_exit(alsa_ice1712_akm4xxx_module_exit)
     189
    178190EXPORT_SYMBOL(snd_ice1712_akm4xxx_init);
    179191EXPORT_SYMBOL(snd_ice1712_akm4xxx_free);
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c

    r281 r290  
    23642364                return err;
    23652365        /* check, if we can restrict PCI DMA transfers to 28 bits */
    2366         if (!pci_dma_supported(pci, 0x0fffffff)) {
     2366        if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
     2367            pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
    23672368                snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
    23682369                return -ENXIO;
    23692370        }
    2370         pci_set_consistent_dma_mask(pci, 0x0fffffff);
    23712371
    23722372        ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
     
    24462446        }
    24472447
     2448        snd_card_set_dev(card, &pci->dev);
     2449
    24482450        *r_ice1712 = ice;
    24492451        return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1724.c

    r281 r290  
    18021802        if ((err = pci_enable_device(pci)) < 0)
    18031803                return err;
    1804         pci_set_consistent_dma_mask(pci, 0xffffffff);
    18051804
    18061805        ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
     
    18661865        }
    18671866
     1867        snd_card_set_dev(card, &pci->dev);
     1868
    18681869        *r_ice1712 = ice;
    18691870        return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c

    r278 r290  
    778778}
    779779
     780#ifdef __i386__
     781/*
     782 * Intel 82443MX running a 100MHz processor system bus has a hardware bug,
     783 * which aborts PCI busmaster for audio transfer.  A workaround is to set
     784 * the pages as non-cached.  For details, see the errata in
     785 *      http://www.intel.com/design/chipsets/specupdt/245051.htm
     786 */
     787static void fill_nocache(void *buf, int size, int nocache)
     788{
     789        size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
     790        change_page_attr(virt_to_page(buf), size, nocache ? PAGE_KERNEL_NOCACHE : PAGE_KERNEL);
     791        global_flush_tlb();
     792}
     793#else
     794#define fill_nocache(buf,size,nocache)
     795#endif
     796
    780797/*
    781798 *  Interrupt handler
     
    980997    struct intel8x0 *chip = snd_pcm_substream_chip(substream);
    981998    struct ichdev *ichdev = get_ichdev(substream);
     999        struct snd_pcm_runtime *runtime = substream->runtime;
     1000        size_t size = params_buffer_bytes(hw_params);
    9821001    int dbl = params_rate(hw_params) > 48000;
    9831002    int err;
    9841003
     1004        if (chip->fix_nocache && runtime->dma_area && runtime->dma_bytes < size)
     1005                fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); /* clear */
    9851006    err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
    9861007    if (err < 0)
    9871008        return err;
     1009        if (chip->fix_nocache && err > 0)
     1010                fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
    9881011    if (ichdev->pcm_open_flag) {
    9891012        snd_ac97_pcm_close(ichdev->pcm);
     
    10041027static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream)
    10051028{
     1029        struct intel8x0 *chip = snd_pcm_substream_chip(substream);
    10061030    struct ichdev *ichdev = get_ichdev(substream);
    10071031
     
    10101034        ichdev->pcm_open_flag = 0;
    10111035    }
     1036        if (chip->fix_nocache && substream->runtime->dma_area)
     1037                fill_nocache(substream->runtime->dma_area, substream->runtime->dma_bytes, 0);
    10121038    return snd_pcm_lib_free_pages(substream);
    10131039}
     
    29582984    /* tables must be aligned to 8 bytes here, but the kernel pages
    29592985     are much bigger, so we don't care (on i386) */
    2960 
     2986        /* workaround for 440MX */
     2987        if (chip->fix_nocache)
     2988                fill_nocache(chip->bdbars, chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 1);
    29612989    int_sta_masks = 0;
    29622990    for (i = 0; i < chip->bdbars_count; i++) {
     
    30183046        return err;
    30193047    }
     3048
     3049        snd_card_set_dev(card, &pci->dev);
    30203050
    30213051    *r_intel8x0 = chip;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/korg1212/korg1212.c

    r281 r290  
    24622462        }
    24632463       
     2464        snd_card_set_dev(card, &pci->dev);
     2465
    24642466        * rchip = korg1212;
    24652467        return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/maestro3.c

    r250 r290  
    27062706
    27072707    /* check, if we can restrict PCI DMA transfers to 28 bits */
    2708     if (!pci_dma_supported(pci, 0x0fffffff)) {
     2708        if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
     2709            pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
    27092710        snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
    27102711        return -ENXIO;
    27112712    }
    2712     pci_set_consistent_dma_mask(pci, 0x0fffffff);
    27132713
    27142714    chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
     
    28292829    snd_m3_enable_ints(chip);
    28302830    snd_m3_assp_continue(chip);
     2831
     2832        snd_card_set_dev(card, &pci->dev);
    28312833
    28322834    *chip_ret = chip;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c

    r281 r290  
    25112511        rme96->card = card;
    25122512        rme96->pci = pci;
     2513        snd_card_set_dev(card, &pci->dev);
    25132514        if ((err = snd_rme96_create(rme96)) < 0) {
    25142515                snd_card_free(card);
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c

    r281 r290  
    49864986       
    49874987        pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
     4988       
     4989        /* From Martin Bjoernsen :
     4990            "It is important that the card's latency timer register in
     4991            the PCI configuration space is set to a value much larger
     4992            than 0 by the computer's BIOS or the driver.
     4993            The windows driver always sets this 8 bit register [...]
     4994            to its maximum 255 to avoid problems with some computers."
     4995        */
     4996        pci_write_config_byte(hdsp->pci, PCI_LATENCY_TIMER, 0xFF);
     4997       
    49884998        strcpy(card->driver, "H-DSP");
    49894999        strcpy(card->mixername, "Xilinx FPGA");
     
    51485158        hdsp->dev = dev;
    51495159        hdsp->pci = pci;
     5160        snd_card_set_dev(card, &pci->dev);
    51505161
    51515162        if ((err = snd_hdsp_create(card, hdsp, precise_ptr[dev])) < 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/rme9652.c

    r281 r290  
    27062706        rme9652->dev = dev;
    27072707        rme9652->pci = pci;
     2708        snd_card_set_dev(card, &pci->dev);
    27082709
    27092710        if ((err = snd_rme9652_create(card, rme9652, precise_ptr[dev])) < 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c

    r281 r290  
    12541254                return err;
    12551255        /* check, if we can restrict PCI DMA transfers to 24 bits */
    1256         if (!pci_dma_supported(pci, 0x00ffffff)) {
     1256        if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
     1257            pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
    12571258                snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
    12581259                return -ENXIO;
    12591260        }
    1260         pci_set_consistent_dma_mask(pci, 0x00ffffff);
    12611261
    12621262        sonic = snd_magic_kcalloc(sonicvibes_t, 0, GFP_KERNEL);
     
    13891389        }
    13901390
     1391        snd_card_set_dev(card, &pci->dev);
     1392
    13911393        *rsonic = sonic;
    13921394        return 0;
     
    14721474                return err;
    14731475        }
    1474         if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
    1475                 snd_card_free(card);
    1476                 return err;
    1477         }
    1478         if ((err = snd_sonicvibes_mixer(sonic)) < 0) {
    1479                 snd_card_free(card);
    1480                 return err;
    1481         }
    1482         if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
    1483                                        sonic->midi_port, 1,
    1484                                        sonic->irq, 0,
    1485                                        &midi_uart)) < 0) {
    1486                 snd_card_free(card);
    1487                 return err;
    1488         }
    1489         snd_sonicvibes_midi(sonic, midi_uart);
    1490         if ((err = snd_opl3_create(card, sonic->synth_port,
    1491                                    sonic->synth_port + 2,
    1492                                    OPL3_HW_OPL3_SV, 1, &opl3)) < 0) {
    1493                 snd_card_free(card);
    1494                 return err;
    1495         }
    1496         if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
    1497                 snd_card_free(card);
    1498                 return err;
    1499         }
    1500 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
    1501         sonic->gameport.io = sonic->game_port;
    1502         gameport_register_port(&sonic->gameport);
    1503 #endif
     1476
    15041477        strcpy(card->driver, "SonicVibes");
    15051478        strcpy(card->shortname, "S3 SonicVibes");
     
    15091482                pci_resource_start(pci, 1),
    15101483                sonic->irq);
     1484
     1485        if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
     1486                snd_card_free(card);
     1487                return err;
     1488        }
     1489        if ((err = snd_sonicvibes_mixer(sonic)) < 0) {
     1490                snd_card_free(card);
     1491                return err;
     1492        }
     1493        if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
     1494                                       sonic->midi_port, 1,
     1495                                       sonic->irq, 0,
     1496                                       &midi_uart)) < 0) {
     1497                snd_card_free(card);
     1498                return err;
     1499        }
     1500        snd_sonicvibes_midi(sonic, midi_uart);
     1501        if ((err = snd_opl3_create(card, sonic->synth_port,
     1502                                   sonic->synth_port + 2,
     1503                                   OPL3_HW_OPL3_SV, 1, &opl3)) < 0) {
     1504                snd_card_free(card);
     1505                return err;
     1506        }
     1507        if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
     1508                snd_card_free(card);
     1509                return err;
     1510        }
     1511#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
     1512        sonic->gameport.io = sonic->game_port;
     1513        gameport_register_port(&sonic->gameport);
     1514#endif
    15111515
    15121516        if ((err = snd_card_register(card)) < 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_main.c

    r256 r290  
    35403540        return err;
    35413541    /* check, if we can restrict PCI DMA transfers to 30 bits */
    3542     if (!pci_dma_supported(pci, 0x3fffffff)) {
     3542        if (pci_set_dma_mask(pci, 0x3fffffff) < 0 ||
     3543            pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) {
    35433544        snd_printk("architecture does not support 30bit PCI busmaster DMA\n");
    35443545        return -ENXIO;
    35453546    }
    3546     pci_set_dma_mask(pci, 0x3fffffff);
    35473547
    35483548    trident = kcalloc(1, sizeof(*trident), GFP_KERNEL);
     
    36403640        return err;
    36413641    }
     3642        snd_card_set_dev(card, &pci->dev);
    36423643    *rtrident = trident;
    36433644    return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci.c

    r281 r290  
    316316        }
    317317#endif
    318         strcpy(card->driver, str);
    319         sprintf(card->shortname, "Yamaha DS-XG PCI (%s)", str);
    320         sprintf(card->longname, "%s at 0x%lx, irq %i",
    321                 card->shortname,
    322                 chip->reg_area_phys,
    323                 chip->irq);
    324318
    325319        if ((err = snd_card_register(card)) < 0) {
Note: See TracChangeset for help on using the changeset viewer.