Changeset 358

Show
Ignore:
Timestamp:
07/16/08 11:53:49 (6 weeks ago)
Author:
psmedley
Message:

Update uniaud32-2.0 branch to ALSA 1.0.17

Location:
GPL/branches/uniaud32-2.0
Files:
2 added
89 modified

Legend:

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

    r318 r358  
    693693} 
    694694 
    695 int snd_ctl_elem_read(struct snd_card *card, struct snd_ctl_elem_value *control) 
     695static int snd_ctl_elem_read(struct snd_card *card, 
     696                             struct snd_ctl_elem_value *control) 
    696697{ 
    697698        struct snd_kcontrol *kctl; 
     
    743744} 
    744745 
    745 int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, 
    746                        struct snd_ctl_elem_value *control) 
     746static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, 
     747                              struct snd_ctl_elem_value *control) 
    747748{ 
    748749        struct snd_kcontrol *kctl; 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/info.c

    r305 r358  
    572572        struct proc_dir_entry *p; 
    573573 
    574         p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, &proc_root); 
     574        p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL); 
    575575        if (p == NULL) 
    576576                return -ENOMEM; 
     
    622622                snd_info_free_entry(snd_oss_root); 
    623623#endif 
    624                 snd_remove_proc_entry(&proc_root, snd_proc_root); 
     624                snd_remove_proc_entry(NULL, snd_proc_root); 
    625625        } 
    626626        return 0; 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/init.c

    r318 r358  
    5959MODULE_PARM_DESC(slots, "Module names assigned to the slots."); 
    6060 
    61 /* return non-zero if the given index is already reserved for another 
     61/* return non-zero if the given index is reserved for the given 
    6262 * module via slots option 
    6363 */ 
    64 static int module_slot_mismatch(struct module *module, int idx) 
     64static int module_slot_match(struct module *module, int idx) 
    6565{ 
    6666#ifndef TARGET_OS2 
    6767#ifdef MODULE 
    68         char *s1, *s2; 
     68        const char *s1, *s2; 
     69 
     70        int match = 1; 
    6971        if (!module || !module->name || !slots[idx]) 
    7072                return 0; 
    71         s1 = slots[idx]; 
    72         s2 = module->name; 
     73        s1 = module->name; 
     74        s2 = slots[idx]; 
     75        if (*s2 == '!') { 
     76                match = 0; /* negative match */ 
     77                s2++; 
     78        } 
    7379        /* compare module name strings 
    7480         * hyphens are handled as equivalent with underscore 
     
    8288                        c2 = '_'; 
    8389                if (c1 != c2) 
    84                         return 1; 
     90                        return !match; 
    8591                if (!c1) 
    8692                        break; 
    8793        } 
    88 #endif 
    89 #endif 
    90         return 0; 
     94 
     95#endif /* MODULE */ 
     96#else 
     97        int match = 1; 
     98#endif 
     99        return match; 
    91100} 
    92101 
     
    144153{ 
    145154        struct snd_card *card; 
    146         int err; 
     155        int err, idx2; 
    147156 
    148157        if (extra_size < 0) 
     
    160169        mutex_lock(&snd_card_mutex); 
    161170        if (idx < 0) { 
    162                 int idx2; 
    163171                for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) 
    164172                        /* idx == -1 == 0xffff means: take any free slot */ 
    165173                        if (~snd_cards_lock & idx & 1<<idx2) { 
    166                                 if (module_slot_mismatch(module, idx2)) 
    167                                         continue; 
    168                                 idx = idx2; 
    169                                 if (idx >= snd_ecards_limit) 
    170                                         snd_ecards_limit = idx + 1; 
    171                                 break; 
     174                                if (module_slot_match(module, idx2)) { 
     175                                        idx = idx2; 
     176                                        break; 
     177                                } 
    172178                        } 
    173         } else { 
    174                  if (idx < snd_ecards_limit) { 
    175                         if (snd_cards_lock & (1 << idx)) 
    176                                 err = -EBUSY;   /* invalid */ 
    177                 } else { 
    178                         if (idx < SNDRV_CARDS) 
    179                                 snd_ecards_limit = idx + 1; /* increase the limit */ 
    180                         else 
    181                                 err = -ENODEV; 
    182                 } 
    183         } 
    184         if (idx < 0 || err < 0) { 
     179        } 
     180        if (idx < 0) { 
     181                for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) 
     182                        /* idx == -1 == 0xffff means: take any free slot */ 
     183                        if (~snd_cards_lock & idx & 1<<idx2) { 
     184                                if (!slots[idx2] || !*slots[idx2]) { 
     185                                        idx = idx2; 
     186                                        break; 
     187                                } 
     188                        } 
     189        } 
     190        if (idx < 0) 
     191                err = -ENODEV; 
     192        else if (idx < snd_ecards_limit) { 
     193                if (snd_cards_lock & (1 << idx)) 
     194                        err = -EBUSY;   /* invalid */ 
     195        } else if (idx >= SNDRV_CARDS) 
     196                err = -ENODEV; 
     197        if (err < 0) { 
    185198                mutex_unlock(&snd_card_mutex); 
    186199                snd_printk(KERN_ERR "cannot find the slot for index %d (range 0-%i), error: %d\n", 
     
    189202        } 
    190203        snd_cards_lock |= 1 << idx;             /* lock it */ 
     204        if (idx >= snd_ecards_limit) 
     205                snd_ecards_limit = idx + 1; /* increase the limit */ 
    191206        mutex_unlock(&snd_card_mutex); 
    192207        card->number = idx; 
     
    271286 
    272287#ifndef TARGET_OS2 
    273         panic("%s(%p, %p) failed!", __FUNCTION__, inode, file); 
     288        panic("%s(%p, %p) failed!", __func__, inode, file); 
    274289#endif 
    275290} 
     
    347362        int err; 
    348363 
     364        if (!card) 
     365                return -EINVAL; 
     366 
    349367        spin_lock(&card->files_lock); 
    350368        if (card->shutdown) { 
     
    358376        mutex_lock(&snd_card_mutex); 
    359377        snd_cards[card->number] = NULL; 
     378        snd_cards_lock &= ~(1 << card->number); 
    360379        mutex_unlock(&snd_card_mutex); 
    361380         
     
    396415 
    397416        snd_info_card_disconnect(card); 
     417#ifndef CONFIG_SYSFS_DEPRECATED 
     418        if (card->card_dev) { 
     419                device_unregister(card->card_dev); 
     420                card->card_dev = NULL; 
     421        } 
     422#endif 
     423#ifdef CONFIG_PM 
     424        wake_up(&card->power_sleep); 
     425#endif 
    398426        return 0;        
    399427} 
     
    437465                /* Not fatal error */ 
    438466        } 
    439 #ifndef CONFIG_SYSFS_DEPRECATED 
    440         if (card->card_dev) 
    441                 device_unregister(card->card_dev); 
    442 #endif 
    443467        kfree(card); 
    444468        return 0; 
    445469} 
    446470 
    447 static int snd_card_free_prepare(struct snd_card *card) 
    448 { 
    449         if (card == NULL) 
    450                 return -EINVAL; 
    451         (void) snd_card_disconnect(card); 
    452         mutex_lock(&snd_card_mutex); 
    453         snd_cards[card->number] = NULL; 
    454         snd_cards_lock &= ~(1 << card->number); 
    455         mutex_unlock(&snd_card_mutex); 
    456 #ifdef CONFIG_PM 
    457         wake_up(&card->power_sleep); 
    458 #endif 
    459         return 0; 
    460 } 
    461  
    462471int snd_card_free_when_closed(struct snd_card *card) 
    463472{ 
    464473        int free_now = 0; 
    465         int ret = snd_card_free_prepare(card); 
     474        int ret = snd_card_disconnect(card); 
    466475        if (ret) 
    467476                return ret; 
     
    483492int snd_card_free(struct snd_card *card) 
    484493{ 
    485         int ret = snd_card_free_prepare(card); 
     494        int ret = snd_card_disconnect(card); 
    486495        if (ret) 
    487496                return ret; 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/makefile.os2

    r333 r358  
    2121FILE6    = timer.obj 
    2222FILE7    = rtctimer.obj 
    23 FILE8    = hwdep.obj info.obj wrappers.obj misc_driver.obj  
     23FILE8    = hwdep.obj info.obj wrappers.obj misc_driver.obj vmaster.obj 
    2424FILELAST = 
    2525FILES    = $(FILE0) $(FILE1) $(FILE2) $(FILE3) $(FILE4) $(FILE5) $(FILE6) $(FILE7) $(FILE8) $(FILE9) $(FILE10) $(FILE11) $(FILE12) 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/memalloc.c

    r351 r358  
    125125#endif 
    126126 
    127 #if defined(__i386__) 
    128 /* 
    129  * A hack to allocate large buffers via dma_alloc_coherent() 
    130  * 
    131  * since dma_alloc_coherent always tries GFP_DMA when the requested 
    132  * pci memory region is below 32bit, it happens quite often that even 
    133  * 2 order of pages cannot be allocated. 
    134  * 
    135  * so in the following, we allocate at first without dma_mask, so that 
    136  * allocation will be done without GFP_DMA.  if the area doesn't match 
    137  * with the requested region, then realloate with the original dma_mask 
    138  * again. 
    139  * 
    140  * Really, we want to move this type of thing into dma_alloc_coherent() 
    141  * so dma_mask doesn't have to be messed with. 
    142  */ 
    143  
    144 static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, 
    145                                          dma_addr_t *dma_handle, 
    146                                          gfp_t flags) 
    147 { 
    148         void *ret; 
    149         u64 dma_mask, coherent_dma_mask; 
    150  
    151         if (dev == NULL || !dev->dma_mask) 
    152                 return dma_alloc_coherent(dev, size, dma_handle, flags); 
    153         dma_mask = *dev->dma_mask; 
    154         coherent_dma_mask = dev->coherent_dma_mask; 
    155         *dev->dma_mask = 0xffffffff;    /* do without masking */ 
    156         dev->coherent_dma_mask = 0xffffffff;    /* do without masking */ 
    157         ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
    158         *dev->dma_mask = dma_mask;      /* restore */ 
    159         dev->coherent_dma_mask = coherent_dma_mask;     /* restore */ 
    160         if (ret) { 
    161                 /* obtained address is out of range? */ 
    162                 if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) { 
    163                         /* reallocate with the proper mask */ 
    164                         dma_free_coherent(dev, size, ret, *dma_handle); 
    165                         ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
    166                 } 
    167         } else { 
    168                 /* wish to success now with the proper mask... */ 
    169                 if (dma_mask != 0xffffffffUL) { 
    170                         /* allocation with GFP_ATOMIC to avoid the long stall */ 
    171                         flags &= ~GFP_KERNEL; 
    172                         flags |= GFP_ATOMIC; 
    173                         ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
    174                 } 
    175         } 
    176         return ret; 
    177 } 
    178  
    179 /* redefine dma_alloc_coherent for some architectures */ 
    180 #undef dma_alloc_coherent 
    181 #define dma_alloc_coherent snd_dma_hack_alloc_coherent 
    182  
    183 #endif /* arch */ 
    184127 
    185128/* 
     
    687630#ifdef CONFIG_PROC_FS 
    688631#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 
    689         snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL); 
    690         if (snd_mem_proc) 
    691                 snd_mem_proc->proc_fops = &snd_mem_proc_fops; 
     632        snd_mem_proc = proc_create(SND_MEM_PROC_FILE, 0644, NULL, 
     633                                   &snd_mem_proc_fops); 
    692634#endif 
    693635#endif 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/misc.c

    r305 r358  
    4040        va_list args; 
    4141         
    42         if (format[0] == '<' && format[1] >= '0' && format[1] <= '9' && format[2] == '>') { 
     42        if (format[0] == '<' && format[1] >= '0' && format[1] <= '7' && format[2] == '>') { 
    4343                char tmp[] = "<0>"; 
    4444                tmp[1] = format[1]; 
     
    6161        va_list args; 
    6262         
    63         if (format[0] == '<' && format[1] >= '0' && format[1] <= '9' && format[2] == '>') { 
     63        if (format[0] == '<' && format[1] >= '0' && format[1] <= '7' && format[2] == '>') { 
    6464                char tmp[] = "<0>"; 
    6565                tmp[1] = format[1]; 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/pcm_native.c

    r319 r358  
    2727#include <linux/slab.h> 
    2828#include <linux/time.h> 
    29 #include <linux/latency.h> 
     29#include <linux/pm_qos_params.h> 
    3030#include <linux/uio.h> 
    3131#include <sound/core.h> 
     
    455455        runtime->status->state = SNDRV_PCM_STATE_SETUP; 
    456456 
    457         remove_acceptable_latency(substream->latency_id); 
     457        pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, 
     458                                substream->latency_id); 
    458459        if ((usecs = period_to_usecs(runtime)) >= 0) 
    459                 set_acceptable_latency(substream->latency_id, usecs); 
     460                pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, 
     461                                        substream->latency_id, usecs); 
    460462        return 0; 
    461463 _error: 
     
    517519                result = substream->ops->hw_free(substream); 
    518520        runtime->status->state = SNDRV_PCM_STATE_OPEN; 
    519         remove_acceptable_latency(substream->latency_id); 
     521        pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, 
     522                substream->latency_id); 
    520523        return result; 
    521524} 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/seq/oss/seq_oss_synth.c

    r333 r358  
    250250                if (info->nr_voices > 0) { 
    251251                        info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL); 
    252                         if (!info->ch) 
    253                                 BUG(); 
     252                        if (!info->ch) { 
     253                                snd_printk(KERN_ERR "Cannot malloc\n"); 
     254                                rec->oper.close(&info->arg); 
     255                                module_put(rec->oper.owner); 
     256                                snd_use_lock_free(&rec->use_lock); 
     257                                continue; 
     258                        } 
    254259                        reset_channels(info); 
    255260                } 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/seq/seq_clientmgr.c

    r318 r358  
    153153        } 
    154154        spin_unlock_irqrestore(&clients_lock, flags); 
    155 #ifdef CONFIG_KMOD 
    156         if (!in_interrupt() && current->fs->root) { 
     155#ifdef CONFIG_MODULES 
     156        if (!in_interrupt()) { 
    157157                static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS]; 
    158158                static char card_requested[SNDRV_CARDS]; 
     
    160160                        int idx; 
    161161                         
    162                         if (! client_requested[clientid] && current->fs->root) { 
     162                        if (!client_requested[clientid]) { 
    163163                                client_requested[clientid] = 1; 
    164164                                for (idx = 0; idx < 15; idx++) { 
  • GPL/branches/uniaud32-2.0/alsa-kernel/core/seq/seq_device.c

    r305 r358  
    125125 */ 
    126126 
    127 #ifdef CONFIG_KMOD 
     127#ifdef CONFIG_MODULES 
    128128/* avoid auto-loading during module_init() */ 
    129129static int snd_seq_in_init; 
     
    141141void snd_seq_device_load_drivers(void) 
    142142{ 
    143 #ifdef CONFIG_KMOD 
     143#ifdef CONFIG_MODULES 
    144144        struct ops_list *ops; 
    145145 
     
    148148      &nbs