diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-02-27 10:18:46 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-02-27 10:18:46 -0500 |
commit | 018cbffe6819f6f8db20a0a3acd9bab9bfd667e4 (patch) | |
tree | fadde2521591998dc653fa094c636e8a547e620d /sound/pci | |
parent | 1dd2980d990068e20045b90c424518cc7f3657ff (diff) | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
Merge commit 'v2.6.33' into perf/core
Merge reason:
__percpu annotations need the corresponding sparse address
space definition upstream.
Conflicts:
tools/perf/util/probe-event.c (trivial)
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/ctxfi/ctatc.c | 15 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctvmem.c | 38 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctvmem.h | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 25 | ||||
-rw-r--r-- | sound/pci/ice1712/aureon.c | 12 |
5 files changed, 54 insertions, 44 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index cb65bd0dd35b..459c1f62783b 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -166,18 +166,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
166 | 166 | ||
167 | static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) | 167 | static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) |
168 | { | 168 | { |
169 | struct ct_vm *vm; | 169 | return atc->vm->get_ptp_phys(atc->vm, index); |
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; | ||
181 | } | 170 | } |
182 | 171 | ||
183 | static unsigned int convert_format(snd_pcm_format_t snd_format) | 172 | static unsigned int convert_format(snd_pcm_format_t snd_format) |
@@ -1669,7 +1658,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci, | |||
1669 | } | 1658 | } |
1670 | 1659 | ||
1671 | /* Set up device virtual memory management object */ | 1660 | /* Set up device virtual memory management object */ |
1672 | err = ct_vm_create(&atc->vm); | 1661 | err = ct_vm_create(&atc->vm, pci); |
1673 | if (err < 0) | 1662 | if (err < 0) |
1674 | goto error1; | 1663 | goto error1; |
1675 | 1664 | ||
diff --git a/sound/pci/ctxfi/ctvmem.c b/sound/pci/ctxfi/ctvmem.c index 6b78752e9503..65da6e466f80 100644 --- a/sound/pci/ctxfi/ctvmem.c +++ b/sound/pci/ctxfi/ctvmem.c | |||
@@ -138,7 +138,7 @@ ct_vm_map(struct ct_vm *vm, struct snd_pcm_substream *substream, int size) | |||
138 | return NULL; | 138 | return NULL; |
139 | } | 139 | } |
140 | 140 | ||
141 | ptp = vm->ptp[0]; | 141 | ptp = (unsigned long *)vm->ptp[0].area; |
142 | pte_start = (block->addr >> CT_PAGE_SHIFT); | 142 | pte_start = (block->addr >> CT_PAGE_SHIFT); |
143 | pages = block->size >> CT_PAGE_SHIFT; | 143 | pages = block->size >> CT_PAGE_SHIFT; |
144 | for (i = 0; i < pages; i++) { | 144 | for (i = 0; i < pages; i++) { |
@@ -158,25 +158,25 @@ static void ct_vm_unmap(struct ct_vm *vm, struct ct_vm_block *block) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | /* * | 160 | /* * |
161 | * return the host (kmalloced) addr of the @index-th device | 161 | * return the host physical addr of the @index-th device |
162 | * page talbe page on success, or NULL on failure. | 162 | * page table page on success, or ~0UL on failure. |
163 | * The first returned NULL indicates the termination. | 163 | * The first returned ~0UL indicates the termination. |
164 | * */ | 164 | * */ |
165 | static void * | 165 | static dma_addr_t |
166 | ct_get_ptp_virt(struct ct_vm *vm, int index) | 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 | return addr; | 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 | struct ct_vm *vm; | 177 | struct ct_vm *vm; |
178 | struct ct_vm_block *block; | 178 | struct ct_vm_block *block; |
179 | int i; | 179 | int i, err = 0; |
180 | 180 | ||
181 | *rvm = NULL; | 181 | *rvm = NULL; |
182 | 182 | ||
@@ -188,23 +188,21 @@ int ct_vm_create(struct ct_vm **rvm) | |||
188 | 188 | ||
189 | /* Allocate page table pages */ | 189 | /* Allocate page table pages */ |
190 | for (i = 0; i < CT_PTP_NUM; i++) { | 190 | for (i = 0; i < CT_PTP_NUM; i++) { |
191 | vm->ptp[i] = kmalloc(PAGE_SIZE, GFP_KERNEL); | 191 | err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, |
192 | if (!vm->ptp[i]) | 192 | snd_dma_pci_data(pci), |
193 | PAGE_SIZE, &vm->ptp[i]); | ||
194 | if (err < 0) | ||
193 | break; | 195 | break; |
194 | } | 196 | } |
195 | if (!i) { | 197 | if (err < 0) { |
196 | /* no page table pages are allocated */ | 198 | /* no page table pages are allocated */ |
197 | kfree(vm); | 199 | ct_vm_destroy(vm); |
198 | return -ENOMEM; | 200 | return -ENOMEM; |
199 | } | 201 | } |
200 | vm->size = CT_ADDRS_PER_PAGE * i; | 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 | vm->map = ct_vm_map; | 203 | vm->map = ct_vm_map; |
206 | vm->unmap = ct_vm_unmap; | 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 | INIT_LIST_HEAD(&vm->unused); | 206 | INIT_LIST_HEAD(&vm->unused); |
209 | INIT_LIST_HEAD(&vm->used); | 207 | INIT_LIST_HEAD(&vm->used); |
210 | block = kzalloc(sizeof(*block), GFP_KERNEL); | 208 | block = kzalloc(sizeof(*block), GFP_KERNEL); |
@@ -242,7 +240,7 @@ void ct_vm_destroy(struct ct_vm *vm) | |||
242 | 240 | ||
243 | /* free allocated page table pages */ | 241 | /* free allocated page table pages */ |
244 | for (i = 0; i < CT_PTP_NUM; i++) | 242 | for (i = 0; i < CT_PTP_NUM; i++) |
245 | kfree(vm->ptp[i]); | 243 | snd_dma_free_pages(&vm->ptp[i]); |
246 | 244 | ||
247 | vm->size = 0; | 245 | vm->size = 0; |
248 | 246 | ||
diff --git a/sound/pci/ctxfi/ctvmem.h b/sound/pci/ctxfi/ctvmem.h index 01e4fd0386a3..b23adfca4de6 100644 --- a/sound/pci/ctxfi/ctvmem.h +++ b/sound/pci/ctxfi/ctvmem.h | |||
@@ -22,6 +22,8 @@ | |||
22 | 22 | ||
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/pci.h> | ||
26 | #include <sound/memalloc.h> | ||
25 | 27 | ||
26 | /* The chip can handle the page table of 4k pages | 28 | /* The chip can handle the page table of 4k pages |
27 | * (emu20k1 can handle even 8k pages, but we don't use it right now) | 29 | * (emu20k1 can handle even 8k pages, but we don't use it right now) |
@@ -41,7 +43,7 @@ struct snd_pcm_substream; | |||
41 | 43 | ||
42 | /* Virtual memory management object for card device */ | 44 | /* Virtual memory management object for card device */ |
43 | struct ct_vm { | 45 | struct ct_vm { |
44 | void *ptp[CT_PTP_NUM]; /* Device page table pages */ | 46 | struct snd_dma_buffer ptp[CT_PTP_NUM]; /* Device page table pages */ |
45 | unsigned int size; /* Available addr space in bytes */ | 47 | unsigned int size; /* Available addr space in bytes */ |
46 | struct list_head unused; /* List of unused blocks */ | 48 | struct list_head unused; /* List of unused blocks */ |
47 | struct list_head used; /* List of used blocks */ | 49 | struct list_head used; /* List of used blocks */ |
@@ -52,10 +54,10 @@ struct ct_vm { | |||
52 | int size); | 54 | int size); |
53 | /* Unmap device logical addr area. */ | 55 | /* Unmap device logical addr area. */ |
54 | void (*unmap)(struct ct_vm *, struct ct_vm_block *block); | 56 | void (*unmap)(struct ct_vm *, struct ct_vm_block *block); |
55 | void *(*get_ptp_virt)(struct ct_vm *vm, int index); | 57 | dma_addr_t (*get_ptp_phys)(struct ct_vm *vm, int index); |
56 | }; | 58 | }; |
57 | 59 | ||
58 | int ct_vm_create(struct ct_vm **rvm); | 60 | int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci); |
59 | void ct_vm_destroy(struct ct_vm *vm); | 61 | void ct_vm_destroy(struct ct_vm *vm); |
60 | 62 | ||
61 | #endif /* CTVMEM_H */ | 63 | #endif /* CTVMEM_H */ |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ec9c348336cc..ff6da6f386d1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -426,6 +426,7 @@ struct azx { | |||
426 | 426 | ||
427 | /* flags */ | 427 | /* flags */ |
428 | int position_fix; | 428 | int position_fix; |
429 | int poll_count; | ||
429 | unsigned int running :1; | 430 | unsigned int running :1; |
430 | unsigned int initialized :1; | 431 | unsigned int initialized :1; |
431 | unsigned int single_cmd :1; | 432 | unsigned int single_cmd :1; |
@@ -506,7 +507,7 @@ static char *driver_short_names[] __devinitdata = { | |||
506 | #define get_azx_dev(substream) (substream->runtime->private_data) | 507 | #define get_azx_dev(substream) (substream->runtime->private_data) |
507 | 508 | ||
508 | static int azx_acquire_irq(struct azx *chip, int do_disconnect); | 509 | static int azx_acquire_irq(struct azx *chip, int do_disconnect); |
509 | 510 | static int azx_send_cmd(struct hda_bus *bus, unsigned int val); | |
510 | /* | 511 | /* |
511 | * Interface for HD codec | 512 | * Interface for HD codec |
512 | */ | 513 | */ |
@@ -664,11 +665,12 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
664 | { | 665 | { |
665 | struct azx *chip = bus->private_data; | 666 | struct azx *chip = bus->private_data; |
666 | unsigned long timeout; | 667 | unsigned long timeout; |
668 | int do_poll = 0; | ||
667 | 669 | ||
668 | again: | 670 | again: |
669 | timeout = jiffies + msecs_to_jiffies(1000); | 671 | timeout = jiffies + msecs_to_jiffies(1000); |
670 | for (;;) { | 672 | for (;;) { |
671 | if (chip->polling_mode) { | 673 | if (chip->polling_mode || do_poll) { |
672 | spin_lock_irq(&chip->reg_lock); | 674 | spin_lock_irq(&chip->reg_lock); |
673 | azx_update_rirb(chip); | 675 | azx_update_rirb(chip); |
674 | spin_unlock_irq(&chip->reg_lock); | 676 | spin_unlock_irq(&chip->reg_lock); |
@@ -676,6 +678,9 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
676 | if (!chip->rirb.cmds[addr]) { | 678 | if (!chip->rirb.cmds[addr]) { |
677 | smp_rmb(); | 679 | smp_rmb(); |
678 | bus->rirb_error = 0; | 680 | bus->rirb_error = 0; |
681 | |||
682 | if (!do_poll) | ||
683 | chip->poll_count = 0; | ||
679 | return chip->rirb.res[addr]; /* the last value */ | 684 | return chip->rirb.res[addr]; /* the last value */ |
680 | } | 685 | } |
681 | if (time_after(jiffies, timeout)) | 686 | if (time_after(jiffies, timeout)) |
@@ -688,6 +693,16 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
688 | } | 693 | } |
689 | } | 694 | } |
690 | 695 | ||
696 | if (!chip->polling_mode && chip->poll_count < 2) { | ||
697 | snd_printdd(SFX "azx_get_response timeout, " | ||
698 | "polling the codec once: last cmd=0x%08x\n", | ||
699 | chip->last_cmd[addr]); | ||
700 | do_poll = 1; | ||
701 | chip->poll_count++; | ||
702 | goto again; | ||
703 | } | ||
704 | |||
705 | |||
691 | if (!chip->polling_mode) { | 706 | if (!chip->polling_mode) { |
692 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " | 707 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " |
693 | "switching to polling mode: last cmd=0x%08x\n", | 708 | "switching to polling mode: last cmd=0x%08x\n", |
@@ -1878,6 +1893,9 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) | |||
1878 | 1893 | ||
1879 | if (!bdl_pos_adj[chip->dev_index]) | 1894 | if (!bdl_pos_adj[chip->dev_index]) |
1880 | return 1; /* no delayed ack */ | 1895 | return 1; /* no delayed ack */ |
1896 | if (WARN_ONCE(!azx_dev->period_bytes, | ||
1897 | "hda-intel: zero azx_dev->period_bytes")) | ||
1898 | return 0; /* this shouldn't happen! */ | ||
1881 | if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) | 1899 | if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) |
1882 | return 0; /* NG - it's below the period boundary */ | 1900 | return 0; /* NG - it's below the period boundary */ |
1883 | return 1; /* OK, it's fine */ | 1901 | return 1; /* OK, it's fine */ |
@@ -2043,7 +2061,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect) | |||
2043 | { | 2061 | { |
2044 | if (request_irq(chip->pci->irq, azx_interrupt, | 2062 | if (request_irq(chip->pci->irq, azx_interrupt, |
2045 | chip->msi ? 0 : IRQF_SHARED, | 2063 | chip->msi ? 0 : IRQF_SHARED, |
2046 | "HDA Intel", chip)) { | 2064 | "hda_intel", chip)) { |
2047 | printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " | 2065 | printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " |
2048 | "disabling device\n", chip->pci->irq); | 2066 | "disabling device\n", chip->pci->irq); |
2049 | if (do_disconnect) | 2067 | if (do_disconnect) |
@@ -2332,6 +2350,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev) | |||
2332 | */ | 2350 | */ |
2333 | static struct snd_pci_quirk msi_black_list[] __devinitdata = { | 2351 | static struct snd_pci_quirk msi_black_list[] __devinitdata = { |
2334 | SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ | 2352 | SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ |
2353 | SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */ | ||
2335 | {} | 2354 | {} |
2336 | }; | 2355 | }; |
2337 | 2356 | ||
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 765d7bd4c3d4..9e66f6d306f8 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c | |||
@@ -703,11 +703,13 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned sho | |||
703 | { | 703 | { |
704 | unsigned char nvol; | 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 | nvol = 0; | 707 | nvol = 0; |
708 | else | 708 | } else { |
709 | nvol = ((vol % WM_VOL_CNT) * (master % WM_VOL_CNT)) / | 709 | nvol = ((vol % WM_VOL_CNT) * (master % WM_VOL_CNT)) / |
710 | WM_VOL_MAX; | 710 | WM_VOL_MAX; |
711 | nvol += 0x1b; | ||
712 | } | ||
711 | 713 | ||
712 | wm_put(ice, index, nvol); | 714 | wm_put(ice, index, nvol); |
713 | wm_put_nocache(ice, index, 0x180 | nvol); | 715 | wm_put_nocache(ice, index, 0x180 | nvol); |
@@ -778,7 +780,7 @@ static int wm_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
778 | for (ch = 0; ch < 2; ch++) { | 780 | for (ch = 0; ch < 2; ch++) { |
779 | unsigned int vol = ucontrol->value.integer.value[ch]; | 781 | unsigned int vol = ucontrol->value.integer.value[ch]; |
780 | if (vol > WM_VOL_MAX) | 782 | if (vol > WM_VOL_MAX) |
781 | continue; | 783 | vol = WM_VOL_MAX; |
782 | vol |= spec->master[ch] & WM_VOL_MUTE; | 784 | vol |= spec->master[ch] & WM_VOL_MUTE; |
783 | if (vol != spec->master[ch]) { | 785 | if (vol != spec->master[ch]) { |
784 | int dac; | 786 | int dac; |
@@ -834,8 +836,8 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value * | |||
834 | for (i = 0; i < voices; i++) { | 836 | for (i = 0; i < voices; i++) { |
835 | unsigned int vol = ucontrol->value.integer.value[i]; | 837 | unsigned int vol = ucontrol->value.integer.value[i]; |
836 | if (vol > WM_VOL_MAX) | 838 | if (vol > WM_VOL_MAX) |
837 | continue; | 839 | vol = WM_VOL_MAX; |
838 | vol |= spec->vol[ofs+i]; | 840 | vol |= spec->vol[ofs+i] & WM_VOL_MUTE; |
839 | if (vol != spec->vol[ofs+i]) { | 841 | if (vol != spec->vol[ofs+i]) { |
840 | spec->vol[ofs+i] = vol; | 842 | spec->vol[ofs+i] = vol; |
841 | idx = WM_DAC_ATTEN + ofs + i; | 843 | idx = WM_DAC_ATTEN + ofs + i; |