aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_opti.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-01 01:06:36 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:38 -0500
commit0d5ff566779f894ca9937231a181eb31e4adff0e (patch)
treed1c7495c932581c1d41aa7f0fdb303348da49106 /drivers/ata/pata_opti.c
parent1a68ff13c8a9b517de3fd4187dc525412a6eba1b (diff)
libata: convert to iomap
Convert libata core layer and LLDs to use iomap. * managed iomap is used. Pointer to pcim_iomap_table() is cached at host->iomap and used through out LLDs. This basically replaces host->mmio_base. * if possible, pcim_iomap_regions() is used Most iomap operation conversions are taken from Jeff Garzik <jgarzik@pobox.com>'s iomap branch. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_opti.c')
-rw-r--r--drivers/ata/pata_opti.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index 58951ccd1e4d..e76302631597 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -95,18 +95,18 @@ static void opti_error_handler(struct ata_port *ap)
95 95
96static void opti_write_reg(struct ata_port *ap, u8 val, int reg) 96static void opti_write_reg(struct ata_port *ap, u8 val, int reg)
97{ 97{
98 unsigned long regio = ap->ioaddr.cmd_addr; 98 void __iomem *regio = ap->ioaddr.cmd_addr;
99 99
100 /* These 3 unlock the control register access */ 100 /* These 3 unlock the control register access */
101 inw(regio + 1); 101 ioread16(regio + 1);
102 inw(regio + 1); 102 ioread16(regio + 1);
103 outb(3, regio + 2); 103 iowrite8(3, regio + 2);
104 104
105 /* Do the I/O */ 105 /* Do the I/O */
106 outb(val, regio + reg); 106 iowrite8(val, regio + reg);
107 107
108 /* Relock */ 108 /* Relock */
109 outb(0x83, regio + 2); 109 iowrite8(0x83, regio + 2);
110} 110}
111 111
112/** 112/**
@@ -124,7 +124,7 @@ static void opti_set_piomode(struct ata_port *ap, struct ata_device *adev)
124 struct ata_device *pair = ata_dev_pair(adev); 124 struct ata_device *pair = ata_dev_pair(adev);
125 int clock; 125 int clock;
126 int pio = adev->pio_mode - XFER_PIO_0; 126 int pio = adev->pio_mode - XFER_PIO_0;
127 unsigned long regio = ap->ioaddr.cmd_addr; 127 void __iomem *regio = ap->ioaddr.cmd_addr;
128 u8 addr; 128 u8 addr;
129 129
130 /* Address table precomputed with prefetch off and a DCLK of 2 */ 130 /* Address table precomputed with prefetch off and a DCLK of 2 */
@@ -137,8 +137,8 @@ static void opti_set_piomode(struct ata_port *ap, struct ata_device *adev)
137 { 0x58, 0x44, 0x32, 0x22, 0x21 } 137 { 0x58, 0x44, 0x32, 0x22, 0x21 }
138 }; 138 };
139 139
140 outb(0xff, regio + 5); 140 iowrite8(0xff, regio + 5);
141 clock = inw(regio + 5) & 1; 141 clock = ioread16(regio + 5) & 1;
142 142
143 /* 143 /*
144 * As with many controllers the address setup time is shared 144 * As with many controllers the address setup time is shared
@@ -205,7 +205,7 @@ static struct ata_port_operations opti_port_ops = {
205 .qc_prep = ata_qc_prep, 205 .qc_prep = ata_qc_prep,
206 .qc_issue = ata_qc_issue_prot, 206 .qc_issue = ata_qc_issue_prot,
207 207
208 .data_xfer = ata_pio_data_xfer, 208 .data_xfer = ata_data_xfer,
209 209
210 .irq_handler = ata_interrupt, 210 .irq_handler = ata_interrupt,
211 .irq_clear = ata_bmdma_irq_clear, 211 .irq_clear = ata_bmdma_irq_clear,