diff options
author | Jaroslav Kysela <perex@suse.cz> | 2004-11-29 12:47:59 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2004-11-29 12:47:59 +0100 |
commit | aceda15df4b94da622a0e362daf5d8b3d97026bb (patch) | |
tree | ce3711a18405bac3cd97894ba7fa81e0b1b6a966 /sound | |
parent | 771b767ca024ef0fe1d2735931cfe66d38cc9c06 (diff) | |
parent | ceaa57fe291f4cbf94009e99e5ce65b70ff6ea9b (diff) | |
download | history-aceda15df4b94da622a0e362daf5d8b3d97026bb.tar.gz |
Merge suse.cz:/home/perex/bk/linux-sound/linux-2.5
into suse.cz:/home/perex/bk/linux-sound/linux-sound
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/ad1889.c | 45 | ||||
-rw-r--r-- | sound/oss/ad1889.h | 2 | ||||
-rw-r--r-- | sound/oss/btaudio.c | 2 | ||||
-rw-r--r-- | sound/oss/cs4281/cs4281m.c | 3 | ||||
-rw-r--r-- | sound/oss/cs46xx.c | 14 | ||||
-rw-r--r-- | sound/oss/dmabuf.c | 2 | ||||
-rw-r--r-- | sound/oss/dmasound/dmasound_awacs.c | 34 | ||||
-rw-r--r-- | sound/oss/es1371.c | 4 | ||||
-rw-r--r-- | sound/oss/i810_audio.c | 4 | ||||
-rw-r--r-- | sound/oss/kahlua.c | 2 | ||||
-rw-r--r-- | sound/oss/msnd.c | 78 | ||||
-rw-r--r-- | sound/oss/msnd.h | 14 | ||||
-rw-r--r-- | sound/oss/msnd_pinnacle.c | 168 | ||||
-rw-r--r-- | sound/oss/nm256.h | 10 | ||||
-rw-r--r-- | sound/oss/nm256_audio.c | 2 | ||||
-rw-r--r-- | sound/oss/rme96xx.c | 2 | ||||
-rw-r--r-- | sound/oss/soundcard.c | 2 | ||||
-rw-r--r-- | sound/oss/ymfpci.h | 2 | ||||
-rw-r--r-- | sound/pci/cmipci.c | 7 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.c | 4 | ||||
-rw-r--r-- | sound/ppc/daca.c | 24 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 27 | ||||
-rw-r--r-- | sound/ppc/pmac.h | 12 | ||||
-rw-r--r-- | sound/ppc/tumbler.c | 41 | ||||
-rw-r--r-- | sound/sparc/cs4231.c | 4 |
25 files changed, 296 insertions, 213 deletions
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c index 25477365397d6f..607a07a5930fb0 100644 --- a/sound/oss/ad1889.c +++ b/sound/oss/ad1889.c @@ -1011,36 +1011,45 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic if (!(pci_resource_flags(pcidev, 0) & IORESOURCE_MEM)) { printk(KERN_ERR DEVNAME ": memory region not assigned\n"); - goto err_free_mem; + goto out1; + } + + if (pci_request_region(pcidev, 0, DEVNAME)) { + printk(KERN_ERR DEVNAME ": unable to request memory region\n"); + goto out1; + } + + dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE); + if (!dev->regbase) { + printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); + goto out2; } if (request_irq(pcidev->irq, ad1889_interrupt, SA_SHIRQ, DEVNAME, dev) != 0) { printk(KERN_ERR DEVNAME ": unable to request interrupt\n"); - goto err_free_mem; + goto out3; } - request_mem_region(bar, AD_DSIOMEMSIZE, DEVNAME); - dev->regbase = (unsigned long)ioremap_nocache(bar, AD_DSIOMEMSIZE); - - printk(KERN_INFO DEVNAME ": %s at 0x%lx IRQ %d\n", + printk(KERN_INFO DEVNAME ": %s at %p IRQ %d\n", (char *)ent->driver_data, dev->regbase, pcidev->irq); if (ad1889_aclink_reset(pcidev) != 0) - goto err_free_mem; + goto out4; /* register /dev/dsp */ if ((dev->dev_audio = register_sound_dsp(&ad1889_fops, -1)) < 0) { printk(KERN_ERR DEVNAME ": cannot register /dev/dsp\n"); - goto err_free_irq; + goto out4; } if ((err = ad1889_ac97_init(dev, 0)) != 0) - goto err_free_dsp; + goto out5; + /* XXX: cleanups */ if (((proc_root = proc_mkdir("driver/ad1889", NULL)) == NULL) || create_proc_read_entry("ac97", S_IFREG|S_IRUGO, proc_root, ac97_read_proc, dev->ac97_codec) == NULL || create_proc_read_entry("info", S_IFREG|S_IRUGO, proc_root, ad1889_read_proc, dev) == NULL) - goto err_free_dsp; + goto out5; ad1889_initcfg(dev); @@ -1050,13 +1059,15 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic return 0; -err_free_dsp: +out5: unregister_sound_dsp(dev->dev_audio); - -err_free_irq: +out4: free_irq(pcidev->irq, dev); - -err_free_mem: +out3: + iounmap(dev->regbase); +out2: + pci_release_region(pcidev, 0); +out1: ad1889_free_dev(dev); pci_set_drvdata(pcidev, NULL); @@ -1072,10 +1083,12 @@ static void __devexit ad1889_remove(struct pci_dev *pcidev) unregister_sound_mixer(dev->ac97_codec->dev_mixer); unregister_sound_dsp(dev->dev_audio); free_irq(pcidev->irq, dev); - release_mem_region(dev->regbase, AD_DSIOMEMSIZE); + iounmap(dev->regbase); + pci_release_region(pcidev, 0); /* any hw programming needed? */ ad1889_free_dev(dev); + pci_set_drvdata(pcidev, NULL); } MODULE_AUTHOR("Randolph Chung"); diff --git a/sound/oss/ad1889.h b/sound/oss/ad1889.h index 964a6b4d5716aa..e04affce1dd15c 100644 --- a/sound/oss/ad1889.h +++ b/sound/oss/ad1889.h @@ -104,7 +104,7 @@ typedef struct ad1889_state { } ad1889_state_t; typedef struct ad1889_dev { - unsigned long regbase; + void __iomem *regbase; struct pci_dev *pci; spinlock_t lock; diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c index 0d76e7889202d2..67f8652d018fc7 100644 --- a/sound/oss/btaudio.c +++ b/sound/oss/btaudio.c @@ -104,7 +104,7 @@ struct btaudio { struct pci_dev *pci; unsigned int irq; unsigned long mem; - unsigned long *mmio; + unsigned long __iomem *mmio; /* locking */ int users; diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c index dca843bba94b65..947e5f9ee15cd2 100644 --- a/sound/oss/cs4281/cs4281m.c +++ b/sound/oss/cs4281/cs4281m.c @@ -221,7 +221,8 @@ struct cs4281_state { // hardware resources unsigned int pBA0phys, pBA1phys; - char *pBA0, *pBA1; + char __iomem *pBA0; + char __iomem *pBA1; unsigned int irq; // mixer registers diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 0d8f799bf73ccf..a4141e3c02b01c 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -346,17 +346,17 @@ struct cs_card { u32 irq; /* mappings */ - void *ba0; + void __iomem *ba0; union { struct { - u8 *data0; - u8 *data1; - u8 *pmem; - u8 *reg; + u8 __iomem *data0; + u8 __iomem *data1; + u8 __iomem *pmem; + u8 __iomem *reg; } name; - u8 *idx[4]; + u8 __iomem *idx[4]; } ba1; /* Function support */ @@ -4309,7 +4309,7 @@ static int __init cs_ac97_init(struct cs_card *card) static void cs461x_download_image(struct cs_card *card) { unsigned i, j, temp1, temp2, offset, count; - unsigned char *pBA1 = ioremap(card->ba1_addr, 0x40000); + unsigned char __iomem *pBA1 = ioremap(card->ba1_addr, 0x40000); for( i=0; i < CLEAR__COUNT; i++) { offset = ClrStat[i].BA1__DestByteOffset; diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c index c601ea25ec48cc..baf4244a54f2f9 100644 --- a/sound/oss/dmabuf.c +++ b/sound/oss/dmabuf.c @@ -88,7 +88,7 @@ static int sound_alloc_dmap(struct dma_buffparms *dmap) while (start_addr == NULL && dmap->buffsize > PAGE_SIZE) { for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1); dmap->buffsize = PAGE_SIZE * (1 << sz); - start_addr = (char *) __get_free_pages(GFP_ATOMIC|GFP_DMA, sz); + start_addr = (char *) __get_free_pages(GFP_ATOMIC|GFP_DMA|__GFP_NOWARN, sz); if (start_addr == NULL) dmap->buffsize /= 2; } diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index a76352597c2a91..89f52a7d466a1d 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -118,9 +118,9 @@ * Interrupt numbers and addresses, & info obtained from the device tree. */ static int awacs_irq, awacs_tx_irq, awacs_rx_irq; -static volatile struct awacs_regs *awacs; -static volatile u32 *i2s; -static volatile struct dbdma_regs *awacs_txdma, *awacs_rxdma; +static volatile struct awacs_regs __iomem *awacs; +static volatile u32 __iomem *i2s; +static volatile struct dbdma_regs __iomem *awacs_txdma, *awacs_rxdma; static int awacs_rate_index; static int awacs_subframe; static struct device_node* awacs_node; @@ -146,8 +146,8 @@ static int has_ziva; /* for earlier powerbooks which need fiddling with mac-io to enable * cd etc. */ -static unsigned char *latch_base; -static unsigned char *macio_base; +static unsigned char __iomem *latch_base; +static unsigned char __iomem *macio_base; /* * Space for the DBDMA command blocks. @@ -661,11 +661,11 @@ static void PMacIrqCleanup(void) free_irq(awacs_rx_irq, NULL); if (awacs) - iounmap((void *)awacs); + iounmap(awacs); if (i2s) - iounmap((void *)i2s); - iounmap((void *)awacs_txdma); - iounmap((void *)awacs_rxdma); + iounmap(i2s); + iounmap(awacs_txdma); + iounmap(awacs_rxdma); release_OF_resource(awacs_node, 0); release_OF_resource(awacs_node, 1); @@ -2915,14 +2915,11 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n"); /* all OF versions I've seen use this value */ if (i2s_node) - i2s = (u32 *)ioremap(io->addrs[0].address, 0x1000); + i2s = ioremap(io->addrs[0].address, 0x1000); else - awacs = (volatile struct awacs_regs *) - ioremap(io->addrs[0].address, 0x1000); - awacs_txdma = (volatile struct dbdma_regs *) - ioremap(io->addrs[1].address, 0x100); - awacs_rxdma = (volatile struct dbdma_regs *) - ioremap(io->addrs[2].address, 0x100); + awacs = ioremap(io->addrs[0].address, 0x1000); + awacs_txdma = ioremap(io->addrs[1].address, 0x100); + awacs_rxdma = ioremap(io->addrs[2].address, 0x100); /* first of all make sure that the chip is powered up....*/ pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, io, 0, 1); @@ -3075,7 +3072,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); * sound input. The 0x100 enables the SCSI bus * terminator power. */ - latch_base = (unsigned char *) ioremap (0xf301a000, 0x1000); + latch_base = ioremap (0xf301a000, 0x1000); in_8(latch_base + 0x190); } else if (is_pbook_g3) { @@ -3084,8 +3081,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); for (mio = io->parent; mio; mio = mio->parent) { if (strcmp(mio->name, "mac-io") == 0 && mio->n_addrs > 0) { - macio_base = (unsigned char *) ioremap - (mio->addrs[0].address, 0x40); + macio_base = ioremap(mio->addrs[0].address, 0x40); break; } } diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index ab40e1d876ea82..b6d943e7b0b89e 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -637,7 +637,7 @@ static void set_dac2_rate(struct es1371_state *s, unsigned rate) /* --------------------------------------------------------------------- */ -static void __init src_init(struct es1371_state *s) +static void __devinit src_init(struct es1371_state *s) { unsigned int i; @@ -2758,7 +2758,7 @@ MODULE_LICENSE("GPL"); static struct initvol { int mixch; int vol; -} initvol[] __initdata = { +} initvol[] __devinitdata = { { SOUND_MIXER_WRITE_LINE, 0x4040 }, { SOUND_MIXER_WRITE_CD, 0x4040 }, { MIXER_WRITE(SOUND_MIXER_VIDEO), 0x4040 }, diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index f49a80b8b337a4..07f575d9053dac 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c @@ -429,8 +429,8 @@ struct i810_card { unsigned long ac97base_mmio_phys; unsigned long iobase_mmio_phys; - u_int8_t *ac97base_mmio; - u_int8_t *iobase_mmio; + u_int8_t __iomem *ac97base_mmio; + u_int8_t __iomem *iobase_mmio; int use_mmio; diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c index 3d1d6368043b37..808c5ef969be02 100644 --- a/sound/oss/kahlua.c +++ b/sound/oss/kahlua.c @@ -56,7 +56,7 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id { struct address_info *hw_config; unsigned long base; - void *mem; + void __iomem *mem; unsigned long io; u16 map; u8 irq, dma8, dma16; diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c index 320ee6b743e51a..4f1ff1bccdcee0 100644 --- a/sound/oss/msnd.c +++ b/sound/oss/msnd.c @@ -81,12 +81,12 @@ void msnd_unregister(multisound_dev_t *dev) --num_devs; } -void msnd_init_queue(unsigned long base, int start, int size) +void msnd_init_queue(void __iomem *base, int start, int size) { - isa_writew(PCTODSP_BASED(start), base + JQS_wStart); - isa_writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize); - isa_writew(0, base + JQS_wHead); - isa_writew(0, base + JQS_wTail); + writew(PCTODSP_BASED(start), base + JQS_wStart); + writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize); + writew(0, base + JQS_wHead); + writew(0, base + JQS_wTail); } void msnd_fifo_init(msnd_fifo *f) @@ -122,6 +122,37 @@ void msnd_fifo_make_empty(msnd_fifo *f) f->len = f->tail = f->head = 0; } +int msnd_fifo_write_io(msnd_fifo *f, char __iomem *buf, size_t len) +{ + int count = 0; + + while ((count < len) && (f->len != f->n)) { + + int nwritten; + + if (f->head <= f->tail) { + nwritten = len - count; + if (nwritten > f->n - f->tail) + nwritten = f->n - f->tail; + } + else { + nwritten = f->head - f->tail; + if (nwritten > len - count) + nwritten = len - count; + } + + memcpy_fromio(f->data + f->tail, buf, nwritten); + + count += nwritten; + buf += nwritten; + f->len += nwritten; + f->tail += nwritten; + f->tail %= f->n; + } + + return count; +} + int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len) { int count = 0; @@ -141,7 +172,7 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len) nwritten = len - count; } - isa_memcpy_fromio(f->data + f->tail, (unsigned long) buf, nwritten); + memcpy(f->data + f->tail, buf, nwritten); count += nwritten; buf += nwritten; @@ -153,6 +184,37 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len) return count; } +int msnd_fifo_read_io(msnd_fifo *f, char __iomem *buf, size_t len) +{ + int count = 0; + + while ((count < len) && (f->len > 0)) { + + int nread; + + if (f->tail <= f->head) { + nread = len - count; + if (nread > f->n - f->head) + nread = f->n - f->head; + } + else { + nread = f->tail - f->head; + if (nread > len - count) + nread = len - count; + } + + memcpy_toio(buf, f->data + f->head, nread); + + count += nread; + buf += nread; + f->len -= nread; + f->head += nread; + f->head %= f->n; + } + + return count; +} + int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len) { int count = 0; @@ -172,7 +234,7 @@ int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len) nread = len - count; } - isa_memcpy_toio((unsigned long) buf, f->data + f->head, nread); + memcpy(buf, f->data + f->head, nread); count += nread; buf += nread; @@ -327,6 +389,8 @@ EXPORT_SYMBOL(msnd_fifo_init); EXPORT_SYMBOL(msnd_fifo_free); EXPORT_SYMBOL(msnd_fifo_alloc); EXPORT_SYMBOL(msnd_fifo_make_empty); +EXPORT_SYMBOL(msnd_fifo_write_io); +EXPORT_SYMBOL(msnd_fifo_read_io); EXPORT_SYMBOL(msnd_fifo_write); EXPORT_SYMBOL(msnd_fifo_read); diff --git a/sound/oss/msnd.h b/sound/oss/msnd.h index 0febcb5419f154..05cf7865be5e60 100644 --- a/sound/oss/msnd.h +++ b/sound/oss/msnd.h @@ -183,7 +183,7 @@ typedef u8 BYTE; typedef u16 USHORT; typedef u16 WORD; typedef u32 DWORD; -typedef unsigned long LPDAQD; +typedef void __iomem * LPDAQD; /* Generic FIFO */ typedef struct { @@ -203,12 +203,12 @@ typedef struct multisound_dev { int memid, irqid; int irq, irq_ref; unsigned char info; - unsigned long base; + void __iomem *base; /* Motorola 56k DSP SMA */ - unsigned long SMA; - unsigned long DAPQ, DARQ, MODQ, MIDQ, DSPQ; - unsigned long pwDSPQData, pwMIDQData, pwMODQData; + void __iomem *SMA; + void __iomem *DAPQ, *DARQ, *MODQ, *MIDQ, *DSPQ; + void __iomem *pwDSPQData, *pwMIDQData, *pwMODQData; int dspq_data_buff, dspq_buff_size; /* State variables */ @@ -259,12 +259,14 @@ typedef struct multisound_dev { int msnd_register(multisound_dev_t *dev); void msnd_unregister(multisound_dev_t *dev); -void msnd_init_queue(unsigned long, int start, int size); +void msnd_init_queue(void __iomem *, int start, int size); void msnd_fifo_init(msnd_fifo *f); void msnd_fifo_free(msnd_fifo *f); int msnd_fifo_alloc(msnd_fifo *f, size_t n); void msnd_fifo_make_empty(msnd_fifo *f); +int msnd_fifo_write_io(msnd_fifo *f, char __iomem *buf, size_t len); +int msnd_fifo_read_io(msnd_fifo *f, char __iomem *buf, size_t len); int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len); int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len); diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c index 7ebc5d33b90dc1..9f18b40374267c 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c @@ -109,18 +109,18 @@ static void reset_play_queue(void) LPDAQD lpDAQ; dev.last_playbank = -1; - isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wHead); - isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wTail); + writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wHead); + writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DAPQ + JQS_wTail); for (n = 0, lpDAQ = dev.base + DAPQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) { - isa_writew(PCTODSP_BASED((DWORD)(DAP_BUFF_SIZE * n)), lpDAQ + DAQDS_wStart); - isa_writew(0, lpDAQ + DAQDS_wSize); - isa_writew(1, lpDAQ + DAQDS_wFormat); - isa_writew(dev.play_sample_size, lpDAQ + DAQDS_wSampleSize); - isa_writew(dev.play_channels, lpDAQ + DAQDS_wChannels); - isa_writew(dev.play_sample_rate, lpDAQ + DAQDS_wSampleRate); - isa_writew(HIMT_PLAY_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg); - isa_writew(n, lpDAQ + DAQDS_wFlags); + writew(PCTODSP_BASED((DWORD)(DAP_BUFF_SIZE * n)), lpDAQ + DAQDS_wStart); + writew(0, lpDAQ + DAQDS_wSize); + writew(1, lpDAQ + DAQDS_wFormat); + writew(dev.play_sample_size, lpDAQ + DAQDS_wSampleSize); + writew(dev.play_channels, lpDAQ + DAQDS_wChannels); + writew(dev.play_sample_rate, lpDAQ + DAQDS_wSampleRate); + writew(HIMT_PLAY_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg); + writew(n, lpDAQ + DAQDS_wFlags); } } @@ -131,25 +131,25 @@ static void reset_record_queue(void) unsigned long flags; dev.last_recbank = 2; - isa_writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DARQ + JQS_wHead); - isa_writew(PCTODSP_OFFSET(dev.last_recbank * DAQDS__size), dev.DARQ + JQS_wTail); + writew(PCTODSP_OFFSET(0 * DAQDS__size), dev.DARQ + JQS_wHead); + writew(PCTODSP_OFFSET(dev.last_recbank * DAQDS__size), dev.DARQ + JQS_wTail); /* Critical section: bank 1 access */ spin_lock_irqsave(&dev.lock, flags); msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS); - isa_memset_io(dev.base, 0, DAR_BUFF_SIZE * 3); + memset_io(dev.base, 0, DAR_BUFF_SIZE * 3); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS); spin_unlock_irqrestore(&dev.lock, flags); for (n = 0, lpDAQ = dev.base + DARQ_DATA_BUFF; n < 3; ++n, lpDAQ += DAQDS__size) { - isa_writew(PCTODSP_BASED((DWORD)(DAR_BUFF_SIZE * n)) + 0x4000, lpDAQ + DAQDS_wStart); - isa_writew(DAR_BUFF_SIZE, lpDAQ + DAQDS_wSize); - isa_writew(1, lpDAQ + DAQDS_wFormat); - isa_writew(dev.rec_sample_size, lpDAQ + DAQDS_wSampleSize); - isa_writew(dev.rec_channels, lpDAQ + DAQDS_wChannels); - isa_writew(dev.rec_sample_rate, lpDAQ + DAQDS_wSampleRate); - isa_writew(HIMT_RECORD_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg); - isa_writew(n, lpDAQ + DAQDS_wFlags); + writew(PCTODSP_BASED((DWORD)(DAR_BUFF_SIZE * n)) + 0x4000, lpDAQ + DAQDS_wStart); + writew(DAR_BUFF_SIZE, lpDAQ + DAQDS_wSize); + writew(1, lpDAQ + DAQDS_wFormat); + writew(dev.rec_sample_size, lpDAQ + DAQDS_wSampleSize); + writew(dev.rec_channels, lpDAQ + DAQDS_wChannels); + writew(dev.rec_sample_rate, lpDAQ + DAQDS_wSampleRate); + writew(HIMT_RECORD_DONE * 0x100 + n, lpDAQ + DAQDS_wIntMsg); + writew(n, lpDAQ + DAQDS_wFlags); } } @@ -185,9 +185,9 @@ static int dsp_set_format(struct file *file, int val) for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) { if (file->f_mode & FMODE_WRITE) - isa_writew(data, lpDAQ + DAQDS_wSampleSize); + writew(data, lpDAQ + DAQDS_wSampleSize); if (file->f_mode & FMODE_READ) - isa_writew(data, lpDARQ + DAQDS_wSampleSize); + writew(data, lpDARQ + DAQDS_wSampleSize); } if (file->f_mode & FMODE_WRITE) dev.play_sample_size = data; @@ -318,9 +318,9 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) { if (file->f_mode & FMODE_WRITE) - isa_writew(data, lpDAQ + DAQDS_wSampleRate); + writew(data, lpDAQ + DAQDS_wSampleRate); if (file->f_mode & FMODE_READ) - isa_writew(data, lpDARQ + DAQDS_wSampleRate); + writew(data, lpDARQ + DAQDS_wSampleRate); } if (file->f_mode & FMODE_WRITE) dev.play_sample_rate = data; @@ -361,9 +361,9 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) { if (file->f_mode & FMODE_WRITE) - isa_writew(data, lpDAQ + DAQDS_wChannels); + writew(data, lpDAQ + DAQDS_wChannels); if (file->f_mode & FMODE_READ) - isa_writew(data, lpDARQ + DAQDS_wChannels); + writew(data, lpDARQ + DAQDS_wChannels); } if (file->f_mode & FMODE_WRITE) dev.play_channels = data; @@ -401,27 +401,27 @@ static int mixer_get(int d) } #define update_volm(a,b) \ - isa_writew((dev.left_levels[a] >> 1) * \ - isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \ + writew((dev.left_levels[a] >> 1) * \ + readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \ dev.SMA + SMA_##b##Left); \ - isa_writew((dev.right_levels[a] >> 1) * \ - isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \ + writew((dev.right_levels[a] >> 1) * \ + readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \ dev.SMA + SMA_##b##Right); #define update_potm(d,s,ar) \ - isa_writeb((dev.left_levels[d] >> 8) * \ - isa_readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \ + writeb((dev.left_levels[d] >> 8) * \ + readw(dev.SMA + SMA_wCurrMastVolLeft) / 0xffff, \ dev.SMA + SMA_##s##Left); \ - isa_writeb((dev.right_levels[d] >> 8) * \ - isa_readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \ + writeb((dev.right_levels[d] >> 8) * \ + readw(dev.SMA + SMA_wCurrMastVolRight) / 0xffff, \ dev.SMA + SMA_##s##Right); \ if (msnd_send_word(&dev, 0, 0, ar) == 0) \ chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); #define update_pot(d,s,ar) \ - isa_writeb(dev.left_levels[d] >> 8, \ + writeb(dev.left_levels[d] >> 8, \ dev.SMA + SMA_##s##Left); \ - isa_writeb(dev.right_levels[d] >> 8, \ + writeb(dev.right_levels[d] >> 8, \ dev.SMA + SMA_##s##Right); \ if (msnd_send_word(&dev, 0, 0, ar) == 0) \ chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); @@ -450,23 +450,23 @@ static int mixer_set(int d, int value) /* master volume unscaled controls */ case SOUND_MIXER_LINE: /* line pot control */ /* scaled by IMIX in digital mix */ - isa_writeb(bLeft, dev.SMA + SMA_bInPotPosLeft); - isa_writeb(bRight, dev.SMA + SMA_bInPotPosRight); + writeb(bLeft, dev.SMA + SMA_bInPotPosLeft); + writeb(bRight, dev.SMA + SMA_bInPotPosRight); if (msnd_send_word(&dev, 0, 0, HDEXAR_IN_SET_POTS) == 0) chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); break; #ifndef MSND_CLASSIC case SOUND_MIXER_MIC: /* mic pot control */ /* scaled by IMIX in digital mix */ - isa_writeb(bLeft, dev.SMA + SMA_bMicPotPosLeft); - isa_writeb(bRight, dev.SMA + SMA_bMicPotPosRight); + writeb(bLeft, dev.SMA + SMA_bMicPotPosLeft); + writeb(bRight, dev.SMA + SMA_bMicPotPosRight); if (msnd_send_word(&dev, 0, 0, HDEXAR_MIC_SET_POTS) == 0) chk_send_dsp_cmd(&dev, HDEX_AUX_REQ); break; #endif case SOUND_MIXER_VOLUME: /* master volume */ - isa_writew(wLeft, dev.SMA + SMA_wCurrMastVolLeft); - isa_writew(wRight, dev.SMA + SMA_wCurrMastVolRight); + writew(wLeft, dev.SMA + SMA_wCurrMastVolLeft); + writew(wRight, dev.SMA + SMA_wCurrMastVolRight); /* fall through */ case SOUND_MIXER_LINE1: /* aux pot control */ @@ -815,25 +815,25 @@ static __inline__ int pack_DARQ_to_DARF(register int bank) LPDAQD DAQD; /* Increment the tail and check for queue wrap */ - wTmp = isa_readw(dev.DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size); - if (wTmp > isa_readw(dev.DARQ + JQS_wSize)) + wTmp = readw(dev.DARQ + JQS_wTail) + PCTODSP_OFFSET(DAQDS__size); + if (wTmp > readw(dev.DARQ + JQS_wSize)) wTmp = 0; - while (wTmp == isa_readw(dev.DARQ + JQS_wHead) && timeout--) + while (wTmp == readw(dev.DARQ + JQS_wHead) && timeout--) udelay(1); - isa_writew(wTmp, dev.DARQ + JQS_wTail); + writew(wTmp, dev.DARQ + JQS_wTail); /* Get our digital audio queue struct */ DAQD = bank * DAQDS__size + dev.base + DARQ_DATA_BUFF; /* Get length of data */ - size = isa_readw(DAQD + DAQDS_wSize); + size = readw(DAQD + DAQDS_wSize); /* Read data from the head (unprotected bank 1 access okay since this is only called inside an interrupt) */ msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS); - msnd_fifo_write( + msnd_fifo_write_io( &dev.DARF, - (char *)(dev.base + bank * DAR_BUFF_SIZE), + dev.base + bank * DAR_BUFF_SIZE, size); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS); @@ -846,8 +846,8 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start) register int protect = start, nbanks = 0; LPDAQD DAQD; - DAPQ_tail = isa_readw(dev.DAPQ + JQS_wTail); - while (DAPQ_tail != isa_readw(dev.DAPQ + JQS_wHead) || start) { + DAPQ_tail = readw(dev.DAPQ + JQS_wTail); + while (DAPQ_tail != readw(dev.DAPQ + JQS_wHead) || start) { register int bank_num = DAPQ_tail / PCTODSP_OFFSET(DAQDS__size); register int n; unsigned long flags; @@ -856,15 +856,15 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start) if (protect) { /* Critical section: protect fifo in non-interrupt */ spin_lock_irqsave(&dev.lock, flags); - n = msnd_fifo_read( + n = msnd_fifo_read_io( &dev.DAPF, - (char *)(dev.base + bank_num * DAP_BUFF_SIZE), + dev.base + bank_num * DAP_BUFF_SIZE, DAP_BUFF_SIZE); spin_unlock_irqrestore(&dev.lock, flags); } else { - n = msnd_fifo_read( + n = msnd_fifo_read_io( &dev.DAPF, - (char *)(dev.base + bank_num * DAP_BUFF_SIZE), + dev.base + bank_num * DAP_BUFF_SIZE, DAP_BUFF_SIZE); } if (!n) @@ -877,12 +877,12 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start) DAQD = bank_num * DAQDS__size + dev.base + DAPQ_DATA_BUFF; /* Write size of this bank */ - isa_writew(n, DAQD + DAQDS_wSize); + writew(n, DAQD + DAQDS_wSize); ++nbanks; /* Then advance the tail */ DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size); - isa_writew(DAPQ_tail, dev.DAPQ + JQS_wTail); + writew(DAPQ_tail, dev.DAPQ + JQS_wTail); /* Tell the DSP to play the bank */ msnd_send_dsp_cmd(&dev, HDEX_PLAY_START); } @@ -1094,15 +1094,15 @@ static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *regs) msnd_inb(dev.io + HP_RXL); /* Evaluate queued DSP messages */ - while (isa_readw(dev.DSPQ + JQS_wTail) != isa_readw(dev.DSPQ + JQS_wHead)) { + while (readw(dev.DSPQ + JQS_wTail) != readw(dev.DSPQ + JQS_wHead)) { register WORD wTmp; - eval_dsp_msg(isa_readw(dev.pwDSPQData + 2*isa_readw(dev.DSPQ + JQS_wHead))); + eval_dsp_msg(readw(dev.pwDSPQData + 2*readw(dev.DSPQ + JQS_wHead))); - if ((wTmp = isa_readw(dev.DSPQ + JQS_wHead) + 1) > isa_readw(dev.DSPQ + JQS_wSize)) - isa_writew(0, dev.DSPQ + JQS_wHead); + if ((wTmp = readw(dev.DSPQ + JQS_wHead) + 1) > readw(dev.DSPQ + JQS_wSize)) + writew(0, dev.DSPQ + JQS_wHead); else - isa_writew(wTmp, dev.DSPQ + JQS_wHead); + writew(wTmp, dev.DSPQ + JQS_wHead); } return IRQ_HANDLED; } @@ -1182,7 +1182,7 @@ static int __init probe_multisound(void) } printk(KERN_INFO LOGNAME ": %s revision %s, Xilinx version %s, " #endif /* MSND_CLASSIC */ - "I/O 0x%x-0x%x, IRQ %d, memory mapped to 0x%lX-0x%lX\n", + "I/O 0x%x-0x%x, IRQ %d, memory mapped to %p-%p\n", dev.name, #ifndef MSND_CLASSIC rev, xv, @@ -1206,16 +1206,16 @@ static int init_sma(void) #endif msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS); if (initted) { - mastVolLeft = isa_readw(dev.SMA + SMA_wCurrMastVolLeft); - mastVolRight = isa_readw(dev.SMA + SMA_wCurrMastVolRight); + mastVolLeft = readw(dev.SMA + SMA_wCurrMastVolLeft); + mastVolRight = readw(dev.SMA + SMA_wCurrMastVolRight); } else mastVolLeft = mastVolRight = 0; - isa_memset_io(dev.base, 0, 0x8000); + memset_io(dev.base, 0, 0x8000); /* Critical section: bank 1 access */ spin_lock_irqsave(&dev.lock, flags); msnd_outb(HPBLKSEL_1, dev.io + HP_BLKS); - isa_memset_io(dev.base, 0, 0x8000); + memset_io(dev.base, 0, 0x8000); msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS); spin_unlock_irqrestore(&dev.lock, flags); @@ -1248,19 +1248,19 @@ static int init_sma(void) /* Setup some DSP values */ #ifndef MSND_CLASSIC - isa_writew(1, dev.SMA + SMA_wCurrPlayFormat); - isa_writew(dev.play_sample_size, dev.SMA + SMA_wCurrPlaySampleSize); - isa_writew(dev.play_channels, dev.SMA + SMA_wCurrPlayChannels); - isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCurrPlaySampleRate); + writew(1, dev.SMA + SMA_wCurrPlayFormat); + writew(dev.play_sample_size, dev.SMA + SMA_wCurrPlaySampleSize); + writew(dev.play_channels, dev.SMA + SMA_wCurrPlayChannels); + writew(dev.play_sample_rate, dev.SMA + SMA_wCurrPlaySampleRate); #endif - isa_writew(dev.play_sample_rate, dev.SMA + SMA_wCalFreqAtoD); - isa_writew(mastVolLeft, dev.SMA + SMA_wCurrMastVolLeft); - isa_writew(mastVolRight, dev.SMA + SMA_wCurrMastVolRight); + writew(dev.play_sample_rate, dev.SMA + SMA_wCalFreqAtoD); + writew(mastVolLeft, dev.SMA + SMA_wCurrMastVolLeft); + writew(mastVolRight, dev.SMA + SMA_wCurrMastVolRight); #ifndef MSND_CLASSIC - isa_writel(0x00010000, dev.SMA + SMA_dwCurrPlayPitch); - isa_writel(0x00000001, dev.SMA + SMA_dwCurrPlayRate); + writel(0x00010000, dev.SMA + SMA_dwCurrPlayPitch); + writel(0x00000001, dev.SMA + SMA_dwCurrPlayRate); #endif - isa_writew(0x303, dev.SMA + SMA_wCurrInputTagBits); + writew(0x303, dev.SMA + SMA_wCurrInputTagBits); initted = 1; @@ -1269,12 +1269,12 @@ static int init_sma(void) static int __init calibrate_adc(WORD srate) { - isa_writew(srate, dev.SMA + SMA_wCalFreqAtoD); + writew(srate, dev.SMA + SMA_wCalFreqAtoD); if (dev.calibrate_signal == 0) - isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags) + writew(readw(dev.SMA + SMA_wCurrHostStatusFlags) | 0x0001, dev.SMA + SMA_wCurrHostStatusFlags); else - isa_writew(isa_readw(dev.SMA + SMA_wCurrHostStatusFlags) + writew(readw(dev.SMA + SMA_wCurrHostStatusFlags) & ~0x0001, dev.SMA + SMA_wCurrHostStatusFlags); if (msnd_send_word(&dev, 0, 0, HDEXAR_CAL_A_TO_D) == 0 && chk_send_dsp_cmd(&dev, HDEX_AUX_REQ) == 0) { @@ -1304,7 +1304,7 @@ static int upload_dsp_code(void) return -EBUSY; } #endif - isa_memcpy_toio(dev.base, PERMCODE, PERMCODESIZE); + memcpy_toio(dev.base, PERMCODE, PERMCODESIZE); if (msnd_upload_host(&dev, INITCODE, INITCODESIZE) < 0) { printk(KERN_WARNING LOGNAME ": Error uploading to DSP\n"); return -ENODEV; @@ -1357,7 +1357,7 @@ static int initialize(void) } timeout = 200; - while (isa_readw(dev.base)) { + while (readw(dev.base)) { mdelay(1); if (!timeout--) { printk(KERN_DEBUG LOGNAME ": DSP reset timeout\n"); @@ -1861,7 +1861,7 @@ static int __init msnd_init(void) dev.io = io; dev.numio = DSP_NUMIO; dev.irq = irq; - dev.base = mem; + dev.base = ioremap(mem, 0x8000); dev.fifosize = fifosize * 1024; dev.calibrate_signal = calibrate_signal ? 1 : 0; dev.recsrc = 0; diff --git a/sound/oss/nm256.h b/sound/oss/nm256.h index 583004ef0aa173..eae7d99d682630 100644 --- a/sound/oss/nm256.h +++ b/sound/oss/nm256.h @@ -60,7 +60,7 @@ struct nm256_info /* Physical address of the port. */ u32 physaddr; /* Our mapped-in pointer. */ - char *ptr; + char __iomem *ptr; /* PTR's offset within the physical port. */ u32 start_offset; /* And the offset of the end of the buffer. */ @@ -233,14 +233,14 @@ extern int nm256_debug; static inline int nm256_writePort##X (struct nm256_info *card,\ int port, int offset, int value)\ {\ - u##X *addr;\ + u##X __iomem *addr;\ \ if (nm256_debug > 1)\ printk (KERN_DEBUG "Writing 0x%x to %d:0x%x\n", value, port, offset);\ \ NM_FIX_PORT;\ \ - addr = (u##X *)(card->port[port - 1].ptr + offset);\ + addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\ func (value, addr);\ return 0;\ } @@ -253,11 +253,11 @@ DEFwritePortX (32, writel) static inline u##X nm256_readPort##X (struct nm256_info *card,\ int port, int offset)\ {\ - u##X *addr;\ + u##X __iomem *addr;\ \ NM_FIX_PORT\ \ - addr = (u##X *)(card->port[port - 1].ptr + offset);\ + addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\ return func(addr);\ } diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c index ca763f8e71b773..228ce6a00bc825 100644 --- a/sound/oss/nm256_audio.c +++ b/sound/oss/nm256_audio.c @@ -1011,7 +1011,7 @@ nm256_peek_for_sig (struct nm256_info *card) u32 port1offset = card->port[0].physaddr + card->port[0].end_offset - 0x0400; /* The signature is located 1K below the end of video RAM. */ - char *temp = ioremap_nocache (port1offset, 16); + char __iomem *temp = ioremap_nocache (port1offset, 16); /* Default buffer end is 5120 bytes below the top of RAM. */ u32 default_value = card->port[0].end_offset - 0x1400; u32 sig; diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index 1bb31b4d7c4277..96cc75acffffa2 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -273,7 +273,7 @@ typedef struct _rme96xx_info { /* hardware settings */ int magic; struct pci_dev * pcidev; /* pci_dev structure */ - unsigned long *iobase; + unsigned long __iomem *iobase; unsigned int irq; /* list of rme96xx devices */ diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index 8d6c95fa904775..f25c75ec5761e2 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c @@ -127,7 +127,7 @@ static int get_mixer_levels(void __user * arg) { int n; - if (__get_user(n, (int __user *)(&(((mixer_vol_table *__user )arg)->num)))) + if (__get_user(n, (int __user *)(&(((mixer_vol_table __user *)arg)->num)))) return -EFAULT; if (n < 0 || n >= num_mixer_volumes) return -EINVAL; diff --git a/sound/oss/ymfpci.h b/sound/oss/ymfpci.h index 87a24f066a62df..f810a100c64145 100644 --- a/sound/oss/ymfpci.h +++ b/sound/oss/ymfpci.h @@ -239,7 +239,7 @@ struct ymf_capture { struct ymf_unit { u8 rev; /* PCI revision */ - void *reg_area_virt; + void __iomem *reg_area_virt; void *dma_area_va; dma_addr_t dma_area_ba; unsigned int dma_area_size; diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index f40f9b931c70d3..02864e938555a6 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -2572,6 +2572,10 @@ static int __devinit snd_cmipci_create(snd_card_t *card, struct pci_dev *pci, long iomidi = mpu_port[dev]; long iosynth = fm_port[dev]; int pcm_index, pcm_spdif_index; + static struct pci_device_id intel_82437vx[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX) }, + { }, + }; *rcmipci = NULL; @@ -2647,8 +2651,7 @@ static int __devinit snd_cmipci_create(snd_card_t *card, struct pci_dev *pci, switch (pci->device) { case PCI_DEVICE_ID_CMEDIA_CM8738: case PCI_DEVICE_ID_CMEDIA_CM8738B: - /* PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX */ - if (! pci_find_device(0x8086, 0x7030, NULL)) + if (!pci_dev_present(intel_82437vx)) snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX); break; default: diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 25c68e91d8b145..0f3ab7a96969d4 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -914,7 +914,7 @@ static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, in int i; for (i = 0; i < size; ++i) { - if (debug_tree) printk ("addr %08x, val %08x\n",(int)spdst,task_data[i]); + if (debug_tree) printk ("addr %p, val %08x\n", spdst,task_data[i]); writel(task_data[i],spdst); spdst += sizeof(u32); } @@ -928,7 +928,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest) int i; for (i = 0; i < 0x10; ++i) { - if (debug_scb) printk ("addr %08x, val %08x\n",(int)spdst,scb_data[i]); + if (debug_scb) printk ("addr %p, val %08x\n", spdst,scb_data[i]); writel(scb_data[i],spdst); spdst += sizeof(u32); } diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index 6629b6bde12ef7..f24a91693616f6 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -56,10 +56,11 @@ static int daca_init_client(pmac_keywest_t *i2c) unsigned short wdata = 0x00; /* SR: no swap, 1bit delay, 32-48kHz */ /* GCFG: power amp inverted, DAC on */ - if (snd_pmac_keywest_write_byte(i2c, DACA_REG_SR, 0x08) < 0 || - snd_pmac_keywest_write_byte(i2c, DACA_REG_GCFG, 0x05) < 0) + if (i2c_smbus_write_byte_data(i2c->client, DACA_REG_SR, 0x08) < 0 || + i2c_smbus_write_byte_data(i2c->client, DACA_REG_GCFG, 0x05) < 0) return -EINVAL; - return snd_pmac_keywest_write(i2c, DACA_REG_AVOL, 2, (unsigned char*)&wdata); + return i2c_smbus_write_block_data(i2c->client, DACA_REG_AVOL, + 2, (unsigned char*)&wdata); } /* @@ -81,9 +82,10 @@ static int daca_set_volume(pmac_daca_t *mix) else data[1] = mix->right_vol; data[1] |= mix->deemphasis ? 0x40 : 0; - if (snd_pmac_keywest_write(&mix->i2c, DACA_REG_AVOL, 2, data) < 0) { - snd_printk("failed to set volume \n"); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, DACA_REG_AVOL, + 2, data) < 0) { + snd_printk("failed to set volume \n"); + return -EINVAL; } return 0; } @@ -188,8 +190,8 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol change = mix->amp_on != ucontrol->value.integer.value[0]; if (change) { mix->amp_on = ucontrol->value.integer.value[0]; - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_GCFG, - mix->amp_on ? 0x05 : 0x04); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, + mix->amp_on ? 0x05 : 0x04); } return change; } @@ -220,9 +222,9 @@ static snd_kcontrol_new_t daca_mixers[] = { static void daca_resume(pmac_t *chip) { pmac_daca_t *mix = chip->mixer_data; - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_SR, 0x08); - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_GCFG, - mix->amp_on ? 0x05 : 0x04); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, + mix->amp_on ? 0x05 : 0x04); daca_set_volume(mix); } #endif /* CONFIG_PMAC_PBOOK */ diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 3e44a6a7d1494a..e9596dffa9ee42 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -64,7 +64,7 @@ static int snd_pmac_dbdma_alloc(pmac_dbdma_t *rec, int size) return -ENOMEM; rec->size = size; memset(rec->space, 0, sizeof(struct dbdma_cmd) * (size + 1)); - rec->cmds = (void*)DBDMA_ALIGN(rec->space); + rec->cmds = (void __iomem *)DBDMA_ALIGN(rec->space); rec->addr = virt_to_bus(rec->cmds); return 0; } @@ -200,7 +200,7 @@ inline static void snd_pmac_dma_run(pmac_stream_t *rec, int status) static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs) { int i; - volatile struct dbdma_cmd *cp; + volatile struct dbdma_cmd __iomem *cp; snd_pcm_runtime_t *runtime = subs->runtime; int rate_index; long offset; @@ -263,7 +263,7 @@ static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substr static int snd_pmac_pcm_trigger(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs, int cmd) { - volatile struct dbdma_cmd *cp; + volatile struct dbdma_cmd __iomem *cp; int i, command; switch (cmd) { @@ -314,7 +314,7 @@ static snd_pcm_uframes_t snd_pmac_pcm_pointer(pmac_t *chip, pmac_stream_t *rec, #if 1 /* hmm.. how can we get the current dma pointer?? */ int stat; - volatile struct dbdma_cmd *cp = &rec->cmd.cmds[rec->cur_period]; + volatile struct dbdma_cmd __iomem *cp = &rec->cmd.cmds[rec->cur_period]; stat = ld_le16(&cp->xfer_status); if (stat & (ACTIVE|DEAD)) { count = in_le16(&cp->res_count); @@ -379,7 +379,7 @@ static snd_pcm_uframes_t snd_pmac_capture_pointer(snd_pcm_substream_t *subs) */ static void snd_pmac_pcm_update(pmac_t *chip, pmac_stream_t *rec) { - volatile struct dbdma_cmd *cp; + volatile struct dbdma_cmd __iomem *cp; int c; int stat; @@ -818,11 +818,11 @@ static int snd_pmac_free(pmac_t *chip) if (chip->latch_base) iounmap(chip->latch_base); if (chip->awacs) - iounmap((void*)chip->awacs); + iounmap(chip->awacs); if (chip->playback.dma) - iounmap((void*)chip->playback.dma); + iounmap(chip->playback.dma); if (chip->capture.dma) - iounmap((void*)chip->capture.dma); + iounmap(chip->capture.dma); if (chip->node) { for (i = 0; i < 3; i++) { if (chip->of_requested & (1 << i)) @@ -1133,9 +1133,9 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) chip->of_requested |= (1 << i); } - chip->awacs = (volatile struct awacs_regs *) ioremap(np->addrs[0].address, 0x1000); - chip->playback.dma = (volatile struct dbdma_regs *) ioremap(np->addrs[1].address, 0x100); - chip->capture.dma = (volatile struct dbdma_regs *) ioremap(np->addrs[2].address, 0x100); + chip->awacs = ioremap(np->addrs[0].address, 0x1000); + chip->playback.dma = ioremap(np->addrs[1].address, 0x100); + chip->capture.dma = ioremap(np->addrs[2].address, 0x100); if (chip->model <= PMAC_BURGUNDY) { if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0, "PMac", (void*)chip)) { @@ -1176,15 +1176,14 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) * sound input. The 0x100 enables the SCSI bus * terminator power. */ - chip->latch_base = (unsigned char *) ioremap (0xf301a000, 0x1000); + chip->latch_base = ioremap (0xf301a000, 0x1000); in_8(chip->latch_base + 0x190); } else if (chip->is_pbook_G3) { struct device_node* mio; for (mio = chip->node->parent; mio; mio = mio->parent) { if (strcmp(mio->name, "mac-io") == 0 && mio->n_addrs > 0) { - chip->macio_base = (unsigned char *) ioremap - (mio->addrs[0].address, 0x40); + chip->macio_base = ioremap(mio->addrs[0].address, 0x40); break; } } diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h index 9521a4106dc854..a699b01210ee11 100644 --- a/sound/ppc/pmac.h +++ b/sound/ppc/pmac.h @@ -61,7 +61,7 @@ typedef struct snd_pmac_dbdma pmac_dbdma_t; */ struct snd_pmac_dbdma { unsigned long addr; - struct dbdma_cmd *cmds; + struct dbdma_cmd __iomem *cmds; void *space; int size; }; @@ -80,7 +80,7 @@ struct snd_pmac_stream { int nperiods, cur_period; pmac_dbdma_t cmd; - volatile struct dbdma_regs *dma; + volatile struct dbdma_regs __iomem *dma; snd_pcm_substream_t *substream; @@ -130,12 +130,12 @@ struct snd_pmac { int format; /* current format */ spinlock_t reg_lock; - volatile struct awacs_regs *awacs; + volatile struct awacs_regs __iomem *awacs; int awacs_reg[8]; /* register cache */ unsigned int hp_stat_mask; - unsigned char *latch_base; - unsigned char *macio_base; + unsigned char __iomem *latch_base; + unsigned char __iomem *macio_base; pmac_stream_t playback; pmac_stream_t capture; @@ -199,8 +199,6 @@ typedef struct snd_pmac_keywest { int snd_pmac_keywest_init(pmac_keywest_t *i2c); void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c); -#define snd_pmac_keywest_write(i2c,cmd,len,data) i2c_smbus_write_block_data((i2c)->client, cmd, len, data) -#define snd_pmac_keywest_write_byte(i2c,cmd,data) i2c_smbus_write_byte_data((i2c)->client, cmd, data) /* misc */ int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo); diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 8d985b0345070b..7d10385f0a7611 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -109,7 +109,8 @@ static int send_init_client(pmac_keywest_t *i2c, unsigned int *regs) while (*regs > 0) { int err, count = 10; do { - err = snd_pmac_keywest_write_byte(i2c, regs[0], regs[1]); + err = i2c_smbus_write_byte_data(i2c->client, + regs[0], regs[1]); if (err >= 0) break; mdelay(10); @@ -220,9 +221,10 @@ static int tumbler_set_master_volume(pmac_tumbler_t *mix) block[4] = (right_vol >> 8) & 0xff; block[5] = (right_vol >> 0) & 0xff; - if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_VOL, 6, block) < 0) { - snd_printk("failed to set volume \n"); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL, + 6, block) < 0) { + snd_printk("failed to set volume \n"); + return -EINVAL; } return 0; } @@ -320,9 +322,10 @@ static int tumbler_set_drc(pmac_tumbler_t *mix) val[1] = 0; } - if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_DRC, 2, val) < 0) { - snd_printk("failed to set DRC\n"); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, + 2, val) < 0) { + snd_printk("failed to set DRC\n"); + return -EINVAL; } return 0; } @@ -355,9 +358,10 @@ static int snapper_set_drc(pmac_tumbler_t *mix) val[4] = 0x60; val[5] = 0xa0; - if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_DRC, 6, val) < 0) { - snd_printk("failed to set DRC\n"); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, + 6, val) < 0) { + snd_printk("failed to set DRC\n"); + return -EINVAL; } return 0; } @@ -459,9 +463,10 @@ static int tumbler_set_mono_volume(pmac_tumbler_t *mix, struct tumbler_mono_vol vol = info->table[vol]; for (i = 0; i < info->bytes; i++) block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff; - if (snd_pmac_keywest_write(&mix->i2c, info->reg, info->bytes, block) < 0) { - snd_printk("failed to set mono volume %d\n", info->index); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, info->reg, + info->bytes, block) < 0) { + snd_printk("failed to set mono volume %d\n", info->index); + return -EINVAL; } return 0; } @@ -588,9 +593,9 @@ static int snapper_set_mix_vol1(pmac_tumbler_t *mix, int idx, int ch, int reg) for (j = 0; j < 3; j++) block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff; } - if (snd_pmac_keywest_write(&mix->i2c, reg, 9, block) < 0) { - snd_printk("failed to set mono volume %d\n", reg); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) { + snd_printk("failed to set mono volume %d\n", reg); + return -EINVAL; } return 0; } @@ -689,8 +694,8 @@ static int snapper_set_capture_source(pmac_tumbler_t *mix) { if (! mix->i2c.client) return -ENODEV; - return snd_pmac_keywest_write_byte(&mix->i2c, TAS_REG_ACS, - mix->capture_source ? 2 : 0); + return i2c_smbus_write_byte_data(mix->i2c.client, TAS_REG_ACS, + mix->capture_source ? 2 : 0); } static int snapper_info_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 9bb20124741df5..df09c2c22b20d4 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -568,7 +568,7 @@ static void snd_cs4231_mce_down(cs4231_t *chip) #endif #ifdef CONFIG_SND_DEBUG if (__cs4231_readb(chip, CS4231P(chip, REGSEL)) & CS4231_INIT) - snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", CS4231P(chip, REGSEL)); + snd_printk("mce_down [%p] - auto calibration time out (0)\n", CS4231P(chip, REGSEL)); #endif chip->mce_bit &= ~CS4231_MCE; timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL)); @@ -1346,7 +1346,7 @@ static int snd_cs4231_probe(cs4231_t *chip) break; /* this is valid value */ } } - snd_printdd("cs4231: port = 0x%lx, id = 0x%x\n", chip->port, id); + snd_printdd("cs4231: port = %p, id = 0x%x\n", chip->port, id); if (id != 0x0a) return -ENODEV; /* no valid device found */ |