* 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;
/* 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.
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);
/* 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);
* 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) {
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;
}
}
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;
}
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;
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) {
#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);
*/
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;
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))
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)) {
* 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;
}
}
*/
struct snd_pmac_dbdma {
unsigned long addr;
- struct dbdma_cmd *cmds;
+ struct dbdma_cmd __iomem *cmds;
void *space;
int size;
};
int nperiods, cur_period;
pmac_dbdma_t cmd;
- volatile struct dbdma_regs *dma;
+ volatile struct dbdma_regs __iomem *dma;
snd_pcm_substream_t *substream;
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;