aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/dbdma.h12
-rw-r--r--arch/powerpc/include/asm/vga.h4
-rw-r--r--drivers/ata/pata_macio.c10
-rw-r--r--drivers/block/swim3.c12
-rw-r--r--drivers/ide/pmac.c10
-rw-r--r--drivers/macintosh/rack-meter.c30
-rw-r--r--drivers/net/ethernet/apple/bmac.c30
-rw-r--r--drivers/net/ethernet/apple/mace.c44
-rw-r--r--drivers/scsi/mac53c94.c10
-rw-r--r--drivers/scsi/mesh.c14
-rw-r--r--drivers/video/fbdev/controlfb.c2
-rw-r--r--drivers/video/fbdev/platinumfb.c2
-rw-r--r--sound/ppc/pmac.c58
13 files changed, 119 insertions, 119 deletions
diff --git a/arch/powerpc/include/asm/dbdma.h b/arch/powerpc/include/asm/dbdma.h
index e23f07e73cb3..6c69836b4ec2 100644
--- a/arch/powerpc/include/asm/dbdma.h
+++ b/arch/powerpc/include/asm/dbdma.h
@@ -42,12 +42,12 @@ struct dbdma_regs {
42 * DBDMA command structure. These fields are all little-endian! 42 * DBDMA command structure. These fields are all little-endian!
43 */ 43 */
44struct dbdma_cmd { 44struct dbdma_cmd {
45 unsigned short req_count; /* requested byte transfer count */ 45 __le16 req_count; /* requested byte transfer count */
46 unsigned short command; /* command word (has bit-fields) */ 46 __le16 command; /* command word (has bit-fields) */
47 unsigned int phy_addr; /* physical data address */ 47 __le32 phy_addr; /* physical data address */
48 unsigned int cmd_dep; /* command-dependent field */ 48 __le32 cmd_dep; /* command-dependent field */
49 unsigned short res_count; /* residual count after completion */ 49 __le16 res_count; /* residual count after completion */
50 unsigned short xfer_status; /* transfer status */ 50 __le16 xfer_status; /* transfer status */
51}; 51};
52 52
53/* DBDMA command values in command field */ 53/* DBDMA command values in command field */
diff --git a/arch/powerpc/include/asm/vga.h b/arch/powerpc/include/asm/vga.h
index e5f8dd366212..ab3acd2f2786 100644
--- a/arch/powerpc/include/asm/vga.h
+++ b/arch/powerpc/include/asm/vga.h
@@ -25,12 +25,12 @@
25 25
26static inline void scr_writew(u16 val, volatile u16 *addr) 26static inline void scr_writew(u16 val, volatile u16 *addr)
27{ 27{
28 st_le16(addr, val); 28 *addr = cpu_to_le16(val);
29} 29}
30 30
31static inline u16 scr_readw(volatile const u16 *addr) 31static inline u16 scr_readw(volatile const u16 *addr)
32{ 32{
33 return ld_le16(addr); 33 return le16_to_cpu(*addr);
34} 34}
35 35
36#define VT_BUF_HAVE_MEMCPYW 36#define VT_BUF_HAVE_MEMCPYW
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index a02f76fdcfcd..b0028588ff1c 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -540,9 +540,9 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc)
540 BUG_ON (pi++ >= MAX_DCMDS); 540 BUG_ON (pi++ >= MAX_DCMDS);
541 541
542 len = (sg_len < MAX_DBDMA_SEG) ? sg_len : MAX_DBDMA_SEG; 542 len = (sg_len < MAX_DBDMA_SEG) ? sg_len : MAX_DBDMA_SEG;
543 st_le16(&table->command, write ? OUTPUT_MORE: INPUT_MORE); 543 table->command = cpu_to_le16(write ? OUTPUT_MORE: INPUT_MORE);
544 st_le16(&table->req_count, len); 544 table->req_count = cpu_to_le16(len);
545 st_le32(&table->phy_addr, addr); 545 table->phy_addr = cpu_to_le32(addr);
546 table->cmd_dep = 0; 546 table->cmd_dep = 0;
547 table->xfer_status = 0; 547 table->xfer_status = 0;
548 table->res_count = 0; 548 table->res_count = 0;
@@ -557,12 +557,12 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc)
557 557
558 /* Convert the last command to an input/output */ 558 /* Convert the last command to an input/output */
559 table--; 559 table--;
560 st_le16(&table->command, write ? OUTPUT_LAST: INPUT_LAST); 560 table->command = cpu_to_le16(write ? OUTPUT_LAST: INPUT_LAST);
561 table++; 561 table++;
562 562
563 /* Add the stop command to the end of the list */ 563 /* Add the stop command to the end of the list */
564 memset(table, 0, sizeof(struct dbdma_cmd)); 564 memset(table, 0, sizeof(struct dbdma_cmd));
565 st_le16(&table->command, DBDMA_STOP); 565 table->command = cpu_to_le16(DBDMA_STOP);
566 566
567 dev_dbgdma(priv->dev, "%s: %d DMA list entries\n", __func__, pi); 567 dev_dbgdma(priv->dev, "%s: %d DMA list entries\n", __func__, pi);
568} 568}
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 523ee8fd4c15..c264f2d284a7 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -440,9 +440,9 @@ static inline void seek_track(struct floppy_state *fs, int n)
440static inline void init_dma(struct dbdma_cmd *cp, int cmd, 440static inline void init_dma(struct dbdma_cmd *cp, int cmd,
441 void *buf, int count) 441 void *buf, int count)
442{ 442{
443 st_le16(&cp->req_count, count); 443 cp->req_count = cpu_to_le16(count);
444 st_le16(&cp->command, cmd); 444 cp->command = cpu_to_le16(cmd);
445 st_le32(&cp->phy_addr, virt_to_bus(buf)); 445 cp->phy_addr = cpu_to_le32(virt_to_bus(buf));
446 cp->xfer_status = 0; 446 cp->xfer_status = 0;
447} 447}
448 448
@@ -771,8 +771,8 @@ static irqreturn_t swim3_interrupt(int irq, void *dev_id)
771 } 771 }
772 /* turn off DMA */ 772 /* turn off DMA */
773 out_le32(&dr->control, (RUN | PAUSE) << 16); 773 out_le32(&dr->control, (RUN | PAUSE) << 16);
774 stat = ld_le16(&cp->xfer_status); 774 stat = le16_to_cpu(cp->xfer_status);
775 resid = ld_le16(&cp->res_count); 775 resid = le16_to_cpu(cp->res_count);
776 if (intr & ERROR_INTR) { 776 if (intr & ERROR_INTR) {
777 n = fs->scount - 1 - resid / 512; 777 n = fs->scount - 1 - resid / 512;
778 if (n > 0) { 778 if (n > 0) {
@@ -1170,7 +1170,7 @@ static int swim3_add_device(struct macio_dev *mdev, int index)
1170 1170
1171 fs->dma_cmd = (struct dbdma_cmd *) DBDMA_ALIGN(fs->dbdma_cmd_space); 1171 fs->dma_cmd = (struct dbdma_cmd *) DBDMA_ALIGN(fs->dbdma_cmd_space);
1172 memset(fs->dma_cmd, 0, 2 * sizeof(struct dbdma_cmd)); 1172 memset(fs->dma_cmd, 0, 2 * sizeof(struct dbdma_cmd));
1173 st_le16(&fs->dma_cmd[1].command, DBDMA_STOP); 1173 fs->dma_cmd[1].command = cpu_to_le16(DBDMA_STOP);
1174 1174
1175 if (mdev->media_bay == NULL || check_media_bay(mdev->media_bay) == MB_FD) 1175 if (mdev->media_bay == NULL || check_media_bay(mdev->media_bay) == MB_FD)
1176 swim3_mb_event(mdev, MB_FD); 1176 swim3_mb_event(mdev, MB_FD);
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 2db803cd095c..d24a3f8b49bc 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1497,9 +1497,9 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
1497 drive->name); 1497 drive->name);
1498 return 0; 1498 return 0;
1499 } 1499 }
1500 st_le16(&table->command, wr? OUTPUT_MORE: INPUT_MORE); 1500 table->command = cpu_to_le16(wr? OUTPUT_MORE: INPUT_MORE);
1501 st_le16(&table->req_count, tc); 1501 table->req_count = cpu_to_le16(tc);
1502 st_le32(&table->phy_addr, cur_addr); 1502 table->phy_addr = cpu_to_le32(cur_addr);
1503 table->cmd_dep = 0; 1503 table->cmd_dep = 0;
1504 table->xfer_status = 0; 1504 table->xfer_status = 0;
1505 table->res_count = 0; 1505 table->res_count = 0;
@@ -1513,10 +1513,10 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
1513 1513
1514 /* convert the last command to an input/output last command */ 1514 /* convert the last command to an input/output last command */
1515 if (count) { 1515 if (count) {
1516 st_le16(&table[-1].command, wr? OUTPUT_LAST: INPUT_LAST); 1516 table[-1].command = cpu_to_le16(wr? OUTPUT_LAST: INPUT_LAST);
1517 /* add the stop command to the end of the list */ 1517 /* add the stop command to the end of the list */
1518 memset(table, 0, sizeof(struct dbdma_cmd)); 1518 memset(table, 0, sizeof(struct dbdma_cmd));
1519 st_le16(&table->command, DBDMA_STOP); 1519 table->command = cpu_to_le16(DBDMA_STOP);
1520 mb(); 1520 mb();
1521 writel(hwif->dmatable_dma, &dma->cmdptr); 1521 writel(hwif->dmatable_dma, &dma->cmdptr);
1522 return 1; 1522 return 1;
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 4192901cab40..048901a1111a 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -182,31 +182,31 @@ static void rackmeter_setup_dbdma(struct rackmeter *rm)
182 182
183 /* Prepare 4 dbdma commands for the 2 buffers */ 183 /* Prepare 4 dbdma commands for the 2 buffers */
184 memset(cmd, 0, 4 * sizeof(struct dbdma_cmd)); 184 memset(cmd, 0, 4 * sizeof(struct dbdma_cmd));
185 st_le16(&cmd->req_count, 4); 185 cmd->req_count = cpu_to_le16(4);
186 st_le16(&cmd->command, STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 186 cmd->command = cpu_to_le16(STORE_WORD | INTR_ALWAYS | KEY_SYSTEM);
187 st_le32(&cmd->phy_addr, rm->dma_buf_p + 187 cmd->phy_addr = cpu_to_le32(rm->dma_buf_p +
188 offsetof(struct rackmeter_dma, mark)); 188 offsetof(struct rackmeter_dma, mark));
189 st_le32(&cmd->cmd_dep, 0x02000000); 189 cmd->cmd_dep = cpu_to_le32(0x02000000);
190 cmd++; 190 cmd++;
191 191
192 st_le16(&cmd->req_count, SAMPLE_COUNT * 4); 192 cmd->req_count = cpu_to_le16(SAMPLE_COUNT * 4);
193 st_le16(&cmd->command, OUTPUT_MORE); 193 cmd->command = cpu_to_le16(OUTPUT_MORE);
194 st_le32(&cmd->phy_addr, rm->dma_buf_p + 194 cmd->phy_addr = cpu_to_le32(rm->dma_buf_p +
195 offsetof(struct rackmeter_dma, buf1)); 195 offsetof(struct rackmeter_dma, buf1));
196 cmd++; 196 cmd++;
197 197
198 st_le16(&cmd->req_count, 4); 198 cmd->req_count = cpu_to_le16(4);
199 st_le16(&cmd->command, STORE_WORD | INTR_ALWAYS | KEY_SYSTEM); 199 cmd->command = cpu_to_le16(STORE_WORD | INTR_ALWAYS | KEY_SYSTEM);
200 st_le32(&cmd->phy_addr, rm->dma_buf_p + 200 cmd->phy_addr = cpu_to_le32(rm->dma_buf_p +
201 offsetof(struct rackmeter_dma, mark)); 201 offsetof(struct rackmeter_dma, mark));
202 st_le32(&cmd->cmd_dep, 0x01000000); 202 cmd->cmd_dep = cpu_to_le32(0x01000000);
203 cmd++; 203 cmd++;
204 204
205 st_le16(&cmd->req_count, SAMPLE_COUNT * 4); 205 cmd->req_count = cpu_to_le16(SAMPLE_COUNT * 4);
206 st_le16(&cmd->command, OUTPUT_MORE | BR_ALWAYS); 206 cmd->command = cpu_to_le16(OUTPUT_MORE | BR_ALWAYS);
207 st_le32(&cmd->phy_addr, rm->dma_buf_p + 207 cmd->phy_addr = cpu_to_le32(rm->dma_buf_p +
208 offsetof(struct rackmeter_dma, buf2)); 208 offsetof(struct rackmeter_dma, buf2));
209 st_le32(&cmd->cmd_dep, rm->dma_buf_p); 209 cmd->cmd_dep = cpu_to_le32(rm->dma_buf_p);
210 210
211 rackmeter_do_pause(rm, 0); 211 rackmeter_do_pause(rm, 0);
212} 212}
diff --git a/drivers/net/ethernet/apple/bmac.c b/drivers/net/ethernet/apple/bmac.c
index daae0e016253..c0bd638f84af 100644
--- a/drivers/net/ethernet/apple/bmac.c
+++ b/drivers/net/ethernet/apple/bmac.c
@@ -483,8 +483,8 @@ static int bmac_suspend(struct macio_dev *mdev, pm_message_t state)
483 bmwrite(dev, TXCFG, (config & ~TxMACEnable)); 483 bmwrite(dev, TXCFG, (config & ~TxMACEnable));
484 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */ 484 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */
485 /* disable rx and tx dma */ 485 /* disable rx and tx dma */
486 st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 486 rd->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */
487 st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 487 td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */
488 /* free some skb's */ 488 /* free some skb's */
489 for (i=0; i<N_RX_RING; i++) { 489 for (i=0; i<N_RX_RING; i++) {
490 if (bp->rx_bufs[i] != NULL) { 490 if (bp->rx_bufs[i] != NULL) {
@@ -699,8 +699,8 @@ static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id)
699 699
700 while (1) { 700 while (1) {
701 cp = &bp->rx_cmds[i]; 701 cp = &bp->rx_cmds[i];
702 stat = ld_le16(&cp->xfer_status); 702 stat = le16_to_cpu(cp->xfer_status);
703 residual = ld_le16(&cp->res_count); 703 residual = le16_to_cpu(cp->res_count);
704 if ((stat & ACTIVE) == 0) 704 if ((stat & ACTIVE) == 0)
705 break; 705 break;
706 nb = RX_BUFLEN - residual - 2; 706 nb = RX_BUFLEN - residual - 2;
@@ -728,8 +728,8 @@ static irqreturn_t bmac_rxdma_intr(int irq, void *dev_id)
728 skb_reserve(bp->rx_bufs[i], 2); 728 skb_reserve(bp->rx_bufs[i], 2);
729 } 729 }
730 bmac_construct_rxbuff(skb, &bp->rx_cmds[i]); 730 bmac_construct_rxbuff(skb, &bp->rx_cmds[i]);
731 st_le16(&cp->res_count, 0); 731 cp->res_count = cpu_to_le16(0);
732 st_le16(&cp->xfer_status, 0); 732 cp->xfer_status = cpu_to_le16(0);
733 last = i; 733 last = i;
734 if (++i >= N_RX_RING) i = 0; 734 if (++i >= N_RX_RING) i = 0;
735 } 735 }
@@ -769,7 +769,7 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id)
769 769
770 while (1) { 770 while (1) {
771 cp = &bp->tx_cmds[bp->tx_empty]; 771 cp = &bp->tx_cmds[bp->tx_empty];
772 stat = ld_le16(&cp->xfer_status); 772 stat = le16_to_cpu(cp->xfer_status);
773 if (txintcount < 10) { 773 if (txintcount < 10) {
774 XXDEBUG(("bmac_txdma_xfer_stat=%#0x\n", stat)); 774 XXDEBUG(("bmac_txdma_xfer_stat=%#0x\n", stat));
775 } 775 }
@@ -1411,8 +1411,8 @@ static int bmac_close(struct net_device *dev)
1411 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */ 1411 bmwrite(dev, INTDISABLE, DisableAll); /* disable all intrs */
1412 1412
1413 /* disable rx and tx dma */ 1413 /* disable rx and tx dma */
1414 st_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1414 rd->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */
1415 st_le32(&td->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */ 1415 td->control = cpu_to_le32(DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE)); /* clear run bit */
1416 1416
1417 /* free some skb's */ 1417 /* free some skb's */
1418 XXDEBUG(("bmac: free rx bufs\n")); 1418 XXDEBUG(("bmac: free rx bufs\n"));
@@ -1493,7 +1493,7 @@ static void bmac_tx_timeout(unsigned long data)
1493 1493
1494 cp = &bp->tx_cmds[bp->tx_empty]; 1494 cp = &bp->tx_cmds[bp->tx_empty];
1495/* XXDEBUG((KERN_DEBUG "bmac: tx dmastat=%x %x runt=%d pr=%x fs=%x fc=%x\n", */ 1495/* XXDEBUG((KERN_DEBUG "bmac: tx dmastat=%x %x runt=%d pr=%x fs=%x fc=%x\n", */
1496/* ld_le32(&td->status), ld_le16(&cp->xfer_status), bp->tx_bad_runt, */ 1496/* le32_to_cpu(td->status), le16_to_cpu(cp->xfer_status), bp->tx_bad_runt, */
1497/* mb->pr, mb->xmtfs, mb->fifofc)); */ 1497/* mb->pr, mb->xmtfs, mb->fifofc)); */
1498 1498
1499 /* turn off both tx and rx and reset the chip */ 1499 /* turn off both tx and rx and reset the chip */
@@ -1506,7 +1506,7 @@ static void bmac_tx_timeout(unsigned long data)
1506 bmac_enable_and_reset_chip(dev); 1506 bmac_enable_and_reset_chip(dev);
1507 1507
1508 /* restart rx dma */ 1508 /* restart rx dma */
1509 cp = bus_to_virt(ld_le32(&rd->cmdptr)); 1509 cp = bus_to_virt(le32_to_cpu(rd->cmdptr));
1510 out_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE|ACTIVE|DEAD)); 1510 out_le32(&rd->control, DBDMA_CLEAR(RUN|PAUSE|FLUSH|WAKE|ACTIVE|DEAD));
1511 out_le16(&cp->xfer_status, 0); 1511 out_le16(&cp->xfer_status, 0);
1512 out_le32(&rd->cmdptr, virt_to_bus(cp)); 1512 out_le32(&rd->cmdptr, virt_to_bus(cp));
@@ -1553,10 +1553,10 @@ static void dump_dbdma(volatile struct dbdma_cmd *cp,int count)
1553 ip = (int*)(cp+i); 1553 ip = (int*)(cp+i);
1554 1554
1555 printk("dbdma req 0x%x addr 0x%x baddr 0x%x xfer/res 0x%x\n", 1555 printk("dbdma req 0x%x addr 0x%x baddr 0x%x xfer/res 0x%x\n",
1556 ld_le32(ip+0), 1556 le32_to_cpup(ip+0),
1557 ld_le32(ip+1), 1557 le32_to_cpup(ip+1),
1558 ld_le32(ip+2), 1558 le32_to_cpup(ip+2),
1559 ld_le32(ip+3)); 1559 le32_to_cpup(ip+3));
1560 } 1560 }
1561 1561
1562} 1562}
diff --git a/drivers/net/ethernet/apple/mace.c b/drivers/net/ethernet/apple/mace.c
index 842fe7684904..73afe49624f2 100644
--- a/drivers/net/ethernet/apple/mace.c
+++ b/drivers/net/ethernet/apple/mace.c
@@ -310,7 +310,7 @@ static void dbdma_reset(volatile struct dbdma_regs __iomem *dma)
310 * way on some machines. 310 * way on some machines.
311 */ 311 */
312 for (i = 200; i > 0; --i) 312 for (i = 200; i > 0; --i)
313 if (ld_le32(&dma->control) & RUN) 313 if (le32_to_cpu(dma->control) & RUN)
314 udelay(1); 314 udelay(1);
315} 315}
316 316
@@ -452,21 +452,21 @@ static int mace_open(struct net_device *dev)
452 data = skb->data; 452 data = skb->data;
453 } 453 }
454 mp->rx_bufs[i] = skb; 454 mp->rx_bufs[i] = skb;
455 st_le16(&cp->req_count, RX_BUFLEN); 455 cp->req_count = cpu_to_le16(RX_BUFLEN);
456 st_le16(&cp->command, INPUT_LAST + INTR_ALWAYS); 456 cp->command = cpu_to_le16(INPUT_LAST + INTR_ALWAYS);
457 st_le32(&cp->phy_addr, virt_to_bus(data)); 457 cp->phy_addr = cpu_to_le32(virt_to_bus(data));
458 cp->xfer_status = 0; 458 cp->xfer_status = 0;
459 ++cp; 459 ++cp;
460 } 460 }
461 mp->rx_bufs[i] = NULL; 461 mp->rx_bufs[i] = NULL;
462 st_le16(&cp->command, DBDMA_STOP); 462 cp->command = cpu_to_le16(DBDMA_STOP);
463 mp->rx_fill = i; 463 mp->rx_fill = i;
464 mp->rx_empty = 0; 464 mp->rx_empty = 0;
465 465
466 /* Put a branch back to the beginning of the receive command list */ 466 /* Put a branch back to the beginning of the receive command list */
467 ++cp; 467 ++cp;
468 st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 468 cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS);
469 st_le32(&cp->cmd_dep, virt_to_bus(mp->rx_cmds)); 469 cp->cmd_dep = cpu_to_le32(virt_to_bus(mp->rx_cmds));
470 470
471 /* start rx dma */ 471 /* start rx dma */
472 out_le32(&rd->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 472 out_le32(&rd->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */
@@ -475,8 +475,8 @@ static int mace_open(struct net_device *dev)
475 475
476 /* put a branch at the end of the tx command list */ 476 /* put a branch at the end of the tx command list */
477 cp = mp->tx_cmds + NCMDS_TX * N_TX_RING; 477 cp = mp->tx_cmds + NCMDS_TX * N_TX_RING;
478 st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 478 cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS);
479 st_le32(&cp->cmd_dep, virt_to_bus(mp->tx_cmds)); 479 cp->cmd_dep = cpu_to_le32(virt_to_bus(mp->tx_cmds));
480 480
481 /* reset tx dma */ 481 /* reset tx dma */
482 out_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16); 482 out_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
@@ -507,8 +507,8 @@ static int mace_close(struct net_device *dev)
507 out_8(&mb->imr, 0xff); /* disable all intrs */ 507 out_8(&mb->imr, 0xff); /* disable all intrs */
508 508
509 /* disable rx and tx dma */ 509 /* disable rx and tx dma */
510 st_le32(&rd->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 510 rd->control = cpu_to_le32((RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */
511 st_le32(&td->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */ 511 td->control = cpu_to_le32((RUN|PAUSE|FLUSH|WAKE) << 16); /* clear run bit */
512 512
513 mace_clean_rings(mp); 513 mace_clean_rings(mp);
514 514
@@ -558,8 +558,8 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
558 } 558 }
559 mp->tx_bufs[fill] = skb; 559 mp->tx_bufs[fill] = skb;
560 cp = mp->tx_cmds + NCMDS_TX * fill; 560 cp = mp->tx_cmds + NCMDS_TX * fill;
561 st_le16(&cp->req_count, len); 561 cp->req_count = cpu_to_le16(len);
562 st_le32(&cp->phy_addr, virt_to_bus(skb->data)); 562 cp->phy_addr = cpu_to_le32(virt_to_bus(skb->data));
563 563
564 np = mp->tx_cmds + NCMDS_TX * next; 564 np = mp->tx_cmds + NCMDS_TX * next;
565 out_le16(&np->command, DBDMA_STOP); 565 out_le16(&np->command, DBDMA_STOP);
@@ -691,7 +691,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
691 out_8(&mb->xmtfc, AUTO_PAD_XMIT); 691 out_8(&mb->xmtfc, AUTO_PAD_XMIT);
692 continue; 692 continue;
693 } 693 }
694 dstat = ld_le32(&td->status); 694 dstat = le32_to_cpu(td->status);
695 /* stop DMA controller */ 695 /* stop DMA controller */
696 out_le32(&td->control, RUN << 16); 696 out_le32(&td->control, RUN << 16);
697 /* 697 /*
@@ -724,7 +724,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
724 */ 724 */
725 } 725 }
726 cp = mp->tx_cmds + NCMDS_TX * i; 726 cp = mp->tx_cmds + NCMDS_TX * i;
727 stat = ld_le16(&cp->xfer_status); 727 stat = le16_to_cpu(cp->xfer_status);
728 if ((fs & (UFLO|LCOL|LCAR|RTRY)) || (dstat & DEAD) || xcount == 0) { 728 if ((fs & (UFLO|LCOL|LCAR|RTRY)) || (dstat & DEAD) || xcount == 0) {
729 /* 729 /*
730 * Check whether there were in fact 2 bytes written to 730 * Check whether there were in fact 2 bytes written to
@@ -830,7 +830,7 @@ static void mace_tx_timeout(unsigned long data)
830 mace_reset(dev); 830 mace_reset(dev);
831 831
832 /* restart rx dma */ 832 /* restart rx dma */
833 cp = bus_to_virt(ld_le32(&rd->cmdptr)); 833 cp = bus_to_virt(le32_to_cpu(rd->cmdptr));
834 dbdma_reset(rd); 834 dbdma_reset(rd);
835 out_le16(&cp->xfer_status, 0); 835 out_le16(&cp->xfer_status, 0);
836 out_le32(&rd->cmdptr, virt_to_bus(cp)); 836 out_le32(&rd->cmdptr, virt_to_bus(cp));
@@ -889,20 +889,20 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
889 spin_lock_irqsave(&mp->lock, flags); 889 spin_lock_irqsave(&mp->lock, flags);
890 for (i = mp->rx_empty; i != mp->rx_fill; ) { 890 for (i = mp->rx_empty; i != mp->rx_fill; ) {
891 cp = mp->rx_cmds + i; 891 cp = mp->rx_cmds + i;
892 stat = ld_le16(&cp->xfer_status); 892 stat = le16_to_cpu(cp->xfer_status);
893 if ((stat & ACTIVE) == 0) { 893 if ((stat & ACTIVE) == 0) {
894 next = i + 1; 894 next = i + 1;
895 if (next >= N_RX_RING) 895 if (next >= N_RX_RING)
896 next = 0; 896 next = 0;
897 np = mp->rx_cmds + next; 897 np = mp->rx_cmds + next;
898 if (next != mp->rx_fill && 898 if (next != mp->rx_fill &&
899 (ld_le16(&np->xfer_status) & ACTIVE) != 0) { 899 (le16_to_cpu(np->xfer_status) & ACTIVE) != 0) {
900 printk(KERN_DEBUG "mace: lost a status word\n"); 900 printk(KERN_DEBUG "mace: lost a status word\n");
901 ++mace_lost_status; 901 ++mace_lost_status;
902 } else 902 } else
903 break; 903 break;
904 } 904 }
905 nb = ld_le16(&cp->req_count) - ld_le16(&cp->res_count); 905 nb = le16_to_cpu(cp->req_count) - le16_to_cpu(cp->res_count);
906 out_le16(&cp->command, DBDMA_STOP); 906 out_le16(&cp->command, DBDMA_STOP);
907 /* got a packet, have a look at it */ 907 /* got a packet, have a look at it */
908 skb = mp->rx_bufs[i]; 908 skb = mp->rx_bufs[i];
@@ -962,13 +962,13 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
962 mp->rx_bufs[i] = skb; 962 mp->rx_bufs[i] = skb;
963 } 963 }
964 } 964 }
965 st_le16(&cp->req_count, RX_BUFLEN); 965 cp->req_count = cpu_to_le16(RX_BUFLEN);
966 data = skb? skb->data: dummy_buf; 966 data = skb? skb->data: dummy_buf;
967 st_le32(&cp->phy_addr, virt_to_bus(data)); 967 cp->phy_addr = cpu_to_le32(virt_to_bus(data));
968 out_le16(&cp->xfer_status, 0); 968 out_le16(&cp->xfer_status, 0);
969 out_le16(&cp->command, INPUT_LAST + INTR_ALWAYS); 969 out_le16(&cp->command, INPUT_LAST + INTR_ALWAYS);
970#if 0 970#if 0
971 if ((ld_le32(&rd->status) & ACTIVE) != 0) { 971 if ((le32_to_cpu(rd->status) & ACTIVE) != 0) {
972 out_le32(&rd->control, (PAUSE << 16) | PAUSE); 972 out_le32(&rd->control, (PAUSE << 16) | PAUSE);
973 while ((in_le32(&rd->status) & ACTIVE) != 0) 973 while ((in_le32(&rd->status) & ACTIVE) != 0)
974 ; 974 ;
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index e5cd8d8d4ce7..0adb2e015597 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -382,16 +382,16 @@ static void set_dma_cmds(struct fsc_state *state, struct scsi_cmnd *cmd)
382 if (dma_len > 0xffff) 382 if (dma_len > 0xffff)
383 panic("mac53c94: scatterlist element >= 64k"); 383 panic("mac53c94: scatterlist element >= 64k");
384 total += dma_len; 384 total += dma_len;
385 st_le16(&dcmds->req_count, dma_len); 385 dcmds->req_count = cpu_to_le16(dma_len);
386 st_le16(&dcmds->command, dma_cmd); 386 dcmds->command = cpu_to_le16(dma_cmd);
387 st_le32(&dcmds->phy_addr, dma_addr); 387 dcmds->phy_addr = cpu_to_le32(dma_addr);
388 dcmds->xfer_status = 0; 388 dcmds->xfer_status = 0;
389 ++dcmds; 389 ++dcmds;
390 } 390 }
391 391
392 dma_cmd += OUTPUT_LAST - OUTPUT_MORE; 392 dma_cmd += OUTPUT_LAST - OUTPUT_MORE;
393 st_le16(&dcmds[-1].command, dma_cmd); 393 dcmds[-1].command = cpu_to_le16(dma_cmd);
394 st_le16(&dcmds->command, DBDMA_STOP); 394 dcmds->command = cpu_to_le16(DBDMA_STOP);
395 cmd->SCp.this_residual = total; 395 cmd->SCp.this_residual = total;
396} 396}
397 397
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 57a95e2c3442..555367f00228 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1287,9 +1287,9 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd)
1287 } 1287 }
1288 if (dma_len > 0xffff) 1288 if (dma_len > 0xffff)
1289 panic("mesh: scatterlist element >= 64k"); 1289 panic("mesh: scatterlist element >= 64k");
1290 st_le16(&dcmds->req_count, dma_len - off); 1290 dcmds->req_count = cpu_to_le16(dma_len - off);
1291 st_le16(&dcmds->command, dma_cmd); 1291 dcmds->command = cpu_to_le16(dma_cmd);
1292 st_le32(&dcmds->phy_addr, dma_addr + off); 1292 dcmds->phy_addr = cpu_to_le32(dma_addr + off);
1293 dcmds->xfer_status = 0; 1293 dcmds->xfer_status = 0;
1294 ++dcmds; 1294 ++dcmds;
1295 dtot += dma_len - off; 1295 dtot += dma_len - off;
@@ -1303,15 +1303,15 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd)
1303 static char mesh_extra_buf[64]; 1303 static char mesh_extra_buf[64];
1304 1304
1305 dtot = sizeof(mesh_extra_buf); 1305 dtot = sizeof(mesh_extra_buf);
1306 st_le16(&dcmds->req_count, dtot); 1306 dcmds->req_count = cpu_to_le16(dtot);
1307 st_le32(&dcmds->phy_addr, virt_to_phys(mesh_extra_buf)); 1307 dcmds->phy_addr = cpu_to_le32(virt_to_phys(mesh_extra_buf));
1308 dcmds->xfer_status = 0; 1308 dcmds->xfer_status = 0;
1309 ++dcmds; 1309 ++dcmds;
1310 } 1310 }
1311 dma_cmd += OUTPUT_LAST - OUTPUT_MORE; 1311 dma_cmd += OUTPUT_LAST - OUTPUT_MORE;
1312 st_le16(&dcmds[-1].command, dma_cmd); 1312 dcmds[-1].command = cpu_to_le16(dma_cmd);
1313 memset(dcmds, 0, sizeof(*dcmds)); 1313 memset(dcmds, 0, sizeof(*dcmds));
1314 st_le16(&dcmds->command, DBDMA_STOP); 1314 dcmds->command = cpu_to_le16(DBDMA_STOP);
1315 ms->dma_count = dtot; 1315 ms->dma_count = dtot;
1316} 1316}
1317 1317
diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c
index 080fdd2a70f3..8d14b29aafea 100644
--- a/drivers/video/fbdev/controlfb.c
+++ b/drivers/video/fbdev/controlfb.c
@@ -315,7 +315,7 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
315 container_of(info, struct fb_info_control, info); 315 container_of(info, struct fb_info_control, info);
316 unsigned ctrl; 316 unsigned ctrl;
317 317
318 ctrl = ld_le32(CNTRL_REG(p,ctrl)); 318 ctrl = le32_to_cpup(CNTRL_REG(p,ctrl));
319 if (blank_mode > 0) 319 if (blank_mode > 0)
320 switch (blank_mode) { 320 switch (blank_mode) {
321 case FB_BLANK_VSYNC_SUSPEND: 321 case FB_BLANK_VSYNC_SUSPEND:
diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c
index 518d1fd38a81..377d3399a3ad 100644
--- a/drivers/video/fbdev/platinumfb.c
+++ b/drivers/video/fbdev/platinumfb.c
@@ -168,7 +168,7 @@ static int platinumfb_blank(int blank, struct fb_info *fb)
168 struct fb_info_platinum *info = (struct fb_info_platinum *) fb; 168 struct fb_info_platinum *info = (struct fb_info_platinum *) fb;
169 int ctrl; 169 int ctrl;
170 170
171 ctrl = ld_le32(&info->platinum_regs->ctrl.r) | 0x33; 171 ctrl = le32_to_cpup(&info->platinum_regs->ctrl.r) | 0x33;
172 if (blank) 172 if (blank)
173 --blank_mode; 173 --blank_mode;
174 if (blank & VESA_VSYNC_SUSPEND) 174 if (blank & VESA_VSYNC_SUSPEND)
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 13146d701413..0095a80a997f 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -240,7 +240,7 @@ static int snd_pmac_pcm_prepare(struct snd_pmac *chip, struct pmac_stream *rec,
240 */ 240 */
241 spin_lock_irq(&chip->reg_lock); 241 spin_lock_irq(&chip->reg_lock);
242 snd_pmac_dma_stop(rec); 242 snd_pmac_dma_stop(rec);
243 st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP); 243 chip->extra_dma.cmds->command = cpu_to_le16(DBDMA_STOP);
244 snd_pmac_dma_set_command(rec, &chip->extra_dma); 244 snd_pmac_dma_set_command(rec, &chip->extra_dma);
245 snd_pmac_dma_run(rec, RUN); 245 snd_pmac_dma_run(rec, RUN);
246 spin_unlock_irq(&chip->reg_lock); 246 spin_unlock_irq(&chip->reg_lock);
@@ -251,15 +251,15 @@ static int snd_pmac_pcm_prepare(struct snd_pmac *chip, struct pmac_stream *rec,
251 */ 251 */
252 offset = runtime->dma_addr; 252 offset = runtime->dma_addr;
253 for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++) { 253 for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++) {
254 st_le32(&cp->phy_addr, offset); 254 cp->phy_addr = cpu_to_le32(offset);
255 st_le16(&cp->req_count, rec->period_size); 255 cp->req_count = cpu_to_le16(rec->period_size);
256 /*st_le16(&cp->res_count, 0);*/ 256 /*cp->res_count = cpu_to_le16(0);*/
257 st_le16(&cp->xfer_status, 0); 257 cp->xfer_status = cpu_to_le16(0);
258 offset += rec->period_size; 258 offset += rec->period_size;
259 } 259 }
260 /* make loop */ 260 /* make loop */
261 st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS); 261 cp->command = cpu_to_le16(DBDMA_NOP + BR_ALWAYS);
262 st_le32(&cp->cmd_dep, rec->cmd.addr); 262 cp->cmd_dep = cpu_to_le32(rec->cmd.addr);
263 263
264 snd_pmac_dma_stop(rec); 264 snd_pmac_dma_stop(rec);
265 snd_pmac_dma_set_command(rec, &rec->cmd); 265 snd_pmac_dma_set_command(rec, &rec->cmd);
@@ -328,7 +328,7 @@ static snd_pcm_uframes_t snd_pmac_pcm_pointer(struct snd_pmac *chip,
328#if 1 /* hmm.. how can we get the current dma pointer?? */ 328#if 1 /* hmm.. how can we get the current dma pointer?? */
329 int stat; 329 int stat;
330 volatile struct dbdma_cmd __iomem *cp = &rec->cmd.cmds[rec->cur_period]; 330 volatile struct dbdma_cmd __iomem *cp = &rec->cmd.cmds[rec->cur_period];
331 stat = ld_le16(&cp->xfer_status); 331 stat = le16_to_cpu(cp->xfer_status);
332 if (stat & (ACTIVE|DEAD)) { 332 if (stat & (ACTIVE|DEAD)) {
333 count = in_le16(&cp->res_count); 333 count = in_le16(&cp->res_count);
334 if (count) 334 if (count)
@@ -427,26 +427,26 @@ static inline void snd_pmac_pcm_dead_xfer(struct pmac_stream *rec,
427 memcpy((void *)emergency_dbdma.cmds, (void *)cp, 427 memcpy((void *)emergency_dbdma.cmds, (void *)cp,
428 sizeof(struct dbdma_cmd)); 428 sizeof(struct dbdma_cmd));
429 emergency_in_use = 1; 429 emergency_in_use = 1;
430 st_le16(&cp->xfer_status, 0); 430 cp->xfer_status = cpu_to_le16(0);
431 st_le16(&cp->req_count, rec->period_size); 431 cp->req_count = cpu_to_le16(rec->period_size);
432 cp = emergency_dbdma.cmds; 432 cp = emergency_dbdma.cmds;
433 } 433 }
434 434
435 /* now bump the values to reflect the amount 435 /* now bump the values to reflect the amount
436 we haven't yet shifted */ 436 we haven't yet shifted */
437 req = ld_le16(&cp->req_count); 437 req = le16_to_cpu(cp->req_count);
438 res = ld_le16(&cp->res_count); 438 res = le16_to_cpu(cp->res_count);
439 phy = ld_le32(&cp->phy_addr); 439 phy = le32_to_cpu(cp->phy_addr);
440 phy += (req - res); 440 phy += (req - res);
441 st_le16(&cp->req_count, res); 441 cp->req_count = cpu_to_le16(res);
442 st_le16(&cp->res_count, 0); 442 cp->res_count = cpu_to_le16(0);
443 st_le16(&cp->xfer_status, 0); 443 cp->xfer_status = cpu_to_le16(0);
444 st_le32(&cp->phy_addr, phy); 444 cp->phy_addr = cpu_to_le32(phy);
445 445
446 st_le32(&cp->cmd_dep, rec->cmd.addr 446 cp->cmd_dep = cpu_to_le32(rec->cmd.addr
447 + sizeof(struct dbdma_cmd)*((rec->cur_period+1)%rec->nperiods)); 447 + sizeof(struct dbdma_cmd)*((rec->cur_period+1)%rec->nperiods));
448 448
449 st_le16(&cp->command, OUTPUT_MORE | BR_ALWAYS | INTR_ALWAYS); 449 cp->command = cpu_to_le16(OUTPUT_MORE | BR_ALWAYS | INTR_ALWAYS);
450 450
451 /* point at our patched up command block */ 451 /* point at our patched up command block */
452 out_le32(&rec->dma->cmdptr, emergency_dbdma.addr); 452 out_le32(&rec->dma->cmdptr, emergency_dbdma.addr);
@@ -475,7 +475,7 @@ static void snd_pmac_pcm_update(struct snd_pmac *chip, struct pmac_stream *rec)
475 else 475 else
476 cp = &rec->cmd.cmds[rec->cur_period]; 476 cp = &rec->cmd.cmds[rec->cur_period];
477 477
478 stat = ld_le16(&cp->xfer_status); 478 stat = le16_to_cpu(cp->xfer_status);
479 479
480 if (stat & DEAD) { 480 if (stat & DEAD) {
481 snd_pmac_pcm_dead_xfer(rec, cp); 481 snd_pmac_pcm_dead_xfer(rec, cp);
@@ -489,9 +489,9 @@ static void snd_pmac_pcm_update(struct snd_pmac *chip, struct pmac_stream *rec)
489 break; 489 break;
490 490
491 /*printk(KERN_DEBUG "update frag %d\n", rec->cur_period);*/ 491 /*printk(KERN_DEBUG "update frag %d\n", rec->cur_period);*/
492 st_le16(&cp->xfer_status, 0); 492 cp->xfer_status = cpu_to_le16(0);
493 st_le16(&cp->req_count, rec->period_size); 493 cp->req_count = cpu_to_le16(rec->period_size);
494 /*st_le16(&cp->res_count, 0);*/ 494 /*cp->res_count = cpu_to_le16(0);*/
495 rec->cur_period++; 495 rec->cur_period++;
496 if (rec->cur_period >= rec->nperiods) { 496 if (rec->cur_period >= rec->nperiods) {
497 rec->cur_period = 0; 497 rec->cur_period = 0;
@@ -760,11 +760,11 @@ void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long add
760 struct pmac_stream *rec = &chip->playback; 760 struct pmac_stream *rec = &chip->playback;
761 761
762 snd_pmac_dma_stop(rec); 762 snd_pmac_dma_stop(rec);
763 st_le16(&chip->extra_dma.cmds->req_count, bytes); 763 chip->extra_dma.cmds->req_count = cpu_to_le16(bytes);
764 st_le16(&chip->extra_dma.cmds->xfer_status, 0); 764 chip->extra_dma.cmds->xfer_status = cpu_to_le16(0);
765 st_le32(&chip->extra_dma.cmds->cmd_dep, chip->extra_dma.addr); 765 chip->extra_dma.cmds->cmd_dep = cpu_to_le32(chip->extra_dma.addr);
766 st_le32(&chip->extra_dma.cmds->phy_addr, addr); 766 chip->extra_dma.cmds->phy_addr = cpu_to_le32(addr);
767 st_le16(&chip->extra_dma.cmds->command, OUTPUT_MORE + BR_ALWAYS); 767 chip->extra_dma.cmds->command = cpu_to_le16(OUTPUT_MORE + BR_ALWAYS);
768 out_le32(&chip->awacs->control, 768 out_le32(&chip->awacs->control,
769 (in_le32(&chip->awacs->control) & ~0x1f00) 769 (in_le32(&chip->awacs->control) & ~0x1f00)
770 | (speed << 8)); 770 | (speed << 8));
@@ -776,7 +776,7 @@ void snd_pmac_beep_dma_start(struct snd_pmac *chip, int bytes, unsigned long add
776void snd_pmac_beep_dma_stop(struct snd_pmac *chip) 776void snd_pmac_beep_dma_stop(struct snd_pmac *chip)
777{ 777{
778 snd_pmac_dma_stop(&chip->playback); 778 snd_pmac_dma_stop(&chip->playback);
779 st_le16(&chip->extra_dma.cmds->command, DBDMA_STOP); 779 chip->extra_dma.cmds->command = cpu_to_le16(DBDMA_STOP);
780 snd_pmac_pcm_set_format(chip); /* reset format */ 780 snd_pmac_pcm_set_format(chip); /* reset format */
781} 781}
782 782