diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/aoa/fabrics/layout.c | 2 | ||||
-rw-r--r-- | sound/core/sound.c | 4 | ||||
-rw-r--r-- | sound/core/sound_oss.c | 2 | ||||
-rw-r--r-- | sound/oss/au1550_ac97.c | 16 | ||||
-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/hda/patch_realtek.c | 131 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 61 | ||||
-rw-r--r-- | sound/pci/ice1712/aureon.c | 12 | ||||
-rw-r--r-- | sound/ppc/awacs.c | 24 | ||||
-rw-r--r-- | sound/ppc/burgundy.c | 4 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 18 | ||||
-rw-r--r-- | sound/soc/au1x/Kconfig | 10 | ||||
-rw-r--r-- | sound/soc/au1x/Makefile | 4 | ||||
-rw-r--r-- | sound/soc/au1x/db1200.c | 141 | ||||
-rw-r--r-- | sound/soc/au1x/dbdma2.c | 14 | ||||
-rw-r--r-- | sound/soc/au1x/sample-ac97.c | 144 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic23.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8903.c | 3 | ||||
-rw-r--r-- | sound/soc/fsl/efika-audio-fabric.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/pcm030-audio-fabric.c | 2 | ||||
-rw-r--r-- | sound/soc/omap/Makefile | 2 | ||||
-rw-r--r-- | sound/soc/omap/omap3pandora.c | 1 | ||||
-rw-r--r-- | sound/sound_core.c | 2 |
26 files changed, 404 insertions, 283 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 586965f9605f..7a437da05646 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c | |||
@@ -768,7 +768,7 @@ static int check_codec(struct aoa_codec *codec, | |||
768 | "required property %s not present\n", propname); | 768 | "required property %s not present\n", propname); |
769 | return -ENODEV; | 769 | return -ENODEV; |
770 | } | 770 | } |
771 | if (*ref != codec->node->linux_phandle) { | 771 | if (*ref != codec->node->phandle) { |
772 | printk(KERN_INFO "snd-aoa-fabric-layout: " | 772 | printk(KERN_INFO "snd-aoa-fabric-layout: " |
773 | "%s doesn't match!\n", propname); | 773 | "%s doesn't match!\n", propname); |
774 | return -ENODEV; | 774 | return -ENODEV; |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 7872a02f6ca9..563d1967a0ad 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -468,5 +468,5 @@ static void __exit alsa_sound_exit(void) | |||
468 | unregister_chrdev(major, "alsa"); | 468 | unregister_chrdev(major, "alsa"); |
469 | } | 469 | } |
470 | 470 | ||
471 | module_init(alsa_sound_init) | 471 | subsys_initcall(alsa_sound_init); |
472 | module_exit(alsa_sound_exit) | 472 | module_exit(alsa_sound_exit); |
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index 7fe12264ff80..0c164e5e4322 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c | |||
@@ -93,7 +93,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev) | |||
93 | default: | 93 | default: |
94 | return -EINVAL; | 94 | return -EINVAL; |
95 | } | 95 | } |
96 | if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OSS_MINORS)) | 96 | if (minor < 0 || minor >= SNDRV_OSS_MINORS) |
97 | return -EINVAL; | 97 | return -EINVAL; |
98 | return minor; | 98 | return minor; |
99 | } | 99 | } |
diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c index 4191acccbcdb..c1070e33b32f 100644 --- a/sound/oss/au1550_ac97.c +++ b/sound/oss/au1550_ac97.c | |||
@@ -614,7 +614,8 @@ start_adc(struct au1550_state *s) | |||
614 | /* Put two buffers on the ring to get things started. | 614 | /* Put two buffers on the ring to get things started. |
615 | */ | 615 | */ |
616 | for (i=0; i<2; i++) { | 616 | for (i=0; i<2; i++) { |
617 | au1xxx_dbdma_put_dest(db->dmanr, db->nextIn, db->dma_fragsize); | 617 | au1xxx_dbdma_put_dest(db->dmanr, virt_to_phys(db->nextIn), |
618 | db->dma_fragsize, DDMA_FLAGS_IE); | ||
618 | 619 | ||
619 | db->nextIn += db->dma_fragsize; | 620 | db->nextIn += db->dma_fragsize; |
620 | if (db->nextIn >= db->rawbuf + db->dmasize) | 621 | if (db->nextIn >= db->rawbuf + db->dmasize) |
@@ -732,8 +733,9 @@ static void dac_dma_interrupt(int irq, void *dev_id) | |||
732 | db->dma_qcount--; | 733 | db->dma_qcount--; |
733 | 734 | ||
734 | if (db->count >= db->fragsize) { | 735 | if (db->count >= db->fragsize) { |
735 | if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, | 736 | if (au1xxx_dbdma_put_source(db->dmanr, |
736 | db->fragsize) == 0) { | 737 | virt_to_phys(db->nextOut), db->fragsize, |
738 | DDMA_FLAGS_IE) == 0) { | ||
737 | err("qcount < 2 and no ring room!"); | 739 | err("qcount < 2 and no ring room!"); |
738 | } | 740 | } |
739 | db->nextOut += db->fragsize; | 741 | db->nextOut += db->fragsize; |
@@ -777,7 +779,8 @@ static void adc_dma_interrupt(int irq, void *dev_id) | |||
777 | 779 | ||
778 | /* Put a new empty buffer on the destination DMA. | 780 | /* Put a new empty buffer on the destination DMA. |
779 | */ | 781 | */ |
780 | au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn, dp->dma_fragsize); | 782 | au1xxx_dbdma_put_dest(dp->dmanr, virt_to_phys(dp->nextIn), |
783 | dp->dma_fragsize, DDMA_FLAGS_IE); | ||
781 | 784 | ||
782 | dp->nextIn += dp->dma_fragsize; | 785 | dp->nextIn += dp->dma_fragsize; |
783 | if (dp->nextIn >= dp->rawbuf + dp->dmasize) | 786 | if (dp->nextIn >= dp->rawbuf + dp->dmasize) |
@@ -1177,8 +1180,9 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos) | |||
1177 | * we know the dma has stopped. | 1180 | * we know the dma has stopped. |
1178 | */ | 1181 | */ |
1179 | while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) { | 1182 | while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) { |
1180 | if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, | 1183 | if (au1xxx_dbdma_put_source(db->dmanr, |
1181 | db->fragsize) == 0) { | 1184 | virt_to_phys(db->nextOut), db->fragsize, |
1185 | DDMA_FLAGS_IE) == 0) { | ||
1182 | err("qcount < 2 and no ring room!"); | 1186 | err("qcount < 2 and no ring room!"); |
1183 | } | 1187 | } |
1184 | db->nextOut += db->fragsize; | 1188 | db->nextOut += db->fragsize; |
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/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e3caa78ccd54..da34095c707f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1093,6 +1093,16 @@ static void alc889_coef_init(struct hda_codec *codec) | |||
1093 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010); | 1093 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010); |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | /* turn on/off EAPD control (only if available) */ | ||
1097 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | ||
1098 | { | ||
1099 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | ||
1100 | return; | ||
1101 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | ||
1102 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | ||
1103 | on ? 2 : 0); | ||
1104 | } | ||
1105 | |||
1096 | static void alc_auto_init_amp(struct hda_codec *codec, int type) | 1106 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
1097 | { | 1107 | { |
1098 | unsigned int tmp; | 1108 | unsigned int tmp; |
@@ -1110,25 +1120,22 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type) | |||
1110 | case ALC_INIT_DEFAULT: | 1120 | case ALC_INIT_DEFAULT: |
1111 | switch (codec->vendor_id) { | 1121 | switch (codec->vendor_id) { |
1112 | case 0x10ec0260: | 1122 | case 0x10ec0260: |
1113 | snd_hda_codec_write(codec, 0x0f, 0, | 1123 | set_eapd(codec, 0x0f, 1); |
1114 | AC_VERB_SET_EAPD_BTLENABLE, 2); | 1124 | set_eapd(codec, 0x10, 1); |
1115 | snd_hda_codec_write(codec, 0x10, 0, | ||
1116 | AC_VERB_SET_EAPD_BTLENABLE, 2); | ||
1117 | break; | 1125 | break; |
1118 | case 0x10ec0262: | 1126 | case 0x10ec0262: |
1119 | case 0x10ec0267: | 1127 | case 0x10ec0267: |
1120 | case 0x10ec0268: | 1128 | case 0x10ec0268: |
1121 | case 0x10ec0269: | 1129 | case 0x10ec0269: |
1130 | case 0x10ec0270: | ||
1122 | case 0x10ec0272: | 1131 | case 0x10ec0272: |
1123 | case 0x10ec0660: | 1132 | case 0x10ec0660: |
1124 | case 0x10ec0662: | 1133 | case 0x10ec0662: |
1125 | case 0x10ec0663: | 1134 | case 0x10ec0663: |
1126 | case 0x10ec0862: | 1135 | case 0x10ec0862: |
1127 | case 0x10ec0889: | 1136 | case 0x10ec0889: |
1128 | snd_hda_codec_write(codec, 0x14, 0, | 1137 | set_eapd(codec, 0x14, 1); |
1129 | AC_VERB_SET_EAPD_BTLENABLE, 2); | 1138 | set_eapd(codec, 0x15, 1); |
1130 | snd_hda_codec_write(codec, 0x15, 0, | ||
1131 | AC_VERB_SET_EAPD_BTLENABLE, 2); | ||
1132 | break; | 1139 | break; |
1133 | } | 1140 | } |
1134 | switch (codec->vendor_id) { | 1141 | switch (codec->vendor_id) { |
@@ -1230,6 +1237,8 @@ static void alc_init_auto_mic(struct hda_codec *codec) | |||
1230 | return; /* invalid entry */ | 1237 | return; /* invalid entry */ |
1231 | } | 1238 | } |
1232 | } | 1239 | } |
1240 | if (!ext || !fixed) | ||
1241 | return; | ||
1233 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) | 1242 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) |
1234 | return; /* no unsol support */ | 1243 | return; /* no unsol support */ |
1235 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", | 1244 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", |
@@ -1834,10 +1843,8 @@ static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) | |||
1834 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1843 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
1835 | static void alc889_power_eapd(struct hda_codec *codec, int power) | 1844 | static void alc889_power_eapd(struct hda_codec *codec, int power) |
1836 | { | 1845 | { |
1837 | snd_hda_codec_write(codec, 0x14, 0, | 1846 | set_eapd(codec, 0x14, power); |
1838 | AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0); | 1847 | set_eapd(codec, 0x15, power); |
1839 | snd_hda_codec_write(codec, 0x15, 0, | ||
1840 | AC_VERB_SET_EAPD_BTLENABLE, power ? 2 : 0); | ||
1841 | } | 1848 | } |
1842 | #endif | 1849 | #endif |
1843 | 1850 | ||
@@ -4812,6 +4819,49 @@ static void fixup_automic_adc(struct hda_codec *codec) | |||
4812 | spec->auto_mic = 0; /* disable auto-mic to be sure */ | 4819 | spec->auto_mic = 0; /* disable auto-mic to be sure */ |
4813 | } | 4820 | } |
4814 | 4821 | ||
4822 | /* choose the ADC/MUX containing the input pin and initialize the setup */ | ||
4823 | static void fixup_single_adc(struct hda_codec *codec) | ||
4824 | { | ||
4825 | struct alc_spec *spec = codec->spec; | ||
4826 | hda_nid_t pin; | ||
4827 | int i; | ||
4828 | |||
4829 | /* search for the input pin; there must be only one */ | ||
4830 | for (i = 0; i < AUTO_PIN_LAST; i++) { | ||
4831 | if (spec->autocfg.input_pins[i]) { | ||
4832 | pin = spec->autocfg.input_pins[i]; | ||
4833 | break; | ||
4834 | } | ||
4835 | } | ||
4836 | if (!pin) | ||
4837 | return; | ||
4838 | |||
4839 | /* set the default connection to that pin */ | ||
4840 | for (i = 0; i < spec->num_adc_nids; i++) { | ||
4841 | hda_nid_t cap = spec->capsrc_nids ? | ||
4842 | spec->capsrc_nids[i] : spec->adc_nids[i]; | ||
4843 | int idx; | ||
4844 | |||
4845 | idx = get_connection_index(codec, cap, pin); | ||
4846 | if (idx < 0) | ||
4847 | continue; | ||
4848 | /* use only this ADC */ | ||
4849 | if (spec->capsrc_nids) | ||
4850 | spec->capsrc_nids += i; | ||
4851 | spec->adc_nids += i; | ||
4852 | spec->num_adc_nids = 1; | ||
4853 | /* select or unmute this route */ | ||
4854 | if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) { | ||
4855 | snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx, | ||
4856 | HDA_AMP_MUTE, 0); | ||
4857 | } else { | ||
4858 | snd_hda_codec_write_cache(codec, cap, 0, | ||
4859 | AC_VERB_SET_CONNECT_SEL, idx); | ||
4860 | } | ||
4861 | return; | ||
4862 | } | ||
4863 | } | ||
4864 | |||
4815 | static void set_capture_mixer(struct hda_codec *codec) | 4865 | static void set_capture_mixer(struct hda_codec *codec) |
4816 | { | 4866 | { |
4817 | struct alc_spec *spec = codec->spec; | 4867 | struct alc_spec *spec = codec->spec; |
@@ -4824,14 +4874,15 @@ static void set_capture_mixer(struct hda_codec *codec) | |||
4824 | alc_capture_mixer3 }, | 4874 | alc_capture_mixer3 }, |
4825 | }; | 4875 | }; |
4826 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { | 4876 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { |
4827 | int mux; | 4877 | int mux = 0; |
4828 | if (spec->auto_mic) { | 4878 | if (spec->auto_mic) |
4829 | mux = 0; | ||
4830 | fixup_automic_adc(codec); | 4879 | fixup_automic_adc(codec); |
4831 | } else if (spec->input_mux && spec->input_mux->num_items > 1) | 4880 | else if (spec->input_mux) { |
4832 | mux = 1; | 4881 | if (spec->input_mux->num_items > 1) |
4833 | else | 4882 | mux = 1; |
4834 | mux = 0; | 4883 | else if (spec->input_mux->num_items == 1) |
4884 | fixup_single_adc(codec); | ||
4885 | } | ||
4835 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; | 4886 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; |
4836 | } | 4887 | } |
4837 | } | 4888 | } |
@@ -7094,8 +7145,8 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = { | |||
7094 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), | 7145 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), |
7095 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), | 7146 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), |
7096 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), | 7147 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), |
7097 | HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT), | 7148 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT), |
7098 | HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT), | 7149 | HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT), |
7099 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | 7150 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), |
7100 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | 7151 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), |
7101 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | 7152 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), |
@@ -7496,6 +7547,7 @@ static struct hda_verb alc885_mb5_init_verbs[] = { | |||
7496 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 7547 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
7497 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 7548 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
7498 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, | 7549 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, |
7550 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
7499 | /* Front Mic pin: input vref at 80% */ | 7551 | /* Front Mic pin: input vref at 80% */ |
7500 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 7552 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
7501 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 7553 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
@@ -7680,6 +7732,27 @@ static void alc885_mbp3_setup(struct hda_codec *codec) | |||
7680 | spec->autocfg.speaker_pins[0] = 0x14; | 7732 | spec->autocfg.speaker_pins[0] = 0x14; |
7681 | } | 7733 | } |
7682 | 7734 | ||
7735 | static void alc885_mb5_automute(struct hda_codec *codec) | ||
7736 | { | ||
7737 | unsigned int present; | ||
7738 | |||
7739 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
7740 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
7741 | snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0, | ||
7742 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7743 | snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, | ||
7744 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7745 | |||
7746 | } | ||
7747 | |||
7748 | static void alc885_mb5_unsol_event(struct hda_codec *codec, | ||
7749 | unsigned int res) | ||
7750 | { | ||
7751 | /* Headphone insertion or removal. */ | ||
7752 | if ((res >> 26) == ALC880_HP_EVENT) | ||
7753 | alc885_mb5_automute(codec); | ||
7754 | } | ||
7755 | |||
7683 | static void alc885_imac91_automute(struct hda_codec *codec) | 7756 | static void alc885_imac91_automute(struct hda_codec *codec) |
7684 | { | 7757 | { |
7685 | unsigned int present; | 7758 | unsigned int present; |
@@ -9126,6 +9199,8 @@ static struct alc_config_preset alc882_presets[] = { | |||
9126 | .input_mux = &mb5_capture_source, | 9199 | .input_mux = &mb5_capture_source, |
9127 | .dig_out_nid = ALC882_DIGOUT_NID, | 9200 | .dig_out_nid = ALC882_DIGOUT_NID, |
9128 | .dig_in_nid = ALC882_DIGIN_NID, | 9201 | .dig_in_nid = ALC882_DIGIN_NID, |
9202 | .unsol_event = alc885_mb5_unsol_event, | ||
9203 | .init_hook = alc885_mb5_automute, | ||
9129 | }, | 9204 | }, |
9130 | [ALC885_MACPRO] = { | 9205 | [ALC885_MACPRO] = { |
9131 | .mixers = { alc882_macpro_mixer }, | 9206 | .mixers = { alc882_macpro_mixer }, |
@@ -9403,6 +9478,7 @@ static struct alc_config_preset alc882_presets[] = { | |||
9403 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), | 9478 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), |
9404 | .channel_mode = alc883_3ST_6ch_modes, | 9479 | .channel_mode = alc883_3ST_6ch_modes, |
9405 | .need_dac_fix = 1, | 9480 | .need_dac_fix = 1, |
9481 | .const_channel_count = 6, | ||
9406 | .num_mux_defs = | 9482 | .num_mux_defs = |
9407 | ARRAY_SIZE(alc888_2_capture_sources), | 9483 | ARRAY_SIZE(alc888_2_capture_sources), |
9408 | .input_mux = alc888_2_capture_sources, | 9484 | .input_mux = alc888_2_capture_sources, |
@@ -10307,7 +10383,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec) | |||
10307 | struct alc_spec *spec = codec->spec; | 10383 | struct alc_spec *spec = codec->spec; |
10308 | 10384 | ||
10309 | spec->autocfg.hp_pins[0] = 0x15; | 10385 | spec->autocfg.hp_pins[0] = 0x15; |
10310 | spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */ | 10386 | spec->autocfg.speaker_pins[0] = 0x14; |
10311 | } | 10387 | } |
10312 | 10388 | ||
10313 | static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = { | 10389 | static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = { |
@@ -11179,7 +11255,7 @@ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
11179 | } | 11255 | } |
11180 | 11256 | ||
11181 | #define alc262_auto_create_input_ctls \ | 11257 | #define alc262_auto_create_input_ctls \ |
11182 | alc880_auto_create_input_ctls | 11258 | alc882_auto_create_input_ctls |
11183 | 11259 | ||
11184 | /* | 11260 | /* |
11185 | * generic initialization of ADC, input mixers and output mixers | 11261 | * generic initialization of ADC, input mixers and output mixers |
@@ -11718,9 +11794,9 @@ static struct alc_config_preset alc262_presets[] = { | |||
11718 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | 11794 | .num_channel_mode = ARRAY_SIZE(alc262_modes), |
11719 | .channel_mode = alc262_modes, | 11795 | .channel_mode = alc262_modes, |
11720 | .input_mux = &alc262_capture_source, | 11796 | .input_mux = &alc262_capture_source, |
11721 | .unsol_event = alc_automute_amp_unsol_event, | 11797 | .unsol_event = alc_sku_unsol_event, |
11722 | .setup = alc262_hp_t5735_setup, | 11798 | .setup = alc262_hp_t5735_setup, |
11723 | .init_hook = alc_automute_amp, | 11799 | .init_hook = alc_inithook, |
11724 | }, | 11800 | }, |
11725 | [ALC262_HP_RP5700] = { | 11801 | [ALC262_HP_RP5700] = { |
11726 | .mixers = { alc262_hp_rp5700_mixer }, | 11802 | .mixers = { alc262_hp_rp5700_mixer }, |
@@ -12471,6 +12547,7 @@ static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid, | |||
12471 | dac = 0x02; | 12547 | dac = 0x02; |
12472 | break; | 12548 | break; |
12473 | case 0x15: | 12549 | case 0x15: |
12550 | case 0x21: | ||
12474 | dac = 0x03; | 12551 | dac = 0x03; |
12475 | break; | 12552 | break; |
12476 | default: | 12553 | default: |
@@ -14855,6 +14932,8 @@ static int patch_alc861(struct hda_codec *codec) | |||
14855 | spec->stream_digital_playback = &alc861_pcm_digital_playback; | 14932 | spec->stream_digital_playback = &alc861_pcm_digital_playback; |
14856 | spec->stream_digital_capture = &alc861_pcm_digital_capture; | 14933 | spec->stream_digital_capture = &alc861_pcm_digital_capture; |
14857 | 14934 | ||
14935 | if (!spec->cap_mixer) | ||
14936 | set_capture_mixer(codec); | ||
14858 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | 14937 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
14859 | 14938 | ||
14860 | spec->vmaster_nid = 0x03; | 14939 | spec->vmaster_nid = 0x03; |
@@ -17251,7 +17330,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { | |||
17251 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), | 17330 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), |
17252 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", | 17331 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", |
17253 | ALC662_3ST_6ch_DIG), | 17332 | ALC662_3ST_6ch_DIG), |
17254 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4), | 17333 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO), |
17255 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), | 17334 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), |
17256 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", | 17335 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", |
17257 | ALC662_3ST_6ch_DIG), | 17336 | ALC662_3ST_6ch_DIG), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 2291a8396817..799ba2570902 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4730,6 +4730,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4730 | } | 4730 | } |
4731 | } | 4731 | } |
4732 | 4732 | ||
4733 | static int hp_blike_system(u32 subsystem_id); | ||
4734 | |||
4735 | static void set_hp_led_gpio(struct hda_codec *codec) | ||
4736 | { | ||
4737 | struct sigmatel_spec *spec = codec->spec; | ||
4738 | switch (codec->vendor_id) { | ||
4739 | case 0x111d7608: | ||
4740 | /* GPIO 0 */ | ||
4741 | spec->gpio_led = 0x01; | ||
4742 | break; | ||
4743 | case 0x111d7600: | ||
4744 | case 0x111d7601: | ||
4745 | case 0x111d7602: | ||
4746 | case 0x111d7603: | ||
4747 | /* GPIO 3 */ | ||
4748 | spec->gpio_led = 0x08; | ||
4749 | break; | ||
4750 | } | ||
4751 | } | ||
4752 | |||
4733 | /* | 4753 | /* |
4734 | * This method searches for the mute LED GPIO configuration | 4754 | * This method searches for the mute LED GPIO configuration |
4735 | * provided as OEM string in SMBIOS. The format of that string | 4755 | * provided as OEM string in SMBIOS. The format of that string |
@@ -4741,6 +4761,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4741 | * | 4761 | * |
4742 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) | 4762 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) |
4743 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings | 4763 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings |
4764 | * | ||
4765 | * | ||
4766 | * The dv-series laptops don't seem to have the HP_Mute_LED* strings in | ||
4767 | * SMBIOS - at least the ones I have seen do not have them - which include | ||
4768 | * my own system (HP Pavilion dv6-1110ax) and my cousin's | ||
4769 | * HP Pavilion dv9500t CTO. | ||
4770 | * Need more information on whether it is true across the entire series. | ||
4771 | * -- kunal | ||
4744 | */ | 4772 | */ |
4745 | static int find_mute_led_gpio(struct hda_codec *codec) | 4773 | static int find_mute_led_gpio(struct hda_codec *codec) |
4746 | { | 4774 | { |
@@ -4751,28 +4779,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) | |||
4751 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 4779 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, |
4752 | NULL, dev))) { | 4780 | NULL, dev))) { |
4753 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", | 4781 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", |
4754 | &spec->gpio_led_polarity, | 4782 | &spec->gpio_led_polarity, |
4755 | &spec->gpio_led) == 2) { | 4783 | &spec->gpio_led) == 2) { |
4756 | spec->gpio_led = 1 << spec->gpio_led; | 4784 | spec->gpio_led = 1 << spec->gpio_led; |
4757 | return 1; | 4785 | return 1; |
4758 | } | 4786 | } |
4759 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4787 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
4760 | &spec->gpio_led_polarity) == 1) { | 4788 | &spec->gpio_led_polarity) == 1) { |
4761 | switch (codec->vendor_id) { | 4789 | set_hp_led_gpio(codec); |
4762 | case 0x111d7608: | 4790 | return 1; |
4763 | /* GPIO 0 */ | ||
4764 | spec->gpio_led = 0x01; | ||
4765 | return 1; | ||
4766 | case 0x111d7600: | ||
4767 | case 0x111d7601: | ||
4768 | case 0x111d7602: | ||
4769 | case 0x111d7603: | ||
4770 | /* GPIO 3 */ | ||
4771 | spec->gpio_led = 0x08; | ||
4772 | return 1; | ||
4773 | } | ||
4774 | } | 4791 | } |
4775 | } | 4792 | } |
4793 | |||
4794 | /* | ||
4795 | * Fallback case - if we don't find the DMI strings, | ||
4796 | * we statically set the GPIO - if not a B-series system. | ||
4797 | */ | ||
4798 | if (!hp_blike_system(codec->subsystem_id)) { | ||
4799 | set_hp_led_gpio(codec); | ||
4800 | spec->gpio_led_polarity = 1; | ||
4801 | return 1; | ||
4802 | } | ||
4776 | } | 4803 | } |
4777 | return 0; | 4804 | return 0; |
4778 | } | 4805 | } |
@@ -5548,6 +5575,8 @@ again: | |||
5548 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); | 5575 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); |
5549 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); | 5576 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); |
5550 | 5577 | ||
5578 | snd_printdd("Found board config: %d\n", spec->board_config); | ||
5579 | |||
5551 | switch (spec->board_config) { | 5580 | switch (spec->board_config) { |
5552 | case STAC_HP_M4: | 5581 | case STAC_HP_M4: |
5553 | /* enable internal microphone */ | 5582 | /* enable internal microphone */ |
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; |
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 2e156467b814..b36679384b27 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c | |||
@@ -751,8 +751,8 @@ static void snd_pmac_awacs_suspend(struct snd_pmac *chip) | |||
751 | 751 | ||
752 | static void snd_pmac_awacs_resume(struct snd_pmac *chip) | 752 | static void snd_pmac_awacs_resume(struct snd_pmac *chip) |
753 | { | 753 | { |
754 | if (machine_is_compatible("PowerBook3,1") | 754 | if (of_machine_is_compatible("PowerBook3,1") |
755 | || machine_is_compatible("PowerBook3,2")) { | 755 | || of_machine_is_compatible("PowerBook3,2")) { |
756 | msleep(100); | 756 | msleep(100); |
757 | snd_pmac_awacs_write_reg(chip, 1, | 757 | snd_pmac_awacs_write_reg(chip, 1, |
758 | chip->awacs_reg[1] & ~MASK_PAROUT); | 758 | chip->awacs_reg[1] & ~MASK_PAROUT); |
@@ -780,16 +780,16 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip) | |||
780 | } | 780 | } |
781 | #endif /* CONFIG_PM */ | 781 | #endif /* CONFIG_PM */ |
782 | 782 | ||
783 | #define IS_PM7500 (machine_is_compatible("AAPL,7500") \ | 783 | #define IS_PM7500 (of_machine_is_compatible("AAPL,7500") \ |
784 | || machine_is_compatible("AAPL,8500") \ | 784 | || of_machine_is_compatible("AAPL,8500") \ |
785 | || machine_is_compatible("AAPL,9500")) | 785 | || of_machine_is_compatible("AAPL,9500")) |
786 | #define IS_PM5500 (machine_is_compatible("AAPL,e411")) | 786 | #define IS_PM5500 (of_machine_is_compatible("AAPL,e411")) |
787 | #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer")) | 787 | #define IS_BEIGE (of_machine_is_compatible("AAPL,Gossamer")) |
788 | #define IS_IMAC1 (machine_is_compatible("PowerMac2,1")) | 788 | #define IS_IMAC1 (of_machine_is_compatible("PowerMac2,1")) |
789 | #define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \ | 789 | #define IS_IMAC2 (of_machine_is_compatible("PowerMac2,2") \ |
790 | || machine_is_compatible("PowerMac4,1")) | 790 | || of_machine_is_compatible("PowerMac4,1")) |
791 | #define IS_G4AGP (machine_is_compatible("PowerMac3,1")) | 791 | #define IS_G4AGP (of_machine_is_compatible("PowerMac3,1")) |
792 | #define IS_LOMBARD (machine_is_compatible("PowerBook1,1")) | 792 | #define IS_LOMBARD (of_machine_is_compatible("PowerBook1,1")) |
793 | 793 | ||
794 | static int imac1, imac2; | 794 | static int imac1, imac2; |
795 | 795 | ||
diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c index 0accfe49735b..1f72e1c786bf 100644 --- a/sound/ppc/burgundy.c +++ b/sound/ppc/burgundy.c | |||
@@ -582,7 +582,7 @@ static int snd_pmac_burgundy_detect_headphone(struct snd_pmac *chip) | |||
582 | static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_notify) | 582 | static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_notify) |
583 | { | 583 | { |
584 | if (chip->auto_mute) { | 584 | if (chip->auto_mute) { |
585 | int imac = machine_is_compatible("iMac"); | 585 | int imac = of_machine_is_compatible("iMac"); |
586 | int reg, oreg; | 586 | int reg, oreg; |
587 | reg = oreg = snd_pmac_burgundy_rcb(chip, | 587 | reg = oreg = snd_pmac_burgundy_rcb(chip, |
588 | MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES); | 588 | MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES); |
@@ -620,7 +620,7 @@ static void snd_pmac_burgundy_update_automute(struct snd_pmac *chip, int do_noti | |||
620 | */ | 620 | */ |
621 | int __devinit snd_pmac_burgundy_init(struct snd_pmac *chip) | 621 | int __devinit snd_pmac_burgundy_init(struct snd_pmac *chip) |
622 | { | 622 | { |
623 | int imac = machine_is_compatible("iMac"); | 623 | int imac = of_machine_is_compatible("iMac"); |
624 | int i, err; | 624 | int i, err; |
625 | 625 | ||
626 | /* Checks to see the chip is alive and kicking */ | 626 | /* Checks to see the chip is alive and kicking */ |
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 7bc492ee77ec..85081172403f 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c | |||
@@ -922,11 +922,11 @@ static void __devinit detect_byte_swap(struct snd_pmac *chip) | |||
922 | } | 922 | } |
923 | 923 | ||
924 | /* it seems the Pismo & iBook can't byte-swap in hardware. */ | 924 | /* it seems the Pismo & iBook can't byte-swap in hardware. */ |
925 | if (machine_is_compatible("PowerBook3,1") || | 925 | if (of_machine_is_compatible("PowerBook3,1") || |
926 | machine_is_compatible("PowerBook2,1")) | 926 | of_machine_is_compatible("PowerBook2,1")) |
927 | chip->can_byte_swap = 0 ; | 927 | chip->can_byte_swap = 0 ; |
928 | 928 | ||
929 | if (machine_is_compatible("PowerBook2,1")) | 929 | if (of_machine_is_compatible("PowerBook2,1")) |
930 | chip->can_duplex = 0; | 930 | chip->can_duplex = 0; |
931 | } | 931 | } |
932 | 932 | ||
@@ -959,11 +959,11 @@ static int __devinit snd_pmac_detect(struct snd_pmac *chip) | |||
959 | chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */ | 959 | chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */ |
960 | 960 | ||
961 | /* check machine type */ | 961 | /* check machine type */ |
962 | if (machine_is_compatible("AAPL,3400/2400") | 962 | if (of_machine_is_compatible("AAPL,3400/2400") |
963 | || machine_is_compatible("AAPL,3500")) | 963 | || of_machine_is_compatible("AAPL,3500")) |
964 | chip->is_pbook_3400 = 1; | 964 | chip->is_pbook_3400 = 1; |
965 | else if (machine_is_compatible("PowerBook1,1") | 965 | else if (of_machine_is_compatible("PowerBook1,1") |
966 | || machine_is_compatible("AAPL,PowerBook1998")) | 966 | || of_machine_is_compatible("AAPL,PowerBook1998")) |
967 | chip->is_pbook_G3 = 1; | 967 | chip->is_pbook_G3 = 1; |
968 | chip->node = of_find_node_by_name(NULL, "awacs"); | 968 | chip->node = of_find_node_by_name(NULL, "awacs"); |
969 | sound = of_node_get(chip->node); | 969 | sound = of_node_get(chip->node); |
@@ -1033,8 +1033,8 @@ static int __devinit snd_pmac_detect(struct snd_pmac *chip) | |||
1033 | } | 1033 | } |
1034 | if (of_device_is_compatible(sound, "tumbler")) { | 1034 | if (of_device_is_compatible(sound, "tumbler")) { |
1035 | chip->model = PMAC_TUMBLER; | 1035 | chip->model = PMAC_TUMBLER; |
1036 | chip->can_capture = machine_is_compatible("PowerMac4,2") | 1036 | chip->can_capture = of_machine_is_compatible("PowerMac4,2") |
1037 | || machine_is_compatible("PowerBook4,1"); | 1037 | || of_machine_is_compatible("PowerBook4,1"); |
1038 | chip->can_duplex = 0; | 1038 | chip->can_duplex = 0; |
1039 | // chip->can_byte_swap = 0; /* FIXME: check this */ | 1039 | // chip->can_byte_swap = 0; /* FIXME: check this */ |
1040 | chip->num_freqs = ARRAY_SIZE(tumbler_freqs); | 1040 | chip->num_freqs = ARRAY_SIZE(tumbler_freqs); |
diff --git a/sound/soc/au1x/Kconfig b/sound/soc/au1x/Kconfig index 410a893aa66b..4b67140fdec3 100644 --- a/sound/soc/au1x/Kconfig +++ b/sound/soc/au1x/Kconfig | |||
@@ -22,11 +22,13 @@ config SND_SOC_AU1XPSC_AC97 | |||
22 | ## | 22 | ## |
23 | ## Boards | 23 | ## Boards |
24 | ## | 24 | ## |
25 | config SND_SOC_SAMPLE_PSC_AC97 | 25 | config SND_SOC_DB1200 |
26 | tristate "Sample Au12x0/Au1550 PSC AC97 sound machine" | 26 | tristate "DB1200 AC97+I2S audio support" |
27 | depends on SND_SOC_AU1XPSC | 27 | depends on SND_SOC_AU1XPSC |
28 | select SND_SOC_AU1XPSC_AC97 | 28 | select SND_SOC_AU1XPSC_AC97 |
29 | select SND_SOC_AC97_CODEC | 29 | select SND_SOC_AC97_CODEC |
30 | select SND_SOC_AU1XPSC_I2S | ||
31 | select SND_SOC_WM8731 | ||
30 | help | 32 | help |
31 | This is a sample AC97 sound machine for use in Au12x0/Au1550 | 33 | Select this option to enable audio (AC97 or I2S) on the |
32 | based systems which have audio on PSC1 (e.g. Db1200 demoboard). | 34 | Alchemy/AMD/RMI DB1200 demoboard. |
diff --git a/sound/soc/au1x/Makefile b/sound/soc/au1x/Makefile index 6c6950b8003a..16873076e8c4 100644 --- a/sound/soc/au1x/Makefile +++ b/sound/soc/au1x/Makefile | |||
@@ -8,6 +8,6 @@ obj-$(CONFIG_SND_SOC_AU1XPSC_I2S) += snd-soc-au1xpsc-i2s.o | |||
8 | obj-$(CONFIG_SND_SOC_AU1XPSC_AC97) += snd-soc-au1xpsc-ac97.o | 8 | obj-$(CONFIG_SND_SOC_AU1XPSC_AC97) += snd-soc-au1xpsc-ac97.o |
9 | 9 | ||
10 | # Boards | 10 | # Boards |
11 | snd-soc-sample-ac97-objs := sample-ac97.o | 11 | snd-soc-db1200-objs := db1200.o |
12 | 12 | ||
13 | obj-$(CONFIG_SND_SOC_SAMPLE_PSC_AC97) += snd-soc-sample-ac97.o | 13 | obj-$(CONFIG_SND_SOC_DB1200) += snd-soc-db1200.o |
diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c new file mode 100644 index 000000000000..cdf7be1b9b91 --- /dev/null +++ b/sound/soc/au1x/db1200.c | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * DB1200 ASoC audio fabric support code. | ||
3 | * | ||
4 | * (c) 2008-9 Manuel Lauss <manuel.lauss@gmail.com> | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #include <linux/module.h> | ||
9 | #include <linux/moduleparam.h> | ||
10 | #include <linux/timer.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <sound/core.h> | ||
14 | #include <sound/pcm.h> | ||
15 | #include <sound/soc.h> | ||
16 | #include <sound/soc-dapm.h> | ||
17 | #include <asm/mach-au1x00/au1000.h> | ||
18 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
19 | #include <asm/mach-au1x00/au1xxx_dbdma.h> | ||
20 | #include <asm/mach-db1x00/bcsr.h> | ||
21 | |||
22 | #include "../codecs/ac97.h" | ||
23 | #include "../codecs/wm8731.h" | ||
24 | #include "psc.h" | ||
25 | |||
26 | /*------------------------- AC97 PART ---------------------------*/ | ||
27 | |||
28 | static struct snd_soc_dai_link db1200_ac97_dai = { | ||
29 | .name = "AC97", | ||
30 | .stream_name = "AC97 HiFi", | ||
31 | .cpu_dai = &au1xpsc_ac97_dai, | ||
32 | .codec_dai = &ac97_dai, | ||
33 | }; | ||
34 | |||
35 | static struct snd_soc_card db1200_ac97_machine = { | ||
36 | .name = "DB1200_AC97", | ||
37 | .dai_link = &db1200_ac97_dai, | ||
38 | .num_links = 1, | ||
39 | .platform = &au1xpsc_soc_platform, | ||
40 | }; | ||
41 | |||
42 | static struct snd_soc_device db1200_ac97_devdata = { | ||
43 | .card = &db1200_ac97_machine, | ||
44 | .codec_dev = &soc_codec_dev_ac97, | ||
45 | }; | ||
46 | |||
47 | /*------------------------- I2S PART ---------------------------*/ | ||
48 | |||
49 | static int db1200_i2s_startup(struct snd_pcm_substream *substream) | ||
50 | { | ||
51 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
52 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | ||
53 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | ||
54 | int ret; | ||
55 | |||
56 | /* WM8731 has its own 12MHz crystal */ | ||
57 | snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, | ||
58 | 12000000, SND_SOC_CLOCK_IN); | ||
59 | |||
60 | /* codec is bitclock and lrclk master */ | ||
61 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_LEFT_J | | ||
62 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
63 | if (ret < 0) | ||
64 | goto out; | ||
65 | |||
66 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_LEFT_J | | ||
67 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
68 | if (ret < 0) | ||
69 | goto out; | ||
70 | |||
71 | ret = 0; | ||
72 | out: | ||
73 | return ret; | ||
74 | } | ||
75 | |||
76 | static struct snd_soc_ops db1200_i2s_wm8731_ops = { | ||
77 | .startup = db1200_i2s_startup, | ||
78 | }; | ||
79 | |||
80 | static struct snd_soc_dai_link db1200_i2s_dai = { | ||
81 | .name = "WM8731", | ||
82 | .stream_name = "WM8731 PCM", | ||
83 | .cpu_dai = &au1xpsc_i2s_dai, | ||
84 | .codec_dai = &wm8731_dai, | ||
85 | .ops = &db1200_i2s_wm8731_ops, | ||
86 | }; | ||
87 | |||
88 | static struct snd_soc_card db1200_i2s_machine = { | ||
89 | .name = "DB1200_I2S", | ||
90 | .dai_link = &db1200_i2s_dai, | ||
91 | .num_links = 1, | ||
92 | .platform = &au1xpsc_soc_platform, | ||
93 | }; | ||
94 | |||
95 | static struct snd_soc_device db1200_i2s_devdata = { | ||
96 | .card = &db1200_i2s_machine, | ||
97 | .codec_dev = &soc_codec_dev_wm8731, | ||
98 | }; | ||
99 | |||
100 | /*------------------------- COMMON PART ---------------------------*/ | ||
101 | |||
102 | static struct platform_device *db1200_asoc_dev; | ||
103 | |||
104 | static int __init db1200_audio_load(void) | ||
105 | { | ||
106 | int ret; | ||
107 | |||
108 | ret = -ENOMEM; | ||
109 | db1200_asoc_dev = platform_device_alloc("soc-audio", -1); | ||
110 | if (!db1200_asoc_dev) | ||
111 | goto out; | ||
112 | |||
113 | /* DB1200 board setup set PSC1MUX to preferred audio device */ | ||
114 | if (bcsr_read(BCSR_RESETS) & BCSR_RESETS_PSC1MUX) | ||
115 | platform_set_drvdata(db1200_asoc_dev, &db1200_i2s_devdata); | ||
116 | else | ||
117 | platform_set_drvdata(db1200_asoc_dev, &db1200_ac97_devdata); | ||
118 | |||
119 | db1200_ac97_devdata.dev = &db1200_asoc_dev->dev; | ||
120 | db1200_i2s_devdata.dev = &db1200_asoc_dev->dev; | ||
121 | ret = platform_device_add(db1200_asoc_dev); | ||
122 | |||
123 | if (ret) { | ||
124 | platform_device_put(db1200_asoc_dev); | ||
125 | db1200_asoc_dev = NULL; | ||
126 | } | ||
127 | out: | ||
128 | return ret; | ||
129 | } | ||
130 | |||
131 | static void __exit db1200_audio_unload(void) | ||
132 | { | ||
133 | platform_device_unregister(db1200_asoc_dev); | ||
134 | } | ||
135 | |||
136 | module_init(db1200_audio_load); | ||
137 | module_exit(db1200_audio_unload); | ||
138 | |||
139 | MODULE_LICENSE("GPL"); | ||
140 | MODULE_DESCRIPTION("DB1200 ASoC audio support"); | ||
141 | MODULE_AUTHOR("Manuel Lauss"); | ||
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index 19e4d37eba1c..6d9f4c624949 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c | |||
@@ -51,8 +51,8 @@ struct au1xpsc_audio_dmadata { | |||
51 | struct snd_pcm_substream *substream; | 51 | struct snd_pcm_substream *substream; |
52 | unsigned long curr_period; /* current segment DDMA is working on */ | 52 | unsigned long curr_period; /* current segment DDMA is working on */ |
53 | unsigned long q_period; /* queue period(s) */ | 53 | unsigned long q_period; /* queue period(s) */ |
54 | unsigned long dma_area; /* address of queued DMA area */ | 54 | dma_addr_t dma_area; /* address of queued DMA area */ |
55 | unsigned long dma_area_s; /* start address of DMA area */ | 55 | dma_addr_t dma_area_s; /* start address of DMA area */ |
56 | unsigned long pos; /* current byte position being played */ | 56 | unsigned long pos; /* current byte position being played */ |
57 | unsigned long periods; /* number of SG segments in total */ | 57 | unsigned long periods; /* number of SG segments in total */ |
58 | unsigned long period_bytes; /* size in bytes of one SG segment */ | 58 | unsigned long period_bytes; /* size in bytes of one SG segment */ |
@@ -94,8 +94,7 @@ static const struct snd_pcm_hardware au1xpsc_pcm_hardware = { | |||
94 | 94 | ||
95 | static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd) | 95 | static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd) |
96 | { | 96 | { |
97 | au1xxx_dbdma_put_source_flags(cd->ddma_chan, | 97 | au1xxx_dbdma_put_source(cd->ddma_chan, cd->dma_area, |
98 | (void *)phys_to_virt(cd->dma_area), | ||
99 | cd->period_bytes, DDMA_FLAGS_IE); | 98 | cd->period_bytes, DDMA_FLAGS_IE); |
100 | 99 | ||
101 | /* update next-to-queue period */ | 100 | /* update next-to-queue period */ |
@@ -109,9 +108,8 @@ static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd) | |||
109 | 108 | ||
110 | static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd) | 109 | static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd) |
111 | { | 110 | { |
112 | au1xxx_dbdma_put_dest_flags(cd->ddma_chan, | 111 | au1xxx_dbdma_put_dest(cd->ddma_chan, cd->dma_area, |
113 | (void *)phys_to_virt(cd->dma_area), | 112 | cd->period_bytes, DDMA_FLAGS_IE); |
114 | cd->period_bytes, DDMA_FLAGS_IE); | ||
115 | 113 | ||
116 | /* update next-to-queue period */ | 114 | /* update next-to-queue period */ |
117 | ++cd->q_period; | 115 | ++cd->q_period; |
@@ -233,7 +231,7 @@ static int au1xpsc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
233 | pcd->substream = substream; | 231 | pcd->substream = substream; |
234 | pcd->period_bytes = params_period_bytes(params); | 232 | pcd->period_bytes = params_period_bytes(params); |
235 | pcd->periods = params_periods(params); | 233 | pcd->periods = params_periods(params); |
236 | pcd->dma_area_s = pcd->dma_area = (unsigned long)runtime->dma_addr; | 234 | pcd->dma_area_s = pcd->dma_area = runtime->dma_addr; |
237 | pcd->q_period = 0; | 235 | pcd->q_period = 0; |
238 | pcd->curr_period = 0; | 236 | pcd->curr_period = 0; |
239 | pcd->pos = 0; | 237 | pcd->pos = 0; |
diff --git a/sound/soc/au1x/sample-ac97.c b/sound/soc/au1x/sample-ac97.c deleted file mode 100644 index 27683eb7905e..000000000000 --- a/sound/soc/au1x/sample-ac97.c +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | /* | ||
2 | * Sample Au12x0/Au1550 PSC AC97 sound machine. | ||
3 | * | ||
4 | * Copyright (c) 2007-2008 Manuel Lauss <mano@roarinelk.homelinux.net> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms outlined in the file COPYING at the root of this | ||
8 | * source archive. | ||
9 | * | ||
10 | * This is a very generic AC97 sound machine driver for boards which | ||
11 | * have (AC97) audio at PSC1 (e.g. DB1200 demoboards). | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/moduleparam.h> | ||
16 | #include <linux/timer.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <sound/core.h> | ||
20 | #include <sound/pcm.h> | ||
21 | #include <sound/soc.h> | ||
22 | #include <sound/soc-dapm.h> | ||
23 | #include <asm/mach-au1x00/au1000.h> | ||
24 | #include <asm/mach-au1x00/au1xxx_psc.h> | ||
25 | #include <asm/mach-au1x00/au1xxx_dbdma.h> | ||
26 | |||
27 | #include "../codecs/ac97.h" | ||
28 | #include "psc.h" | ||
29 | |||
30 | static int au1xpsc_sample_ac97_init(struct snd_soc_codec *codec) | ||
31 | { | ||
32 | snd_soc_dapm_sync(codec); | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | static struct snd_soc_dai_link au1xpsc_sample_ac97_dai = { | ||
37 | .name = "AC97", | ||
38 | .stream_name = "AC97 HiFi", | ||
39 | .cpu_dai = &au1xpsc_ac97_dai, /* see psc-ac97.c */ | ||
40 | .codec_dai = &ac97_dai, /* see codecs/ac97.c */ | ||
41 | .init = au1xpsc_sample_ac97_init, | ||
42 | .ops = NULL, | ||
43 | }; | ||
44 | |||
45 | static struct snd_soc_card au1xpsc_sample_ac97_machine = { | ||
46 | .name = "Au1xxx PSC AC97 Audio", | ||
47 | .dai_link = &au1xpsc_sample_ac97_dai, | ||
48 | .num_links = 1, | ||
49 | }; | ||
50 | |||
51 | static struct snd_soc_device au1xpsc_sample_ac97_devdata = { | ||
52 | .card = &au1xpsc_sample_ac97_machine, | ||
53 | .platform = &au1xpsc_soc_platform, /* see dbdma2.c */ | ||
54 | .codec_dev = &soc_codec_dev_ac97, | ||
55 | }; | ||
56 | |||
57 | static struct resource au1xpsc_psc1_res[] = { | ||
58 | [0] = { | ||
59 | .start = CPHYSADDR(PSC1_BASE_ADDR), | ||
60 | .end = CPHYSADDR(PSC1_BASE_ADDR) + 0x000fffff, | ||
61 | .flags = IORESOURCE_MEM, | ||
62 | }, | ||
63 | [1] = { | ||
64 | #ifdef CONFIG_SOC_AU1200 | ||
65 | .start = AU1200_PSC1_INT, | ||
66 | .end = AU1200_PSC1_INT, | ||
67 | #elif defined(CONFIG_SOC_AU1550) | ||
68 | .start = AU1550_PSC1_INT, | ||
69 | .end = AU1550_PSC1_INT, | ||
70 | #endif | ||
71 | .flags = IORESOURCE_IRQ, | ||
72 | }, | ||
73 | [2] = { | ||
74 | .start = DSCR_CMD0_PSC1_TX, | ||
75 | .end = DSCR_CMD0_PSC1_TX, | ||
76 | .flags = IORESOURCE_DMA, | ||
77 | }, | ||
78 | [3] = { | ||
79 | .start = DSCR_CMD0_PSC1_RX, | ||
80 | .end = DSCR_CMD0_PSC1_RX, | ||
81 | .flags = IORESOURCE_DMA, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct platform_device *au1xpsc_sample_ac97_dev; | ||
86 | |||
87 | static int __init au1xpsc_sample_ac97_load(void) | ||
88 | { | ||
89 | int ret; | ||
90 | |||
91 | #ifdef CONFIG_SOC_AU1200 | ||
92 | unsigned long io; | ||
93 | |||
94 | /* modify sys_pinfunc for AC97 on PSC1 */ | ||
95 | io = au_readl(SYS_PINFUNC); | ||
96 | io |= SYS_PINFUNC_P1C; | ||
97 | io &= ~(SYS_PINFUNC_P1A | SYS_PINFUNC_P1B); | ||
98 | au_writel(io, SYS_PINFUNC); | ||
99 | au_sync(); | ||
100 | #endif | ||
101 | |||
102 | ret = -ENOMEM; | ||
103 | |||
104 | /* setup PSC clock source for AC97 part: external clock provided | ||
105 | * by codec. The psc-ac97.c driver depends on this setting! | ||
106 | */ | ||
107 | au_writel(PSC_SEL_CLK_SERCLK, PSC1_BASE_ADDR + PSC_SEL_OFFSET); | ||
108 | au_sync(); | ||
109 | |||
110 | au1xpsc_sample_ac97_dev = platform_device_alloc("soc-audio", -1); | ||
111 | if (!au1xpsc_sample_ac97_dev) | ||
112 | goto out; | ||
113 | |||
114 | au1xpsc_sample_ac97_dev->resource = | ||
115 | kmemdup(au1xpsc_psc1_res, sizeof(struct resource) * | ||
116 | ARRAY_SIZE(au1xpsc_psc1_res), GFP_KERNEL); | ||
117 | au1xpsc_sample_ac97_dev->num_resources = ARRAY_SIZE(au1xpsc_psc1_res); | ||
118 | au1xpsc_sample_ac97_dev->id = 1; | ||
119 | |||
120 | platform_set_drvdata(au1xpsc_sample_ac97_dev, | ||
121 | &au1xpsc_sample_ac97_devdata); | ||
122 | au1xpsc_sample_ac97_devdata.dev = &au1xpsc_sample_ac97_dev->dev; | ||
123 | ret = platform_device_add(au1xpsc_sample_ac97_dev); | ||
124 | |||
125 | if (ret) { | ||
126 | platform_device_put(au1xpsc_sample_ac97_dev); | ||
127 | au1xpsc_sample_ac97_dev = NULL; | ||
128 | } | ||
129 | |||
130 | out: | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | static void __exit au1xpsc_sample_ac97_exit(void) | ||
135 | { | ||
136 | platform_device_unregister(au1xpsc_sample_ac97_dev); | ||
137 | } | ||
138 | |||
139 | module_init(au1xpsc_sample_ac97_load); | ||
140 | module_exit(au1xpsc_sample_ac97_exit); | ||
141 | |||
142 | MODULE_LICENSE("GPL"); | ||
143 | MODULE_DESCRIPTION("Au1xxx PSC sample AC97 machine"); | ||
144 | MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>"); | ||
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index a9dc5fb54774..da589d8664d0 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c | |||
@@ -627,7 +627,7 @@ static int tlv320aic23_resume(struct platform_device *pdev) | |||
627 | u16 reg; | 627 | u16 reg; |
628 | 628 | ||
629 | /* Sync reg_cache with the hardware */ | 629 | /* Sync reg_cache with the hardware */ |
630 | for (reg = 0; reg < TLV320AIC23_RESET; reg++) { | 630 | for (reg = 0; reg <= TLV320AIC23_ACTIVE; reg++) { |
631 | u16 val = tlv320aic23_read_reg_cache(codec, reg); | 631 | u16 val = tlv320aic23_read_reg_cache(codec, reg); |
632 | tlv320aic23_write(codec, reg, val); | 632 | tlv320aic23_write(codec, reg, val); |
633 | } | 633 | } |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index ce5515e3f2b0..3595bd57c4eb 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -1504,7 +1504,7 @@ static int wm8903_resume(struct platform_device *pdev) | |||
1504 | struct i2c_client *i2c = codec->control_data; | 1504 | struct i2c_client *i2c = codec->control_data; |
1505 | int i; | 1505 | int i; |
1506 | u16 *reg_cache = codec->reg_cache; | 1506 | u16 *reg_cache = codec->reg_cache; |
1507 | u16 *tmp_cache = kmemdup(codec->reg_cache, sizeof(wm8903_reg_defaults), | 1507 | u16 *tmp_cache = kmemdup(reg_cache, sizeof(wm8903_reg_defaults), |
1508 | GFP_KERNEL); | 1508 | GFP_KERNEL); |
1509 | 1509 | ||
1510 | /* Bring the codec back up to standby first to minimise pop/clicks */ | 1510 | /* Bring the codec back up to standby first to minimise pop/clicks */ |
@@ -1516,6 +1516,7 @@ static int wm8903_resume(struct platform_device *pdev) | |||
1516 | for (i = 2; i < ARRAY_SIZE(wm8903_reg_defaults); i++) | 1516 | for (i = 2; i < ARRAY_SIZE(wm8903_reg_defaults); i++) |
1517 | if (tmp_cache[i] != reg_cache[i]) | 1517 | if (tmp_cache[i] != reg_cache[i]) |
1518 | snd_soc_write(codec, i, tmp_cache[i]); | 1518 | snd_soc_write(codec, i, tmp_cache[i]); |
1519 | kfree(tmp_cache); | ||
1519 | } else { | 1520 | } else { |
1520 | dev_err(&i2c->dev, "Failed to allocate temporary cache\n"); | 1521 | dev_err(&i2c->dev, "Failed to allocate temporary cache\n"); |
1521 | } | 1522 | } |
diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c index 3326e2a1e863..1a5b8e0d6a34 100644 --- a/sound/soc/fsl/efika-audio-fabric.c +++ b/sound/soc/fsl/efika-audio-fabric.c | |||
@@ -55,7 +55,7 @@ static __init int efika_fabric_init(void) | |||
55 | struct platform_device *pdev; | 55 | struct platform_device *pdev; |
56 | int rc; | 56 | int rc; |
57 | 57 | ||
58 | if (!machine_is_compatible("bplan,efika")) | 58 | if (!of_machine_is_compatible("bplan,efika")) |
59 | return -ENODEV; | 59 | return -ENODEV; |
60 | 60 | ||
61 | card.platform = &mpc5200_audio_dma_platform; | 61 | card.platform = &mpc5200_audio_dma_platform; |
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index b928ef7d28eb..6644cba7cbf2 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c | |||
@@ -55,7 +55,7 @@ static __init int pcm030_fabric_init(void) | |||
55 | struct platform_device *pdev; | 55 | struct platform_device *pdev; |
56 | int rc; | 56 | int rc; |
57 | 57 | ||
58 | if (!machine_is_compatible("phytec,pcm030")) | 58 | if (!of_machine_is_compatible("phytec,pcm030")) |
59 | return -ENODEV; | 59 | return -ENODEV; |
60 | 60 | ||
61 | card.platform = &mpc5200_audio_dma_platform; | 61 | card.platform = &mpc5200_audio_dma_platform; |
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile index 3db8a6c523f4..19283e5edfbf 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile | |||
@@ -25,7 +25,7 @@ obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o | |||
25 | obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o | 25 | obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o |
26 | obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o | 26 | obj-$(CONFIG_SND_OMAP_SOC_OMAP2EVM) += snd-soc-omap2evm.o |
27 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o | 27 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3EVM) += snd-soc-omap3evm.o |
28 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3517EVM) += snd-soc-am3517evm.o | 28 | obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o |
29 | obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o | 29 | obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o |
30 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o | 30 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o |
31 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o | 31 | obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o |
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index 71b2c161158d..68980c19a3bc 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c | |||
@@ -145,6 +145,7 @@ static const struct snd_soc_dapm_widget omap3pandora_in_dapm_widgets[] = { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | static const struct snd_soc_dapm_route omap3pandora_out_map[] = { | 147 | static const struct snd_soc_dapm_route omap3pandora_out_map[] = { |
148 | {"PCM DAC", NULL, "APLL Enable"}, | ||
148 | {"Headphone Amplifier", NULL, "PCM DAC"}, | 149 | {"Headphone Amplifier", NULL, "PCM DAC"}, |
149 | {"Line Out", NULL, "PCM DAC"}, | 150 | {"Line Out", NULL, "PCM DAC"}, |
150 | {"Headphone Jack", NULL, "Headphone Amplifier"}, | 151 | {"Headphone Jack", NULL, "Headphone Amplifier"}, |
diff --git a/sound/sound_core.c b/sound/sound_core.c index dbca7c909a31..7c2d677a2df5 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -61,7 +61,7 @@ static void __exit cleanup_soundcore(void) | |||
61 | class_destroy(sound_class); | 61 | class_destroy(sound_class); |
62 | } | 62 | } |
63 | 63 | ||
64 | module_init(init_soundcore); | 64 | subsys_initcall(init_soundcore); |
65 | module_exit(cleanup_soundcore); | 65 | module_exit(cleanup_soundcore); |
66 | 66 | ||
67 | 67 | ||