Commit 969baba1 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] pmac sound iomem annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2f03b375
...@@ -118,9 +118,9 @@ ...@@ -118,9 +118,9 @@
* Interrupt numbers and addresses, & info obtained from the device tree. * Interrupt numbers and addresses, & info obtained from the device tree.
*/ */
static int awacs_irq, awacs_tx_irq, awacs_rx_irq; static int awacs_irq, awacs_tx_irq, awacs_rx_irq;
static volatile struct awacs_regs *awacs; static volatile struct awacs_regs __iomem *awacs;
static volatile u32 *i2s; static volatile u32 __iomem *i2s;
static volatile struct dbdma_regs *awacs_txdma, *awacs_rxdma; static volatile struct dbdma_regs __iomem *awacs_txdma, *awacs_rxdma;
static int awacs_rate_index; static int awacs_rate_index;
static int awacs_subframe; static int awacs_subframe;
static struct device_node* awacs_node; static struct device_node* awacs_node;
...@@ -146,8 +146,8 @@ static int has_ziva; ...@@ -146,8 +146,8 @@ static int has_ziva;
/* for earlier powerbooks which need fiddling with mac-io to enable /* for earlier powerbooks which need fiddling with mac-io to enable
* cd etc. * cd etc.
*/ */
static unsigned char *latch_base; static unsigned char __iomem *latch_base;
static unsigned char *macio_base; static unsigned char __iomem *macio_base;
/* /*
* Space for the DBDMA command blocks. * Space for the DBDMA command blocks.
...@@ -661,11 +661,11 @@ static void PMacIrqCleanup(void) ...@@ -661,11 +661,11 @@ static void PMacIrqCleanup(void)
free_irq(awacs_rx_irq, NULL); free_irq(awacs_rx_irq, NULL);
if (awacs) if (awacs)
iounmap((void *)awacs); iounmap(awacs);
if (i2s) if (i2s)
iounmap((void *)i2s); iounmap(i2s);
iounmap((void *)awacs_txdma); iounmap(awacs_txdma);
iounmap((void *)awacs_rxdma); iounmap(awacs_rxdma);
release_OF_resource(awacs_node, 0); release_OF_resource(awacs_node, 0);
release_OF_resource(awacs_node, 1); release_OF_resource(awacs_node, 1);
...@@ -2915,14 +2915,11 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n"); ...@@ -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 */ /* all OF versions I've seen use this value */
if (i2s_node) if (i2s_node)
i2s = (u32 *)ioremap(io->addrs[0].address, 0x1000); i2s = ioremap(io->addrs[0].address, 0x1000);
else else
awacs = (volatile struct awacs_regs *) awacs = ioremap(io->addrs[0].address, 0x1000);
ioremap(io->addrs[0].address, 0x1000); awacs_txdma = ioremap(io->addrs[1].address, 0x100);
awacs_txdma = (volatile struct dbdma_regs *) awacs_rxdma = ioremap(io->addrs[2].address, 0x100);
ioremap(io->addrs[1].address, 0x100);
awacs_rxdma = (volatile struct dbdma_regs *)
ioremap(io->addrs[2].address, 0x100);
/* first of all make sure that the chip is powered up....*/ /* first of all make sure that the chip is powered up....*/
pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, io, 0, 1); 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); ...@@ -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 * sound input. The 0x100 enables the SCSI bus
* terminator power. * terminator power.
*/ */
latch_base = (unsigned char *) ioremap (0xf301a000, 0x1000); latch_base = ioremap (0xf301a000, 0x1000);
in_8(latch_base + 0x190); in_8(latch_base + 0x190);
} else if (is_pbook_g3) { } else if (is_pbook_g3) {
...@@ -3084,8 +3081,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); ...@@ -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) { for (mio = io->parent; mio; mio = mio->parent) {
if (strcmp(mio->name, "mac-io") == 0 if (strcmp(mio->name, "mac-io") == 0
&& mio->n_addrs > 0) { && mio->n_addrs > 0) {
macio_base = (unsigned char *) ioremap macio_base = ioremap(mio->addrs[0].address, 0x40);
(mio->addrs[0].address, 0x40);
break; break;
} }
} }
......
...@@ -64,7 +64,7 @@ static int snd_pmac_dbdma_alloc(pmac_dbdma_t *rec, int size) ...@@ -64,7 +64,7 @@ static int snd_pmac_dbdma_alloc(pmac_dbdma_t *rec, int size)
return -ENOMEM; return -ENOMEM;
rec->size = size; rec->size = size;
memset(rec->space, 0, sizeof(struct dbdma_cmd) * (size + 1)); 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); rec->addr = virt_to_bus(rec->cmds);
return 0; return 0;
} }
...@@ -200,7 +200,7 @@ inline static void snd_pmac_dma_run(pmac_stream_t *rec, int status) ...@@ -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) static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substream_t *subs)
{ {
int i; int i;
volatile struct dbdma_cmd *cp; volatile struct dbdma_cmd __iomem *cp;
snd_pcm_runtime_t *runtime = subs->runtime; snd_pcm_runtime_t *runtime = subs->runtime;
int rate_index; int rate_index;
long offset; long offset;
...@@ -263,7 +263,7 @@ static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substr ...@@ -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, static int snd_pmac_pcm_trigger(pmac_t *chip, pmac_stream_t *rec,
snd_pcm_substream_t *subs, int cmd) snd_pcm_substream_t *subs, int cmd)
{ {
volatile struct dbdma_cmd *cp; volatile struct dbdma_cmd __iomem *cp;
int i, command; int i, command;
switch (cmd) { switch (cmd) {
...@@ -314,7 +314,7 @@ static snd_pcm_uframes_t snd_pmac_pcm_pointer(pmac_t *chip, pmac_stream_t *rec, ...@@ -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?? */ #if 1 /* hmm.. how can we get the current dma pointer?? */
int stat; 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); stat = ld_le16(&cp->xfer_status);
if (stat & (ACTIVE|DEAD)) { if (stat & (ACTIVE|DEAD)) {
count = in_le16(&cp->res_count); count = in_le16(&cp->res_count);
...@@ -379,7 +379,7 @@ static snd_pcm_uframes_t snd_pmac_capture_pointer(snd_pcm_substream_t *subs) ...@@ -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) 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 c;
int stat; int stat;
...@@ -818,11 +818,11 @@ static int snd_pmac_free(pmac_t *chip) ...@@ -818,11 +818,11 @@ static int snd_pmac_free(pmac_t *chip)
if (chip->latch_base) if (chip->latch_base)
iounmap(chip->latch_base); iounmap(chip->latch_base);
if (chip->awacs) if (chip->awacs)
iounmap((void*)chip->awacs); iounmap(chip->awacs);
if (chip->playback.dma) if (chip->playback.dma)
iounmap((void*)chip->playback.dma); iounmap(chip->playback.dma);
if (chip->capture.dma) if (chip->capture.dma)
iounmap((void*)chip->capture.dma); iounmap(chip->capture.dma);
if (chip->node) { if (chip->node) {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (chip->of_requested & (1 << i)) if (chip->of_requested & (1 << i))
...@@ -1133,9 +1133,9 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) ...@@ -1133,9 +1133,9 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
chip->of_requested |= (1 << i); chip->of_requested |= (1 << i);
} }
chip->awacs = (volatile struct awacs_regs *) ioremap(np->addrs[0].address, 0x1000); chip->awacs = ioremap(np->addrs[0].address, 0x1000);
chip->playback.dma = (volatile struct dbdma_regs *) ioremap(np->addrs[1].address, 0x100); chip->playback.dma = ioremap(np->addrs[1].address, 0x100);
chip->capture.dma = (volatile struct dbdma_regs *) ioremap(np->addrs[2].address, 0x100); chip->capture.dma = ioremap(np->addrs[2].address, 0x100);
if (chip->model <= PMAC_BURGUNDY) { if (chip->model <= PMAC_BURGUNDY) {
if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0, if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0,
"PMac", (void*)chip)) { "PMac", (void*)chip)) {
...@@ -1176,15 +1176,14 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) ...@@ -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 * sound input. The 0x100 enables the SCSI bus
* terminator power. * terminator power.
*/ */
chip->latch_base = (unsigned char *) ioremap (0xf301a000, 0x1000); chip->latch_base = ioremap (0xf301a000, 0x1000);
in_8(chip->latch_base + 0x190); in_8(chip->latch_base + 0x190);
} else if (chip->is_pbook_G3) { } else if (chip->is_pbook_G3) {
struct device_node* mio; struct device_node* mio;
for (mio = chip->node->parent; mio; mio = mio->parent) { for (mio = chip->node->parent; mio; mio = mio->parent) {
if (strcmp(mio->name, "mac-io") == 0 if (strcmp(mio->name, "mac-io") == 0
&& mio->n_addrs > 0) { && mio->n_addrs > 0) {
chip->macio_base = (unsigned char *) ioremap chip->macio_base = ioremap(mio->addrs[0].address, 0x40);
(mio->addrs[0].address, 0x40);
break; break;
} }
} }
......
...@@ -61,7 +61,7 @@ typedef struct snd_pmac_dbdma pmac_dbdma_t; ...@@ -61,7 +61,7 @@ typedef struct snd_pmac_dbdma pmac_dbdma_t;
*/ */
struct snd_pmac_dbdma { struct snd_pmac_dbdma {
unsigned long addr; unsigned long addr;
struct dbdma_cmd *cmds; struct dbdma_cmd __iomem *cmds;
void *space; void *space;
int size; int size;
}; };
...@@ -80,7 +80,7 @@ struct snd_pmac_stream { ...@@ -80,7 +80,7 @@ struct snd_pmac_stream {
int nperiods, cur_period; int nperiods, cur_period;
pmac_dbdma_t cmd; pmac_dbdma_t cmd;
volatile struct dbdma_regs *dma; volatile struct dbdma_regs __iomem *dma;
snd_pcm_substream_t *substream; snd_pcm_substream_t *substream;
...@@ -130,12 +130,12 @@ struct snd_pmac { ...@@ -130,12 +130,12 @@ struct snd_pmac {
int format; /* current format */ int format; /* current format */
spinlock_t reg_lock; spinlock_t reg_lock;
volatile struct awacs_regs *awacs; volatile struct awacs_regs __iomem *awacs;
int awacs_reg[8]; /* register cache */ int awacs_reg[8]; /* register cache */
unsigned int hp_stat_mask; unsigned int hp_stat_mask;
unsigned char *latch_base; unsigned char __iomem *latch_base;
unsigned char *macio_base; unsigned char __iomem *macio_base;
pmac_stream_t playback; pmac_stream_t playback;
pmac_stream_t capture; pmac_stream_t capture;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment