Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ASoC: pandora: Add APLL supply to fix audio output
ALSA: ice1724 - aureon - fix wm8770 volume offset
ALSA: cosmetic: make hda intel interrupt name consistent with others
ALSA: hda - Delay switching to polling mode if an interrupt was missing
ALSA: ctxfi - fix PTP address initialization

+51 -44
+2 -13
sound/pci/ctxfi/ctatc.c
··· 166 166 167 167 static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) 168 168 { 169 - struct ct_vm *vm; 170 - void *kvirt_addr; 171 - unsigned long phys_addr; 172 - 173 - vm = atc->vm; 174 - kvirt_addr = vm->get_ptp_virt(vm, index); 175 - if (kvirt_addr == NULL) 176 - phys_addr = (~0UL); 177 - else 178 - phys_addr = virt_to_phys(kvirt_addr); 179 - 180 - return phys_addr; 169 + return atc->vm->get_ptp_phys(atc->vm, index); 181 170 } 182 171 183 172 static unsigned int convert_format(snd_pcm_format_t snd_format) ··· 1658 1669 } 1659 1670 1660 1671 /* Set up device virtual memory management object */ 1661 - err = ct_vm_create(&atc->vm); 1672 + err = ct_vm_create(&atc->vm, pci); 1662 1673 if (err < 0) 1663 1674 goto error1; 1664 1675
+18 -20
sound/pci/ctxfi/ctvmem.c
··· 138 138 return NULL; 139 139 } 140 140 141 - ptp = vm->ptp[0]; 141 + ptp = (unsigned long *)vm->ptp[0].area; 142 142 pte_start = (block->addr >> CT_PAGE_SHIFT); 143 143 pages = block->size >> CT_PAGE_SHIFT; 144 144 for (i = 0; i < pages; i++) { ··· 158 158 } 159 159 160 160 /* * 161 - * return the host (kmalloced) addr of the @index-th device 162 - * page talbe page on success, or NULL on failure. 163 - * The first returned NULL indicates the termination. 161 + * return the host physical addr of the @index-th device 162 + * page table page on success, or ~0UL on failure. 163 + * The first returned ~0UL indicates the termination. 164 164 * */ 165 - static void * 166 - ct_get_ptp_virt(struct ct_vm *vm, int index) 165 + static dma_addr_t 166 + ct_get_ptp_phys(struct ct_vm *vm, int index) 167 167 { 168 - void *addr; 168 + dma_addr_t addr; 169 169 170 - addr = (index >= CT_PTP_NUM) ? NULL : vm->ptp[index]; 170 + addr = (index >= CT_PTP_NUM) ? ~0UL : vm->ptp[index].addr; 171 171 172 172 return addr; 173 173 } 174 174 175 - int ct_vm_create(struct ct_vm **rvm) 175 + int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci) 176 176 { 177 177 struct ct_vm *vm; 178 178 struct ct_vm_block *block; 179 - int i; 179 + int i, err = 0; 180 180 181 181 *rvm = NULL; 182 182 ··· 188 188 189 189 /* Allocate page table pages */ 190 190 for (i = 0; i < CT_PTP_NUM; i++) { 191 - vm->ptp[i] = kmalloc(PAGE_SIZE, GFP_KERNEL); 192 - if (!vm->ptp[i]) 191 + err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, 192 + snd_dma_pci_data(pci), 193 + PAGE_SIZE, &vm->ptp[i]); 194 + if (err < 0) 193 195 break; 194 196 } 195 - if (!i) { 197 + if (err < 0) { 196 198 /* no page table pages are allocated */ 197 - kfree(vm); 199 + ct_vm_destroy(vm); 198 200 return -ENOMEM; 199 201 } 200 202 vm->size = CT_ADDRS_PER_PAGE * i; 201 - /* Initialise remaining ptps */ 202 - for (; i < CT_PTP_NUM; i++) 203 - vm->ptp[i] = NULL; 204 - 205 203 vm->map = ct_vm_map; 206 204 vm->unmap = ct_vm_unmap; 207 - vm->get_ptp_virt = ct_get_ptp_virt; 205 + vm->get_ptp_phys = ct_get_ptp_phys; 208 206 INIT_LIST_HEAD(&vm->unused); 209 207 INIT_LIST_HEAD(&vm->used); 210 208 block = kzalloc(sizeof(*block), GFP_KERNEL); ··· 240 242 241 243 /* free allocated page table pages */ 242 244 for (i = 0; i < CT_PTP_NUM; i++) 243 - kfree(vm->ptp[i]); 245 + snd_dma_free_pages(&vm->ptp[i]); 244 246 245 247 vm->size = 0; 246 248
+5 -3
sound/pci/ctxfi/ctvmem.h
··· 22 22 23 23 #include <linux/mutex.h> 24 24 #include <linux/list.h> 25 + #include <linux/pci.h> 26 + #include <sound/memalloc.h> 25 27 26 28 /* The chip can handle the page table of 4k pages 27 29 * (emu20k1 can handle even 8k pages, but we don't use it right now) ··· 43 41 44 42 /* Virtual memory management object for card device */ 45 43 struct ct_vm { 46 - void *ptp[CT_PTP_NUM]; /* Device page table pages */ 44 + struct snd_dma_buffer ptp[CT_PTP_NUM]; /* Device page table pages */ 47 45 unsigned int size; /* Available addr space in bytes */ 48 46 struct list_head unused; /* List of unused blocks */ 49 47 struct list_head used; /* List of used blocks */ ··· 54 52 int size); 55 53 /* Unmap device logical addr area. */ 56 54 void (*unmap)(struct ct_vm *, struct ct_vm_block *block); 57 - void *(*get_ptp_virt)(struct ct_vm *vm, int index); 55 + dma_addr_t (*get_ptp_phys)(struct ct_vm *vm, int index); 58 56 }; 59 57 60 - int ct_vm_create(struct ct_vm **rvm); 58 + int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci); 61 59 void ct_vm_destroy(struct ct_vm *vm); 62 60 63 61 #endif /* CTVMEM_H */
+18 -3
sound/pci/hda/hda_intel.c
··· 426 426 427 427 /* flags */ 428 428 int position_fix; 429 + int poll_count; 429 430 unsigned int running :1; 430 431 unsigned int initialized :1; 431 432 unsigned int single_cmd :1; ··· 507 506 #define get_azx_dev(substream) (substream->runtime->private_data) 508 507 509 508 static int azx_acquire_irq(struct azx *chip, int do_disconnect); 510 - 509 + static int azx_send_cmd(struct hda_bus *bus, unsigned int val); 511 510 /* 512 511 * Interface for HD codec 513 512 */ ··· 665 664 { 666 665 struct azx *chip = bus->private_data; 667 666 unsigned long timeout; 667 + int do_poll = 0; 668 668 669 669 again: 670 670 timeout = jiffies + msecs_to_jiffies(1000); 671 671 for (;;) { 672 - if (chip->polling_mode) { 672 + if (chip->polling_mode || do_poll) { 673 673 spin_lock_irq(&chip->reg_lock); 674 674 azx_update_rirb(chip); 675 675 spin_unlock_irq(&chip->reg_lock); ··· 678 676 if (!chip->rirb.cmds[addr]) { 679 677 smp_rmb(); 680 678 bus->rirb_error = 0; 679 + 680 + if (!do_poll) 681 + chip->poll_count = 0; 681 682 return chip->rirb.res[addr]; /* the last value */ 682 683 } 683 684 if (time_after(jiffies, timeout)) ··· 692 687 cond_resched(); 693 688 } 694 689 } 690 + 691 + if (!chip->polling_mode && chip->poll_count < 2) { 692 + snd_printdd(SFX "azx_get_response timeout, " 693 + "polling the codec once: last cmd=0x%08x\n", 694 + chip->last_cmd[addr]); 695 + do_poll = 1; 696 + chip->poll_count++; 697 + goto again; 698 + } 699 + 695 700 696 701 if (!chip->polling_mode) { 697 702 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " ··· 2058 2043 { 2059 2044 if (request_irq(chip->pci->irq, azx_interrupt, 2060 2045 chip->msi ? 0 : IRQF_SHARED, 2061 - "HDA Intel", chip)) { 2046 + "hda_intel", chip)) { 2062 2047 printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " 2063 2048 "disabling device\n", chip->pci->irq); 2064 2049 if (do_disconnect)
+7 -5
sound/pci/ice1712/aureon.c
··· 703 703 { 704 704 unsigned char nvol; 705 705 706 - if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) 706 + if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) { 707 707 nvol = 0; 708 - else 708 + } else { 709 709 nvol = ((vol % WM_VOL_CNT) * (master % WM_VOL_CNT)) / 710 710 WM_VOL_MAX; 711 + nvol += 0x1b; 712 + } 711 713 712 714 wm_put(ice, index, nvol); 713 715 wm_put_nocache(ice, index, 0x180 | nvol); ··· 780 778 for (ch = 0; ch < 2; ch++) { 781 779 unsigned int vol = ucontrol->value.integer.value[ch]; 782 780 if (vol > WM_VOL_MAX) 783 - continue; 781 + vol = WM_VOL_MAX; 784 782 vol |= spec->master[ch] & WM_VOL_MUTE; 785 783 if (vol != spec->master[ch]) { 786 784 int dac; ··· 836 834 for (i = 0; i < voices; i++) { 837 835 unsigned int vol = ucontrol->value.integer.value[i]; 838 836 if (vol > WM_VOL_MAX) 839 - continue; 840 - vol |= spec->vol[ofs+i]; 837 + vol = WM_VOL_MAX; 838 + vol |= spec->vol[ofs+i] & WM_VOL_MUTE; 841 839 if (vol != spec->vol[ofs+i]) { 842 840 spec->vol[ofs+i] = vol; 843 841 idx = WM_DAC_ATTEN + ofs + i;
+1
sound/soc/omap/omap3pandora.c
··· 145 145 }; 146 146 147 147 static const struct snd_soc_dapm_route omap3pandora_out_map[] = { 148 + {"PCM DAC", NULL, "APLL Enable"}, 148 149 {"Headphone Amplifier", NULL, "PCM DAC"}, 149 150 {"Line Out", NULL, "PCM DAC"}, 150 151 {"Headphone Jack", NULL, "Headphone Amplifier"},