aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/aec62xx.c34
-rw-r--r--drivers/ide/pci/alim15x3.c18
-rw-r--r--drivers/ide/pci/amd74xx.c13
-rw-r--r--drivers/ide/pci/atiixp.c24
-rw-r--r--drivers/ide/pci/cmd640.c10
-rw-r--r--drivers/ide/pci/cmd64x.c17
-rw-r--r--drivers/ide/pci/cs5520.c9
-rw-r--r--drivers/ide/pci/cs5530.c15
-rw-r--r--drivers/ide/pci/cs5535.c22
-rw-r--r--drivers/ide/pci/cy82c693.c16
-rw-r--r--drivers/ide/pci/delkin_cb.c6
-rw-r--r--drivers/ide/pci/hpt34x.c13
-rw-r--r--drivers/ide/pci/hpt366.c27
-rw-r--r--drivers/ide/pci/it8213.c22
-rw-r--r--drivers/ide/pci/it821x.c19
-rw-r--r--drivers/ide/pci/jmicron.c25
-rw-r--r--drivers/ide/pci/ns87415.c7
-rw-r--r--drivers/ide/pci/opti621.c16
-rw-r--r--drivers/ide/pci/pdc202xx_new.c21
-rw-r--r--drivers/ide/pci/pdc202xx_old.c61
-rw-r--r--drivers/ide/pci/piix.c13
-rw-r--r--drivers/ide/pci/sc1200.c11
-rw-r--r--drivers/ide/pci/scc_pata.c13
-rw-r--r--drivers/ide/pci/serverworks.c33
-rw-r--r--drivers/ide/pci/sgiioc4.c19
-rw-r--r--drivers/ide/pci/siimage.c44
-rw-r--r--drivers/ide/pci/sis5513.c30
-rw-r--r--drivers/ide/pci/sl82c105.c11
-rw-r--r--drivers/ide/pci/slc90e66.c14
-rw-r--r--drivers/ide/pci/tc86c001.c12
-rw-r--r--drivers/ide/pci/triflex.c11
-rw-r--r--drivers/ide/pci/trm290.c7
-rw-r--r--drivers/ide/pci/via82cxxx.c14
33 files changed, 309 insertions, 318 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index c9ba15afe97d..ca16f37f9486 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -135,7 +135,7 @@ static void aec6260_set_mode(ide_drive_t *drive, const u8 speed)
135 135
136static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) 136static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
137{ 137{
138 drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0); 138 drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0);
139} 139}
140 140
141static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) 141static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
@@ -175,27 +175,23 @@ static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif)
175 return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 175 return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
176} 176}
177 177
178static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) 178static const struct ide_port_ops atp850_port_ops = {
179{ 179 .set_pio_mode = aec_set_pio_mode,
180 struct pci_dev *dev = to_pci_dev(hwif->dev); 180 .set_dma_mode = aec6210_set_mode,
181 181};
182 hwif->set_pio_mode = &aec_set_pio_mode;
183
184 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
185 hwif->set_dma_mode = &aec6210_set_mode;
186 else {
187 hwif->set_dma_mode = &aec6260_set_mode;
188 182
189 hwif->cable_detect = atp86x_cable_detect; 183static const struct ide_port_ops atp86x_port_ops = {
190 } 184 .set_pio_mode = aec_set_pio_mode,
191} 185 .set_dma_mode = aec6260_set_mode,
186 .cable_detect = atp86x_cable_detect,
187};
192 188
193static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { 189static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
194 { /* 0 */ 190 { /* 0 */
195 .name = "AEC6210", 191 .name = "AEC6210",
196 .init_chipset = init_chipset_aec62xx, 192 .init_chipset = init_chipset_aec62xx,
197 .init_hwif = init_hwif_aec62xx,
198 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 193 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
194 .port_ops = &atp850_port_ops,
199 .host_flags = IDE_HFLAG_SERIALIZE | 195 .host_flags = IDE_HFLAG_SERIALIZE |
200 IDE_HFLAG_NO_ATAPI_DMA | 196 IDE_HFLAG_NO_ATAPI_DMA |
201 IDE_HFLAG_NO_DSC | 197 IDE_HFLAG_NO_DSC |
@@ -207,7 +203,7 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
207 },{ /* 1 */ 203 },{ /* 1 */
208 .name = "AEC6260", 204 .name = "AEC6260",
209 .init_chipset = init_chipset_aec62xx, 205 .init_chipset = init_chipset_aec62xx,
210 .init_hwif = init_hwif_aec62xx, 206 .port_ops = &atp86x_port_ops,
211 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA | 207 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
212 IDE_HFLAG_ABUSE_SET_DMA_MODE | 208 IDE_HFLAG_ABUSE_SET_DMA_MODE |
213 IDE_HFLAG_OFF_BOARD, 209 IDE_HFLAG_OFF_BOARD,
@@ -217,8 +213,8 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
217 },{ /* 2 */ 213 },{ /* 2 */
218 .name = "AEC6260R", 214 .name = "AEC6260R",
219 .init_chipset = init_chipset_aec62xx, 215 .init_chipset = init_chipset_aec62xx,
220 .init_hwif = init_hwif_aec62xx,
221 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 216 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
217 .port_ops = &atp86x_port_ops,
222 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 218 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
223 IDE_HFLAG_ABUSE_SET_DMA_MODE | 219 IDE_HFLAG_ABUSE_SET_DMA_MODE |
224 IDE_HFLAG_NON_BOOTABLE, 220 IDE_HFLAG_NON_BOOTABLE,
@@ -228,7 +224,7 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
228 },{ /* 3 */ 224 },{ /* 3 */
229 .name = "AEC6280", 225 .name = "AEC6280",
230 .init_chipset = init_chipset_aec62xx, 226 .init_chipset = init_chipset_aec62xx,
231 .init_hwif = init_hwif_aec62xx, 227 .port_ops = &atp86x_port_ops,
232 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 228 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
233 IDE_HFLAG_ABUSE_SET_DMA_MODE | 229 IDE_HFLAG_ABUSE_SET_DMA_MODE |
234 IDE_HFLAG_OFF_BOARD, 230 IDE_HFLAG_OFF_BOARD,
@@ -238,8 +234,8 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
238 },{ /* 4 */ 234 },{ /* 4 */
239 .name = "AEC6280R", 235 .name = "AEC6280R",
240 .init_chipset = init_chipset_aec62xx, 236 .init_chipset = init_chipset_aec62xx,
241 .init_hwif = init_hwif_aec62xx,
242 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, 237 .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
238 .port_ops = &atp86x_port_ops,
243 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 239 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
244 IDE_HFLAG_ABUSE_SET_DMA_MODE | 240 IDE_HFLAG_ABUSE_SET_DMA_MODE |
245 IDE_HFLAG_OFF_BOARD, 241 IDE_HFLAG_OFF_BOARD,
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 3fa2d9f7b1b2..ec9fba8ad342 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -610,7 +610,7 @@ static int ali_cable_override(struct pci_dev *pdev)
610} 610}
611 611
612/** 612/**
613 * ata66_ali15x3 - check for UDMA 66 support 613 * ali_cable_detect - cable detection
614 * @hwif: IDE interface 614 * @hwif: IDE interface
615 * 615 *
616 * This checks if the controller and the cable are capable 616 * This checks if the controller and the cable are capable
@@ -620,7 +620,7 @@ static int ali_cable_override(struct pci_dev *pdev)
620 * FIXME: frobs bits that are not defined on newer ALi devicea 620 * FIXME: frobs bits that are not defined on newer ALi devicea
621 */ 621 */
622 622
623static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif) 623static u8 __devinit ali_cable_detect(ide_hwif_t *hwif)
624{ 624{
625 struct pci_dev *dev = to_pci_dev(hwif->dev); 625 struct pci_dev *dev = to_pci_dev(hwif->dev);
626 unsigned long flags; 626 unsigned long flags;
@@ -661,12 +661,6 @@ static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif)
661 661
662static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) 662static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
663{ 663{
664 hwif->set_pio_mode = &ali_set_pio_mode;
665 hwif->set_dma_mode = &ali_set_dma_mode;
666 hwif->udma_filter = &ali_udma_filter;
667
668 hwif->cable_detect = ata66_ali15x3;
669
670 if (hwif->dma_base == 0) 664 if (hwif->dma_base == 0)
671 return; 665 return;
672 666
@@ -745,11 +739,19 @@ static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
745 ide_setup_dma(hwif, dmabase); 739 ide_setup_dma(hwif, dmabase);
746} 740}
747 741
742static const struct ide_port_ops ali_port_ops = {
743 .set_pio_mode = ali_set_pio_mode,
744 .set_dma_mode = ali_set_dma_mode,
745 .udma_filter = ali_udma_filter,
746 .cable_detect = ali_cable_detect,
747};
748
748static const struct ide_port_info ali15x3_chipset __devinitdata = { 749static const struct ide_port_info ali15x3_chipset __devinitdata = {
749 .name = "ALI15X3", 750 .name = "ALI15X3",
750 .init_chipset = init_chipset_ali15x3, 751 .init_chipset = init_chipset_ali15x3,
751 .init_hwif = init_hwif_ali15x3, 752 .init_hwif = init_hwif_ali15x3,
752 .init_dma = init_dma_ali15x3, 753 .init_dma = init_dma_ali15x3,
754 .port_ops = &ali_port_ops,
753 .pio_mask = ATA_PIO5, 755 .pio_mask = ATA_PIO5,
754 .swdma_mask = ATA_SWDMA2, 756 .swdma_mask = ATA_SWDMA2,
755 .mwdma_mask = ATA_MWDMA2, 757 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index ff684d312378..f7c883808b02 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -210,13 +210,14 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
210 210
211 if (hwif->irq == 0) /* 0 is bogus but will do for now */ 211 if (hwif->irq == 0) /* 0 is bogus but will do for now */
212 hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel); 212 hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
213
214 hwif->set_pio_mode = &amd_set_pio_mode;
215 hwif->set_dma_mode = &amd_set_drive;
216
217 hwif->cable_detect = amd_cable_detect;
218} 213}
219 214
215static const struct ide_port_ops amd_port_ops = {
216 .set_pio_mode = amd_set_pio_mode,
217 .set_dma_mode = amd_set_drive,
218 .cable_detect = amd_cable_detect,
219};
220
220#define IDE_HFLAGS_AMD \ 221#define IDE_HFLAGS_AMD \
221 (IDE_HFLAG_PIO_NO_BLACKLIST | \ 222 (IDE_HFLAG_PIO_NO_BLACKLIST | \
222 IDE_HFLAG_ABUSE_SET_DMA_MODE | \ 223 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
@@ -230,6 +231,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
230 .init_chipset = init_chipset_amd74xx, \ 231 .init_chipset = init_chipset_amd74xx, \
231 .init_hwif = init_hwif_amd74xx, \ 232 .init_hwif = init_hwif_amd74xx, \
232 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ 233 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
234 .port_ops = &amd_port_ops, \
233 .host_flags = IDE_HFLAGS_AMD, \ 235 .host_flags = IDE_HFLAGS_AMD, \
234 .pio_mask = ATA_PIO5, \ 236 .pio_mask = ATA_PIO5, \
235 .swdma_mask = swdma, \ 237 .swdma_mask = swdma, \
@@ -243,6 +245,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
243 .init_chipset = init_chipset_amd74xx, \ 245 .init_chipset = init_chipset_amd74xx, \
244 .init_hwif = init_hwif_amd74xx, \ 246 .init_hwif = init_hwif_amd74xx, \
245 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ 247 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
248 .port_ops = &amd_port_ops, \
246 .host_flags = IDE_HFLAGS_AMD, \ 249 .host_flags = IDE_HFLAGS_AMD, \
247 .pio_mask = ATA_PIO5, \ 250 .pio_mask = ATA_PIO5, \
248 .swdma_mask = ATA_SWDMA2, \ 251 .swdma_mask = ATA_SWDMA2, \
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 91722f88b7bd..8b637181681a 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -130,35 +130,25 @@ static u8 __devinit atiixp_cable_detect(ide_hwif_t *hwif)
130 return ATA_CBL_PATA40; 130 return ATA_CBL_PATA40;
131} 131}
132 132
133/** 133static const struct ide_port_ops atiixp_port_ops = {
134 * init_hwif_atiixp - fill in the hwif for the ATIIXP 134 .set_pio_mode = atiixp_set_pio_mode,
135 * @hwif: IDE interface 135 .set_dma_mode = atiixp_set_dma_mode,
136 * 136 .cable_detect = atiixp_cable_detect,
137 * Set up the ide_hwif_t for the ATIIXP interface according to the 137};
138 * capabilities of the hardware.
139 */
140
141static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
142{
143 hwif->set_pio_mode = &atiixp_set_pio_mode;
144 hwif->set_dma_mode = &atiixp_set_dma_mode;
145
146 hwif->cable_detect = atiixp_cable_detect;
147}
148 138
149static const struct ide_port_info atiixp_pci_info[] __devinitdata = { 139static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
150 { /* 0 */ 140 { /* 0 */
151 .name = "ATIIXP", 141 .name = "ATIIXP",
152 .init_hwif = init_hwif_atiixp,
153 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, 142 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
143 .port_ops = &atiixp_port_ops,
154 .host_flags = IDE_HFLAG_LEGACY_IRQS, 144 .host_flags = IDE_HFLAG_LEGACY_IRQS,
155 .pio_mask = ATA_PIO4, 145 .pio_mask = ATA_PIO4,
156 .mwdma_mask = ATA_MWDMA2, 146 .mwdma_mask = ATA_MWDMA2,
157 .udma_mask = ATA_UDMA5, 147 .udma_mask = ATA_UDMA5,
158 },{ /* 1 */ 148 },{ /* 1 */
159 .name = "SB600_PATA", 149 .name = "SB600_PATA",
160 .init_hwif = init_hwif_atiixp,
161 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, 150 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
151 .port_ops = &atiixp_port_ops,
162 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS, 152 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS,
163 .pio_mask = ATA_PIO4, 153 .pio_mask = ATA_PIO4,
164 .mwdma_mask = ATA_MWDMA2, 154 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index b076dbfc43a7..de1bbdcf2297 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -633,6 +633,9 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
633 display_clocks(index); 633 display_clocks(index);
634} 634}
635 635
636static const struct ide_port_ops cmd640_port_ops = {
637 .set_pio_mode = cmd640_set_pio_mode,
638};
636#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 639#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
637 640
638static int pci_conf1(void) 641static int pci_conf1(void)
@@ -678,6 +681,7 @@ static const struct ide_port_info cmd640_port_info __initdata = {
678 IDE_HFLAG_ABUSE_PREFETCH | 681 IDE_HFLAG_ABUSE_PREFETCH |
679 IDE_HFLAG_ABUSE_FAST_DEVSEL, 682 IDE_HFLAG_ABUSE_FAST_DEVSEL,
680#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 683#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
684 .port_ops = &cmd640_port_ops,
681 .pio_mask = ATA_PIO5, 685 .pio_mask = ATA_PIO5,
682#endif 686#endif
683}; 687};
@@ -752,9 +756,6 @@ static int __init cmd640x_init(void)
752 */ 756 */
753 if (cmd_hwif0) { 757 if (cmd_hwif0) {
754 ide_init_port_hw(cmd_hwif0, &hw[0]); 758 ide_init_port_hw(cmd_hwif0, &hw[0]);
755#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
756 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
757#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
758 759
759 idx[0] = cmd_hwif0->index; 760 idx[0] = cmd_hwif0->index;
760 } 761 }
@@ -808,9 +809,6 @@ static int __init cmd640x_init(void)
808 */ 809 */
809 if (second_port_cmd640 && cmd_hwif1) { 810 if (second_port_cmd640 && cmd_hwif1) {
810 ide_init_port_hw(cmd_hwif1, &hw[1]); 811 ide_init_port_hw(cmd_hwif1, &hw[1]);
811#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
812 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
813#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
814 812
815 idx[1] = cmd_hwif1->index; 813 idx[1] = cmd_hwif1->index;
816 } 814 }
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 8baccfef237f..5411ded791bb 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -370,7 +370,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const cha
370 return 0; 370 return 0;
371} 371}
372 372
373static u8 __devinit ata66_cmd64x(ide_hwif_t *hwif) 373static u8 __devinit cmd64x_cable_detect(ide_hwif_t *hwif)
374{ 374{
375 struct pci_dev *dev = to_pci_dev(hwif->dev); 375 struct pci_dev *dev = to_pci_dev(hwif->dev);
376 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01; 376 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01;
@@ -389,11 +389,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
389{ 389{
390 struct pci_dev *dev = to_pci_dev(hwif->dev); 390 struct pci_dev *dev = to_pci_dev(hwif->dev);
391 391
392 hwif->set_pio_mode = &cmd64x_set_pio_mode;
393 hwif->set_dma_mode = &cmd64x_set_dma_mode;
394
395 hwif->cable_detect = ata66_cmd64x;
396
397 if (!hwif->dma_base) 392 if (!hwif->dma_base)
398 return; 393 return;
399 394
@@ -433,12 +428,19 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
433 } 428 }
434} 429}
435 430
431static const struct ide_port_ops cmd64x_port_ops = {
432 .set_pio_mode = cmd64x_set_pio_mode,
433 .set_dma_mode = cmd64x_set_dma_mode,
434 .cable_detect = cmd64x_cable_detect,
435};
436
436static const struct ide_port_info cmd64x_chipsets[] __devinitdata = { 437static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
437 { /* 0 */ 438 { /* 0 */
438 .name = "CMD643", 439 .name = "CMD643",
439 .init_chipset = init_chipset_cmd64x, 440 .init_chipset = init_chipset_cmd64x,
440 .init_hwif = init_hwif_cmd64x, 441 .init_hwif = init_hwif_cmd64x,
441 .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}}, 442 .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
443 .port_ops = &cmd64x_port_ops,
442 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX | 444 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX |
443 IDE_HFLAG_ABUSE_PREFETCH, 445 IDE_HFLAG_ABUSE_PREFETCH,
444 .pio_mask = ATA_PIO5, 446 .pio_mask = ATA_PIO5,
@@ -450,6 +452,7 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
450 .init_hwif = init_hwif_cmd64x, 452 .init_hwif = init_hwif_cmd64x,
451 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 453 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
452 .chipset = ide_cmd646, 454 .chipset = ide_cmd646,
455 .port_ops = &cmd64x_port_ops,
453 .host_flags = IDE_HFLAG_ABUSE_PREFETCH, 456 .host_flags = IDE_HFLAG_ABUSE_PREFETCH,
454 .pio_mask = ATA_PIO5, 457 .pio_mask = ATA_PIO5,
455 .mwdma_mask = ATA_MWDMA2, 458 .mwdma_mask = ATA_MWDMA2,
@@ -459,6 +462,7 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
459 .init_chipset = init_chipset_cmd64x, 462 .init_chipset = init_chipset_cmd64x,
460 .init_hwif = init_hwif_cmd64x, 463 .init_hwif = init_hwif_cmd64x,
461 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 464 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
465 .port_ops = &cmd64x_port_ops,
462 .host_flags = IDE_HFLAG_ABUSE_PREFETCH, 466 .host_flags = IDE_HFLAG_ABUSE_PREFETCH,
463 .pio_mask = ATA_PIO5, 467 .pio_mask = ATA_PIO5,
464 .mwdma_mask = ATA_MWDMA2, 468 .mwdma_mask = ATA_MWDMA2,
@@ -468,6 +472,7 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
468 .init_chipset = init_chipset_cmd64x, 472 .init_chipset = init_chipset_cmd64x,
469 .init_hwif = init_hwif_cmd64x, 473 .init_hwif = init_hwif_cmd64x,
470 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 474 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
475 .port_ops = &cmd64x_port_ops,
471 .host_flags = IDE_HFLAG_ABUSE_PREFETCH, 476 .host_flags = IDE_HFLAG_ABUSE_PREFETCH,
472 .pio_mask = ATA_PIO5, 477 .pio_mask = ATA_PIO5,
473 .mwdma_mask = ATA_MWDMA2, 478 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 01b37ecb5a5a..41559c6de0ca 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -105,19 +105,22 @@ static void cs5520_dma_host_set(ide_drive_t *drive, int on)
105 105
106static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) 106static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
107{ 107{
108 hwif->set_pio_mode = &cs5520_set_pio_mode;
109 hwif->set_dma_mode = &cs5520_set_dma_mode;
110
111 if (hwif->dma_base == 0) 108 if (hwif->dma_base == 0)
112 return; 109 return;
113 110
114 hwif->dma_host_set = &cs5520_dma_host_set; 111 hwif->dma_host_set = &cs5520_dma_host_set;
115} 112}
116 113
114static const struct ide_port_ops cs5520_port_ops = {
115 .set_pio_mode = cs5520_set_pio_mode,
116 .set_dma_mode = cs5520_set_dma_mode,
117};
118
117#define DECLARE_CS_DEV(name_str) \ 119#define DECLARE_CS_DEV(name_str) \
118 { \ 120 { \
119 .name = name_str, \ 121 .name = name_str, \
120 .init_hwif = init_hwif_cs5520, \ 122 .init_hwif = init_hwif_cs5520, \
123 .port_ops = &cs5520_port_ops, \
121 .host_flags = IDE_HFLAG_ISA_PORTS | \ 124 .host_flags = IDE_HFLAG_ISA_PORTS | \
122 IDE_HFLAG_CS5520 | \ 125 IDE_HFLAG_CS5520 | \
123 IDE_HFLAG_VDMA | \ 126 IDE_HFLAG_VDMA | \
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 56a369c2a78a..f5534c1ff349 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -228,26 +228,25 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
228 unsigned long basereg; 228 unsigned long basereg;
229 u32 d0_timings; 229 u32 d0_timings;
230 230
231 hwif->set_pio_mode = &cs5530_set_pio_mode;
232 hwif->set_dma_mode = &cs5530_set_dma_mode;
233
234 basereg = CS5530_BASEREG(hwif); 231 basereg = CS5530_BASEREG(hwif);
235 d0_timings = inl(basereg + 0); 232 d0_timings = inl(basereg + 0);
236 if (CS5530_BAD_PIO(d0_timings)) 233 if (CS5530_BAD_PIO(d0_timings))
237 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); 234 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0);
238 if (CS5530_BAD_PIO(inl(basereg + 8))) 235 if (CS5530_BAD_PIO(inl(basereg + 8)))
239 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); 236 outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8);
240
241 if (hwif->dma_base == 0)
242 return;
243
244 hwif->udma_filter = cs5530_udma_filter;
245} 237}
246 238
239static const struct ide_port_ops cs5530_port_ops = {
240 .set_pio_mode = cs5530_set_pio_mode,
241 .set_dma_mode = cs5530_set_dma_mode,
242 .udma_filter = cs5530_udma_filter,
243};
244
247static const struct ide_port_info cs5530_chipset __devinitdata = { 245static const struct ide_port_info cs5530_chipset __devinitdata = {
248 .name = "CS5530", 246 .name = "CS5530",
249 .init_chipset = init_chipset_cs5530, 247 .init_chipset = init_chipset_cs5530,
250 .init_hwif = init_hwif_cs5530, 248 .init_hwif = init_hwif_cs5530,
249 .port_ops = &cs5530_port_ops,
251 .host_flags = IDE_HFLAG_SERIALIZE | 250 .host_flags = IDE_HFLAG_SERIALIZE |
252 IDE_HFLAG_POST_SET_MODE, 251 IDE_HFLAG_POST_SET_MODE,
253 .pio_mask = ATA_PIO4, 252 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index c9685f239c65..99fe91a191b8 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -166,25 +166,15 @@ static u8 __devinit cs5535_cable_detect(ide_hwif_t *hwif)
166 return (bit & 1) ? ATA_CBL_PATA80 : ATA_CBL_PATA40; 166 return (bit & 1) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
167} 167}
168 168
169/**** 169static const struct ide_port_ops cs5535_port_ops = {
170 * init_hwif_cs5535 - Initialize one ide cannel 170 .set_pio_mode = cs5535_set_pio_mode,
171 * @hwif: Channel descriptor 171 .set_dma_mode = cs5535_set_dma_mode,
172 * 172 .cable_detect = cs5535_cable_detect,
173 * This gets invoked by the IDE driver once for each channel. It 173};
174 * performs channel-specific pre-initialization before drive probing.
175 *
176 */
177static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
178{
179 hwif->set_pio_mode = &cs5535_set_pio_mode;
180 hwif->set_dma_mode = &cs5535_set_dma_mode;
181
182 hwif->cable_detect = cs5535_cable_detect;
183}
184 174
185static const struct ide_port_info cs5535_chipset __devinitdata = { 175static const struct ide_port_info cs5535_chipset __devinitdata = {
186 .name = "CS5535", 176 .name = "CS5535",
187 .init_hwif = init_hwif_cs5535, 177 .port_ops = &cs5535_port_ops,
188 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE | 178 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE |
189 IDE_HFLAG_ABUSE_SET_DMA_MODE, 179 IDE_HFLAG_ABUSE_SET_DMA_MODE,
190 .pio_mask = ATA_PIO4, 180 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 08eab7e7f051..e30eae5a01b6 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -382,15 +382,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c
382 return 0; 382 return 0;
383} 383}
384 384
385/*
386 * the init function - called for each ide channel once
387 */
388static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
389{
390 hwif->set_pio_mode = &cy82c693_set_pio_mode;
391 hwif->set_dma_mode = &cy82c693_set_dma_mode;
392}
393
394static void __devinit init_iops_cy82c693(ide_hwif_t *hwif) 385static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
395{ 386{
396 static ide_hwif_t *primary; 387 static ide_hwif_t *primary;
@@ -404,11 +395,16 @@ static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
404 } 395 }
405} 396}
406 397
398static const struct ide_port_ops cy82c693_port_ops = {
399 .set_pio_mode = cy82c693_set_pio_mode,
400 .set_dma_mode = cy82c693_set_dma_mode,
401};
402
407static const struct ide_port_info cy82c693_chipset __devinitdata = { 403static const struct ide_port_info cy82c693_chipset __devinitdata = {
408 .name = "CY82C693", 404 .name = "CY82C693",
409 .init_chipset = init_chipset_cy82c693, 405 .init_chipset = init_chipset_cy82c693,
410 .init_iops = init_iops_cy82c693, 406 .init_iops = init_iops_cy82c693,
411 .init_hwif = init_hwif_cy82c693, 407 .port_ops = &cy82c693_port_ops,
412 .chipset = ide_cy82c693, 408 .chipset = ide_cy82c693,
413 .host_flags = IDE_HFLAG_SINGLE, 409 .host_flags = IDE_HFLAG_SINGLE,
414 .pio_mask = ATA_PIO4, 410 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 753b86fc6637..cb9af61da2ee 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -43,6 +43,10 @@ static const u8 setup[] = {
43 0x00, 0x00, 0x00, 0x00, 0xa4, 0x83, 0x02, 0x13, 43 0x00, 0x00, 0x00, 0x00, 0xa4, 0x83, 0x02, 0x13,
44}; 44};
45 45
46static const struct ide_port_ops delkin_cb_port_ops = {
47 .quirkproc = ide_undecoded_slave,
48};
49
46static int __devinit 50static int __devinit
47delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) 51delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
48{ 52{
@@ -90,7 +94,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
90 94
91 ide_init_port_hw(hwif, &hw); 95 ide_init_port_hw(hwif, &hw);
92 hwif->mmio = 1; 96 hwif->mmio = 1;
93 hwif->quirkproc = &ide_undecoded_slave; 97 hwif->port_ops = &delkin_cb_port_ops;
94 98
95 idx[0] = i; 99 idx[0] = i;
96 100
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 9f2fc3094000..e4193ef56797 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -115,11 +115,10 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha
115 return dev->irq; 115 return dev->irq;
116} 116}
117 117
118static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) 118static const struct ide_port_ops hpt34x_port_ops = {
119{ 119 .set_pio_mode = hpt34x_set_pio_mode,
120 hwif->set_pio_mode = &hpt34x_set_pio_mode; 120 .set_dma_mode = hpt34x_set_mode,
121 hwif->set_dma_mode = &hpt34x_set_mode; 121};
122}
123 122
124#define IDE_HFLAGS_HPT34X \ 123#define IDE_HFLAGS_HPT34X \
125 (IDE_HFLAG_NO_ATAPI_DMA | \ 124 (IDE_HFLAG_NO_ATAPI_DMA | \
@@ -131,16 +130,16 @@ static const struct ide_port_info hpt34x_chipsets[] __devinitdata = {
131 { /* 0 */ 130 { /* 0 */
132 .name = "HPT343", 131 .name = "HPT343",
133 .init_chipset = init_chipset_hpt34x, 132 .init_chipset = init_chipset_hpt34x,
134 .init_hwif = init_hwif_hpt34x,
135 .extra = 16, 133 .extra = 16,
134 .port_ops = &hpt34x_port_ops,
136 .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_NON_BOOTABLE, 135 .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_NON_BOOTABLE,
137 .pio_mask = ATA_PIO5, 136 .pio_mask = ATA_PIO5,
138 }, 137 },
139 { /* 1 */ 138 { /* 1 */
140 .name = "HPT345", 139 .name = "HPT345",
141 .init_chipset = init_chipset_hpt34x, 140 .init_chipset = init_chipset_hpt34x,
142 .init_hwif = init_hwif_hpt34x,
143 .extra = 16, 141 .extra = 16,
142 .port_ops = &hpt34x_port_ops,
144 .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_OFF_BOARD, 143 .host_flags = IDE_HFLAGS_HPT34X | IDE_HFLAG_OFF_BOARD,
145 .pio_mask = ATA_PIO5, 144 .pio_mask = ATA_PIO5,
146#ifdef CONFIG_HPT34X_AUTODMA 145#ifdef CONFIG_HPT34X_AUTODMA
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index a49090672145..1592dbf6c5cb 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1271,17 +1271,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1271 /* Cache the channel's MISC. control registers' offset */ 1271 /* Cache the channel's MISC. control registers' offset */
1272 hwif->select_data = hwif->channel ? 0x54 : 0x50; 1272 hwif->select_data = hwif->channel ? 0x54 : 0x50;
1273 1273
1274 hwif->set_pio_mode = &hpt3xx_set_pio_mode;
1275 hwif->set_dma_mode = &hpt3xx_set_mode;
1276
1277 hwif->quirkproc = &hpt3xx_quirkproc;
1278 hwif->maskproc = &hpt3xx_maskproc;
1279
1280 hwif->udma_filter = &hpt3xx_udma_filter;
1281 hwif->mdma_filter = &hpt3xx_mdma_filter;
1282
1283 hwif->cable_detect = hpt3xx_cable_detect;
1284
1285 /* 1274 /*
1286 * HPT3xxN chips have some complications: 1275 * HPT3xxN chips have some complications:
1287 * 1276 *
@@ -1416,6 +1405,16 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2)
1416 IDE_HFLAG_ABUSE_SET_DMA_MODE | \ 1405 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
1417 IDE_HFLAG_OFF_BOARD) 1406 IDE_HFLAG_OFF_BOARD)
1418 1407
1408static const struct ide_port_ops hpt3xx_port_ops = {
1409 .set_pio_mode = hpt3xx_set_pio_mode,
1410 .set_dma_mode = hpt3xx_set_mode,
1411 .quirkproc = hpt3xx_quirkproc,
1412 .maskproc = hpt3xx_maskproc,
1413 .mdma_filter = hpt3xx_mdma_filter,
1414 .udma_filter = hpt3xx_udma_filter,
1415 .cable_detect = hpt3xx_cable_detect,
1416};
1417
1419static const struct ide_port_info hpt366_chipsets[] __devinitdata = { 1418static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1420 { /* 0 */ 1419 { /* 0 */
1421 .name = "HPT36x", 1420 .name = "HPT36x",
@@ -1430,6 +1429,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1430 */ 1429 */
1431 .enablebits = {{0x50,0x10,0x10}, {0x54,0x04,0x04}}, 1430 .enablebits = {{0x50,0x10,0x10}, {0x54,0x04,0x04}},
1432 .extra = 240, 1431 .extra = 240,
1432 .port_ops = &hpt3xx_port_ops,
1433 .host_flags = IDE_HFLAGS_HPT3XX | IDE_HFLAG_SINGLE, 1433 .host_flags = IDE_HFLAGS_HPT3XX | IDE_HFLAG_SINGLE,
1434 .pio_mask = ATA_PIO4, 1434 .pio_mask = ATA_PIO4,
1435 .mwdma_mask = ATA_MWDMA2, 1435 .mwdma_mask = ATA_MWDMA2,
@@ -1440,6 +1440,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1440 .init_dma = init_dma_hpt366, 1440 .init_dma = init_dma_hpt366,
1441 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1441 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1442 .extra = 240, 1442 .extra = 240,
1443 .port_ops = &hpt3xx_port_ops,
1443 .host_flags = IDE_HFLAGS_HPT3XX, 1444 .host_flags = IDE_HFLAGS_HPT3XX,
1444 .pio_mask = ATA_PIO4, 1445 .pio_mask = ATA_PIO4,
1445 .mwdma_mask = ATA_MWDMA2, 1446 .mwdma_mask = ATA_MWDMA2,
@@ -1450,6 +1451,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1450 .init_dma = init_dma_hpt366, 1451 .init_dma = init_dma_hpt366,
1451 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1452 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1452 .extra = 240, 1453 .extra = 240,
1454 .port_ops = &hpt3xx_port_ops,
1453 .host_flags = IDE_HFLAGS_HPT3XX, 1455 .host_flags = IDE_HFLAGS_HPT3XX,
1454 .pio_mask = ATA_PIO4, 1456 .pio_mask = ATA_PIO4,
1455 .mwdma_mask = ATA_MWDMA2, 1457 .mwdma_mask = ATA_MWDMA2,
@@ -1460,6 +1462,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1460 .init_dma = init_dma_hpt366, 1462 .init_dma = init_dma_hpt366,
1461 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1463 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1462 .extra = 240, 1464 .extra = 240,
1465 .port_ops = &hpt3xx_port_ops,
1463 .host_flags = IDE_HFLAGS_HPT3XX, 1466 .host_flags = IDE_HFLAGS_HPT3XX,
1464 .pio_mask = ATA_PIO4, 1467 .pio_mask = ATA_PIO4,
1465 .mwdma_mask = ATA_MWDMA2, 1468 .mwdma_mask = ATA_MWDMA2,
@@ -1471,6 +1474,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1471 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1474 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1472 .udma_mask = ATA_UDMA5, 1475 .udma_mask = ATA_UDMA5,
1473 .extra = 240, 1476 .extra = 240,
1477 .port_ops = &hpt3xx_port_ops,
1474 .host_flags = IDE_HFLAGS_HPT3XX, 1478 .host_flags = IDE_HFLAGS_HPT3XX,
1475 .pio_mask = ATA_PIO4, 1479 .pio_mask = ATA_PIO4,
1476 .mwdma_mask = ATA_MWDMA2, 1480 .mwdma_mask = ATA_MWDMA2,
@@ -1481,6 +1485,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1481 .init_dma = init_dma_hpt366, 1485 .init_dma = init_dma_hpt366,
1482 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1486 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1483 .extra = 240, 1487 .extra = 240,
1488 .port_ops = &hpt3xx_port_ops,
1484 .host_flags = IDE_HFLAGS_HPT3XX, 1489 .host_flags = IDE_HFLAGS_HPT3XX,
1485 .pio_mask = ATA_PIO4, 1490 .pio_mask = ATA_PIO4,
1486 .mwdma_mask = ATA_MWDMA2, 1491 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 5b5b0cc4b76a..9053c8771e6e 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -149,27 +149,17 @@ static u8 __devinit it8213_cable_detect(ide_hwif_t *hwif)
149 return (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 149 return (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
150} 150}
151 151
152/** 152static const struct ide_port_ops it8213_port_ops = {
153 * init_hwif_it8213 - set up hwif structs 153 .set_pio_mode = it8213_set_pio_mode,
154 * @hwif: interface to set up 154 .set_dma_mode = it8213_set_dma_mode,
155 * 155 .cable_detect = it8213_cable_detect,
156 * We do the basic set up of the interface structure. 156};
157 */
158
159static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
160{
161 hwif->set_dma_mode = &it8213_set_dma_mode;
162 hwif->set_pio_mode = &it8213_set_pio_mode;
163
164 hwif->cable_detect = it8213_cable_detect;
165}
166
167 157
168#define DECLARE_ITE_DEV(name_str) \ 158#define DECLARE_ITE_DEV(name_str) \
169 { \ 159 { \
170 .name = name_str, \ 160 .name = name_str, \
171 .init_hwif = init_hwif_it8213, \
172 .enablebits = { {0x41, 0x80, 0x80} }, \ 161 .enablebits = { {0x41, 0x80, 0x80} }, \
162 .port_ops = &it8213_port_ops, \
173 .host_flags = IDE_HFLAG_SINGLE, \ 163 .host_flags = IDE_HFLAG_SINGLE, \
174 .pio_mask = ATA_PIO4, \ 164 .pio_mask = ATA_PIO4, \
175 .swdma_mask = ATA_SWDMA2_ONLY, \ 165 .swdma_mask = ATA_SWDMA2_ONLY, \
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index a38ec47423a0..7f4db1c0a4fc 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -418,7 +418,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed)
418} 418}
419 419
420/** 420/**
421 * ata66_it821x - check for 80 pin cable 421 * it821x_cable_detect - cable detection
422 * @hwif: interface to check 422 * @hwif: interface to check
423 * 423 *
424 * Check for the presence of an ATA66 capable cable on the 424 * Check for the presence of an ATA66 capable cable on the
@@ -426,7 +426,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed)
426 * the needed logic onboard. 426 * the needed logic onboard.
427 */ 427 */
428 428
429static u8 __devinit ata66_it821x(ide_hwif_t *hwif) 429static u8 __devinit it821x_cable_detect(ide_hwif_t *hwif)
430{ 430{
431 /* The reference driver also only does disk side */ 431 /* The reference driver also only does disk side */
432 return ATA_CBL_PATA80; 432 return ATA_CBL_PATA80;
@@ -527,8 +527,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
527 struct it821x_dev *idev = itdevs[hwif->channel]; 527 struct it821x_dev *idev = itdevs[hwif->channel];
528 u8 conf; 528 u8 conf;
529 529
530 hwif->quirkproc = &it821x_quirkproc;
531
532 ide_set_hwifdata(hwif, idev); 530 ide_set_hwifdata(hwif, idev);
533 531
534 pci_read_config_byte(dev, 0x50, &conf); 532 pci_read_config_byte(dev, 0x50, &conf);
@@ -563,17 +561,12 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
563 } 561 }
564 562
565 if (idev->smart == 0) { 563 if (idev->smart == 0) {
566 hwif->set_pio_mode = &it821x_set_pio_mode;
567 hwif->set_dma_mode = &it821x_set_dma_mode;
568
569 /* MWDMA/PIO clock switching for pass through mode */ 564 /* MWDMA/PIO clock switching for pass through mode */
570 hwif->dma_start = &it821x_dma_start; 565 hwif->dma_start = &it821x_dma_start;
571 hwif->ide_dma_end = &it821x_dma_end; 566 hwif->ide_dma_end = &it821x_dma_end;
572 } else 567 } else
573 hwif->host_flags |= IDE_HFLAG_NO_SET_MODE; 568 hwif->host_flags |= IDE_HFLAG_NO_SET_MODE;
574 569
575 hwif->cable_detect = ata66_it821x;
576
577 if (hwif->dma_base == 0) 570 if (hwif->dma_base == 0)
578 return; 571 return;
579 572
@@ -613,12 +606,20 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
613 return 0; 606 return 0;
614} 607}
615 608
609static const struct ide_port_ops it821x_port_ops = {
610 /* it821x_set_{pio,dma}_mode() are only used in pass-through mode */
611 .set_pio_mode = it821x_set_pio_mode,
612 .set_dma_mode = it821x_set_dma_mode,
613 .quirkproc = it821x_quirkproc,
614 .cable_detect = it821x_cable_detect,
615};
616 616
617#define DECLARE_ITE_DEV(name_str) \ 617#define DECLARE_ITE_DEV(name_str) \
618 { \ 618 { \
619 .name = name_str, \ 619 .name = name_str, \
620 .init_chipset = init_chipset_it821x, \ 620 .init_chipset = init_chipset_it821x, \
621 .init_hwif = init_hwif_it821x, \ 621 .init_hwif = init_hwif_it821x, \
622 .port_ops = &it821x_port_ops, \
622 .pio_mask = ATA_PIO4, \ 623 .pio_mask = ATA_PIO4, \
623 } 624 }
624 625
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 673f7dc8ba65..96ef7394f283 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -19,13 +19,13 @@ typedef enum {
19} port_type; 19} port_type;
20 20
21/** 21/**
22 * ata66_jmicron - Cable check 22 * jmicron_cable_detect - cable detection
23 * @hwif: IDE port 23 * @hwif: IDE port
24 * 24 *
25 * Returns the cable type. 25 * Returns the cable type.
26 */ 26 */
27 27
28static u8 __devinit ata66_jmicron(ide_hwif_t *hwif) 28static u8 __devinit jmicron_cable_detect(ide_hwif_t *hwif)
29{ 29{
30 struct pci_dev *pdev = to_pci_dev(hwif->dev); 30 struct pci_dev *pdev = to_pci_dev(hwif->dev);
31 31
@@ -95,25 +95,16 @@ static void jmicron_set_dma_mode(ide_drive_t *drive, const u8 mode)
95{ 95{
96} 96}
97 97
98/** 98static const struct ide_port_ops jmicron_port_ops = {
99 * init_hwif_jmicron - set up hwif structs 99 .set_pio_mode = jmicron_set_pio_mode,
100 * @hwif: interface to set up 100 .set_dma_mode = jmicron_set_dma_mode,
101 * 101 .cable_detect = jmicron_cable_detect,
102 * Minimal set up is required for the Jmicron hardware. 102};
103 */
104
105static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
106{
107 hwif->set_pio_mode = &jmicron_set_pio_mode;
108 hwif->set_dma_mode = &jmicron_set_dma_mode;
109
110 hwif->cable_detect = ata66_jmicron;
111}
112 103
113static const struct ide_port_info jmicron_chipset __devinitdata = { 104static const struct ide_port_info jmicron_chipset __devinitdata = {
114 .name = "JMB", 105 .name = "JMB",
115 .init_hwif = init_hwif_jmicron,
116 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, 106 .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
107 .port_ops = &jmicron_port_ops,
117 .pio_mask = ATA_PIO5, 108 .pio_mask = ATA_PIO5,
118 .mwdma_mask = ATA_MWDMA2, 109 .mwdma_mask = ATA_MWDMA2,
119 .udma_mask = ATA_UDMA6, 110 .udma_mask = ATA_UDMA6,
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index 3015d6916d4c..332de832f171 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -195,8 +195,6 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
195 u8 stat; 195 u8 stat;
196#endif 196#endif
197 197
198 hwif->selectproc = &ns87415_selectproc;
199
200 /* 198 /*
201 * We cannot probe for IRQ: both ports share common IRQ on INTA. 199 * We cannot probe for IRQ: both ports share common IRQ on INTA.
202 * Also, leave IRQ masked during drive probing, to prevent infinite 200 * Also, leave IRQ masked during drive probing, to prevent infinite
@@ -258,12 +256,17 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
258 hwif->ide_dma_end = &ns87415_ide_dma_end; 256 hwif->ide_dma_end = &ns87415_ide_dma_end;
259} 257}
260 258
259static const struct ide_port_ops ns87415_port_ops = {
260 .selectproc = ns87415_selectproc,
261};
262
261static const struct ide_port_info ns87415_chipset __devinitdata = { 263static const struct ide_port_info ns87415_chipset __devinitdata = {
262 .name = "NS87415", 264 .name = "NS87415",
263#ifdef CONFIG_SUPERIO 265#ifdef CONFIG_SUPERIO
264 .init_iops = init_iops_ns87415, 266 .init_iops = init_iops_ns87415,
265#endif 267#endif
266 .init_hwif = init_hwif_ns87415, 268 .init_hwif = init_hwif_ns87415,
269 .port_ops = &ns87415_port_ops,
267 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 270 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
268 IDE_HFLAG_NO_ATAPI_DMA, 271 IDE_HFLAG_NO_ATAPI_DMA,
269}; 272};
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index 88a4dd94eeea..9edacba20ffb 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -326,28 +326,24 @@ static void __devinit opti621_port_init_devs(ide_hwif_t *hwif)
326 hwif->drives[1].drive_data = PIO_DONT_KNOW; 326 hwif->drives[1].drive_data = PIO_DONT_KNOW;
327} 327}
328 328
329/* 329static const struct ide_port_ops opti621_port_ops = {
330 * init_hwif_opti621() is called once for each hwif found at boot. 330 .port_init_devs = opti621_port_init_devs,
331 */ 331 .set_pio_mode = opti621_set_pio_mode,
332static void __devinit init_hwif_opti621(ide_hwif_t *hwif) 332};
333{
334 hwif->port_init_devs = opti621_port_init_devs;
335 hwif->set_pio_mode = &opti621_set_pio_mode;
336}
337 333
338static const struct ide_port_info opti621_chipsets[] __devinitdata = { 334static const struct ide_port_info opti621_chipsets[] __devinitdata = {
339 { /* 0 */ 335 { /* 0 */
340 .name = "OPTI621", 336 .name = "OPTI621",
341 .init_hwif = init_hwif_opti621,
342 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, 337 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
338 .port_ops = &opti621_port_ops,
343 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 339 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
344 .pio_mask = ATA_PIO3, 340 .pio_mask = ATA_PIO3,
345 .swdma_mask = ATA_SWDMA2, 341 .swdma_mask = ATA_SWDMA2,
346 .mwdma_mask = ATA_MWDMA2, 342 .mwdma_mask = ATA_MWDMA2,
347 }, { /* 1 */ 343 }, { /* 1 */
348 .name = "OPTI621X", 344 .name = "OPTI621X",
349 .init_hwif = init_hwif_opti621,
350 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} }, 345 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
346 .port_ops = &opti621_port_ops,
351 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 347 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
352 .pio_mask = ATA_PIO3, 348 .pio_mask = ATA_PIO3,
353 .swdma_mask = ATA_SWDMA2, 349 .swdma_mask = ATA_SWDMA2,
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 1c8cb7797a4a..35a249cfe03f 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -442,17 +442,6 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
442 return dev->irq; 442 return dev->irq;
443} 443}
444 444
445static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
446{
447 hwif->set_pio_mode = &pdcnew_set_pio_mode;
448 hwif->set_dma_mode = &pdcnew_set_dma_mode;
449
450 hwif->quirkproc = &pdcnew_quirkproc;
451 hwif->resetproc = &pdcnew_reset;
452
453 hwif->cable_detect = pdcnew_cable_detect;
454}
455
456static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) 445static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
457{ 446{
458 struct pci_dev *dev2; 447 struct pci_dev *dev2;
@@ -476,11 +465,19 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
476 return NULL; 465 return NULL;
477} 466}
478 467
468static const struct ide_port_ops pdcnew_port_ops = {
469 .set_pio_mode = pdcnew_set_pio_mode,
470 .set_dma_mode = pdcnew_set_dma_mode,
471 .quirkproc = pdcnew_quirkproc,
472 .resetproc = pdcnew_reset,
473 .cable_detect = pdcnew_cable_detect,
474};
475
479#define DECLARE_PDCNEW_DEV(name_str, udma) \ 476#define DECLARE_PDCNEW_DEV(name_str, udma) \
480 { \ 477 { \
481 .name = name_str, \ 478 .name = name_str, \
482 .init_chipset = init_chipset_pdcnew, \ 479 .init_chipset = init_chipset_pdcnew, \
483 .init_hwif = init_hwif_pdc202new, \ 480 .port_ops = &pdcnew_port_ops, \
484 .host_flags = IDE_HFLAG_POST_SET_MODE | \ 481 .host_flags = IDE_HFLAG_POST_SET_MODE | \
485 IDE_HFLAG_ERROR_STOPS_FIFO | \ 482 IDE_HFLAG_ERROR_STOPS_FIFO | \
486 IDE_HFLAG_OFF_BOARD, \ 483 IDE_HFLAG_OFF_BOARD, \
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 150422ec3cfa..00563e1bfc73 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -115,7 +115,7 @@ static void pdc202xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
115 pdc202xx_set_mode(drive, XFER_PIO_0 + pio); 115 pdc202xx_set_mode(drive, XFER_PIO_0 + pio);
116} 116}
117 117
118static u8 __devinit pdc2026x_old_cable_detect(ide_hwif_t *hwif) 118static u8 __devinit pdc2026x_cable_detect(ide_hwif_t *hwif)
119{ 119{
120 struct pci_dev *dev = to_pci_dev(hwif->dev); 120 struct pci_dev *dev = to_pci_dev(hwif->dev);
121 u16 CIS, mask = hwif->channel ? (1 << 11) : (1 << 10); 121 u16 CIS, mask = hwif->channel ? (1 << 11) : (1 << 10);
@@ -226,26 +226,6 @@ somebody_else:
226 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ 226 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
227} 227}
228 228
229static void pdc202xx_dma_lost_irq(ide_drive_t *drive)
230{
231 ide_hwif_t *hwif = HWIF(drive);
232
233 if (hwif->resetproc != NULL)
234 hwif->resetproc(drive);
235
236 ide_dma_lost_irq(drive);
237}
238
239static void pdc202xx_dma_timeout(ide_drive_t *drive)
240{
241 ide_hwif_t *hwif = HWIF(drive);
242
243 if (hwif->resetproc != NULL)
244 hwif->resetproc(drive);
245
246 ide_dma_timeout(drive);
247}
248
249static void pdc202xx_reset_host (ide_hwif_t *hwif) 229static void pdc202xx_reset_host (ide_hwif_t *hwif)
250{ 230{
251 unsigned long high_16 = hwif->extra_base - 16; 231 unsigned long high_16 = hwif->extra_base - 16;
@@ -271,6 +251,18 @@ static void pdc202xx_reset (ide_drive_t *drive)
271 ide_set_max_pio(drive); 251 ide_set_max_pio(drive);
272} 252}
273 253
254static void pdc202xx_dma_lost_irq(ide_drive_t *drive)
255{
256 pdc202xx_reset(drive);
257 ide_dma_lost_irq(drive);
258}
259
260static void pdc202xx_dma_timeout(ide_drive_t *drive)
261{
262 pdc202xx_reset(drive);
263 ide_dma_timeout(drive);
264}
265
274static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, 266static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
275 const char *name) 267 const char *name)
276{ 268{
@@ -281,17 +273,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
281{ 273{
282 struct pci_dev *dev = to_pci_dev(hwif->dev); 274 struct pci_dev *dev = to_pci_dev(hwif->dev);
283 275
284 hwif->set_pio_mode = &pdc202xx_set_pio_mode;
285 hwif->set_dma_mode = &pdc202xx_set_mode;
286
287 hwif->quirkproc = &pdc202xx_quirkproc;
288
289 if (dev->device != PCI_DEVICE_ID_PROMISE_20246) {
290 hwif->resetproc = &pdc202xx_reset;
291
292 hwif->cable_detect = pdc2026x_old_cable_detect;
293 }
294
295 if (hwif->dma_base == 0) 276 if (hwif->dma_base == 0)
296 return; 277 return;
297 278
@@ -357,6 +338,20 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
357 IDE_HFLAG_ABUSE_SET_DMA_MODE | \ 338 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
358 IDE_HFLAG_OFF_BOARD) 339 IDE_HFLAG_OFF_BOARD)
359 340
341static const struct ide_port_ops pdc20246_port_ops = {
342 .set_pio_mode = pdc202xx_set_pio_mode,
343 .set_dma_mode = pdc202xx_set_mode,
344 .quirkproc = pdc202xx_quirkproc,
345};
346
347static const struct ide_port_ops pdc2026x_port_ops = {
348 .set_pio_mode = pdc202xx_set_pio_mode,
349 .set_dma_mode = pdc202xx_set_mode,
350 .quirkproc = pdc202xx_quirkproc,
351 .resetproc = pdc202xx_reset,
352 .cable_detect = pdc2026x_cable_detect,
353};
354
360#define DECLARE_PDC2026X_DEV(name_str, udma, extra_flags) \ 355#define DECLARE_PDC2026X_DEV(name_str, udma, extra_flags) \
361 { \ 356 { \
362 .name = name_str, \ 357 .name = name_str, \
@@ -364,6 +359,7 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
364 .init_hwif = init_hwif_pdc202xx, \ 359 .init_hwif = init_hwif_pdc202xx, \
365 .init_dma = init_dma_pdc202xx, \ 360 .init_dma = init_dma_pdc202xx, \
366 .extra = 48, \ 361 .extra = 48, \
362 .port_ops = &pdc2026x_port_ops, \
367 .host_flags = IDE_HFLAGS_PDC202XX | extra_flags, \ 363 .host_flags = IDE_HFLAGS_PDC202XX | extra_flags, \
368 .pio_mask = ATA_PIO4, \ 364 .pio_mask = ATA_PIO4, \
369 .mwdma_mask = ATA_MWDMA2, \ 365 .mwdma_mask = ATA_MWDMA2, \
@@ -376,6 +372,7 @@ static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
376 .init_chipset = init_chipset_pdc202xx, 372 .init_chipset = init_chipset_pdc202xx,
377 .init_hwif = init_hwif_pdc202xx, 373 .init_hwif = init_hwif_pdc202xx,
378 .init_dma = init_dma_pdc202xx, 374 .init_dma = init_dma_pdc202xx,
375 .port_ops = &pdc20246_port_ops,
379 .extra = 16, 376 .extra = 16,
380 .host_flags = IDE_HFLAGS_PDC202XX, 377 .host_flags = IDE_HFLAGS_PDC202XX,
381 .pio_mask = ATA_PIO4, 378 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 89d74ffdb207..21c5dd23f928 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -285,11 +285,6 @@ static u8 __devinit piix_cable_detect(ide_hwif_t *hwif)
285 285
286static void __devinit init_hwif_piix(ide_hwif_t *hwif) 286static void __devinit init_hwif_piix(ide_hwif_t *hwif)
287{ 287{
288 hwif->set_pio_mode = &piix_set_pio_mode;
289 hwif->set_dma_mode = &piix_set_dma_mode;
290
291 hwif->cable_detect = piix_cable_detect;
292
293 if (!hwif->dma_base) 288 if (!hwif->dma_base)
294 return; 289 return;
295 290
@@ -306,6 +301,12 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
306 hwif->ide_dma_clear_irq = &piix_dma_clear_irq; 301 hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
307} 302}
308 303
304static const struct ide_port_ops piix_port_ops = {
305 .set_pio_mode = piix_set_pio_mode,
306 .set_dma_mode = piix_set_dma_mode,
307 .cable_detect = piix_cable_detect,
308};
309
309#ifndef CONFIG_IA64 310#ifndef CONFIG_IA64
310 #define IDE_HFLAGS_PIIX IDE_HFLAG_LEGACY_IRQS 311 #define IDE_HFLAGS_PIIX IDE_HFLAG_LEGACY_IRQS
311#else 312#else
@@ -317,6 +318,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
317 .name = name_str, \ 318 .name = name_str, \
318 .init_hwif = init_hwif_piix, \ 319 .init_hwif = init_hwif_piix, \
319 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 320 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
321 .port_ops = &piix_port_ops, \
320 .host_flags = IDE_HFLAGS_PIIX, \ 322 .host_flags = IDE_HFLAGS_PIIX, \
321 .pio_mask = ATA_PIO4, \ 323 .pio_mask = ATA_PIO4, \
322 .swdma_mask = ATA_SWDMA2_ONLY, \ 324 .swdma_mask = ATA_SWDMA2_ONLY, \
@@ -330,6 +332,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
330 .init_chipset = init_chipset_ich, \ 332 .init_chipset = init_chipset_ich, \
331 .init_hwif = init_hwif_ich, \ 333 .init_hwif = init_hwif_ich, \
332 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ 334 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
335 .port_ops = &piix_port_ops, \
333 .host_flags = IDE_HFLAGS_PIIX, \ 336 .host_flags = IDE_HFLAGS_PIIX, \
334 .pio_mask = ATA_PIO4, \ 337 .pio_mask = ATA_PIO4, \
335 .swdma_mask = ATA_SWDMA2_ONLY, \ 338 .swdma_mask = ATA_SWDMA2_ONLY, \
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 44985c8f36e7..0c144770a8da 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -292,19 +292,22 @@ static int sc1200_resume (struct pci_dev *dev)
292 */ 292 */
293static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif) 293static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
294{ 294{
295 hwif->set_pio_mode = &sc1200_set_pio_mode;
296 hwif->set_dma_mode = &sc1200_set_dma_mode;
297
298 if (hwif->dma_base == 0) 295 if (hwif->dma_base == 0)
299 return; 296 return;
300 297
301 hwif->udma_filter = sc1200_udma_filter;
302 hwif->ide_dma_end = &sc1200_ide_dma_end; 298 hwif->ide_dma_end = &sc1200_ide_dma_end;
303} 299}
304 300
301static const struct ide_port_ops sc1200_port_ops = {
302 .set_pio_mode = sc1200_set_pio_mode,
303 .set_dma_mode = sc1200_set_dma_mode,
304 .udma_filter = sc1200_udma_filter,
305};
306
305static const struct ide_port_info sc1200_chipset __devinitdata = { 307static const struct ide_port_info sc1200_chipset __devinitdata = {
306 .name = "SC1200", 308 .name = "SC1200",
307 .init_hwif = init_hwif_sc1200, 309 .init_hwif = init_hwif_sc1200,
310 .port_ops = &sc1200_port_ops,
308 .host_flags = IDE_HFLAG_SERIALIZE | 311 .host_flags = IDE_HFLAG_SERIALIZE |
309 IDE_HFLAG_POST_SET_MODE | 312 IDE_HFLAG_POST_SET_MODE |
310 IDE_HFLAG_ABUSE_DMA_MODES, 313 IDE_HFLAG_ABUSE_DMA_MODES,
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 52145796f12f..c01e2da5c9e6 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -703,24 +703,27 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
703 703
704 hwif->dma_setup = scc_dma_setup; 704 hwif->dma_setup = scc_dma_setup;
705 hwif->ide_dma_end = scc_ide_dma_end; 705 hwif->ide_dma_end = scc_ide_dma_end;
706 hwif->set_pio_mode = scc_set_pio_mode;
707 hwif->set_dma_mode = scc_set_dma_mode;
708 hwif->ide_dma_test_irq = scc_dma_test_irq; 706 hwif->ide_dma_test_irq = scc_dma_test_irq;
709 hwif->udma_filter = scc_udma_filter;
710 707
711 if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) 708 if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN)
712 hwif->ultra_mask = ATA_UDMA6; /* 133MHz */ 709 hwif->ultra_mask = ATA_UDMA6; /* 133MHz */
713 else 710 else
714 hwif->ultra_mask = ATA_UDMA5; /* 100MHz */ 711 hwif->ultra_mask = ATA_UDMA5; /* 100MHz */
715
716 hwif->cable_detect = scc_cable_detect;
717} 712}
718 713
714static const struct ide_port_ops scc_port_ops = {
715 .set_pio_mode = scc_set_pio_mode,
716 .set_dma_mode = scc_set_dma_mode,
717 .udma_filter = scc_udma_filter,
718 .cable_detect = scc_cable_detect,
719};
720
719#define DECLARE_SCC_DEV(name_str) \ 721#define DECLARE_SCC_DEV(name_str) \
720 { \ 722 { \
721 .name = name_str, \ 723 .name = name_str, \
722 .init_iops = init_iops_scc, \ 724 .init_iops = init_iops_scc, \
723 .init_hwif = init_hwif_scc, \ 725 .init_hwif = init_hwif_scc, \
726 .port_ops = &scc_port_ops, \
724 .host_flags = IDE_HFLAG_SINGLE, \ 727 .host_flags = IDE_HFLAG_SINGLE, \
725 .pio_mask = ATA_PIO4, \ 728 .pio_mask = ATA_PIO4, \
726 } 729 }
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index cfe927469793..a1fb20826a5b 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -312,7 +312,7 @@ static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif)
312 return ATA_CBL_PATA40; 312 return ATA_CBL_PATA40;
313} 313}
314 314
315static u8 __devinit ata66_svwks(ide_hwif_t *hwif) 315static u8 __devinit svwks_cable_detect(ide_hwif_t *hwif)
316{ 316{
317 struct pci_dev *dev = to_pci_dev(hwif->dev); 317 struct pci_dev *dev = to_pci_dev(hwif->dev);
318 318
@@ -336,17 +336,18 @@ static u8 __devinit ata66_svwks(ide_hwif_t *hwif)
336 return ATA_CBL_PATA40; 336 return ATA_CBL_PATA40;
337} 337}
338 338
339static void __devinit init_hwif_svwks (ide_hwif_t *hwif) 339static const struct ide_port_ops osb4_port_ops = {
340{ 340 .set_pio_mode = svwks_set_pio_mode,
341 struct pci_dev *dev = to_pci_dev(hwif->dev); 341 .set_dma_mode = svwks_set_dma_mode,
342 342 .udma_filter = svwks_udma_filter,
343 hwif->set_pio_mode = &svwks_set_pio_mode; 343};
344 hwif->set_dma_mode = &svwks_set_dma_mode;
345 hwif->udma_filter = &svwks_udma_filter;
346 344
347 if (dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) 345static const struct ide_port_ops svwks_port_ops = {
348 hwif->cable_detect = ata66_svwks; 346 .set_pio_mode = svwks_set_pio_mode,
349} 347 .set_dma_mode = svwks_set_dma_mode,
348 .udma_filter = svwks_udma_filter,
349 .cable_detect = svwks_cable_detect,
350};
350 351
351#define IDE_HFLAGS_SVWKS \ 352#define IDE_HFLAGS_SVWKS \
352 (IDE_HFLAG_LEGACY_IRQS | \ 353 (IDE_HFLAG_LEGACY_IRQS | \
@@ -356,7 +357,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
356 { /* 0 */ 357 { /* 0 */
357 .name = "SvrWks OSB4", 358 .name = "SvrWks OSB4",
358 .init_chipset = init_chipset_svwks, 359 .init_chipset = init_chipset_svwks,
359 .init_hwif = init_hwif_svwks, 360 .port_ops = &osb4_port_ops,
360 .host_flags = IDE_HFLAGS_SVWKS, 361 .host_flags = IDE_HFLAGS_SVWKS,
361 .pio_mask = ATA_PIO4, 362 .pio_mask = ATA_PIO4,
362 .mwdma_mask = ATA_MWDMA2, 363 .mwdma_mask = ATA_MWDMA2,
@@ -364,7 +365,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
364 },{ /* 1 */ 365 },{ /* 1 */
365 .name = "SvrWks CSB5", 366 .name = "SvrWks CSB5",
366 .init_chipset = init_chipset_svwks, 367 .init_chipset = init_chipset_svwks,
367 .init_hwif = init_hwif_svwks, 368 .port_ops = &svwks_port_ops,
368 .host_flags = IDE_HFLAGS_SVWKS, 369 .host_flags = IDE_HFLAGS_SVWKS,
369 .pio_mask = ATA_PIO4, 370 .pio_mask = ATA_PIO4,
370 .mwdma_mask = ATA_MWDMA2, 371 .mwdma_mask = ATA_MWDMA2,
@@ -372,7 +373,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
372 },{ /* 2 */ 373 },{ /* 2 */
373 .name = "SvrWks CSB6", 374 .name = "SvrWks CSB6",
374 .init_chipset = init_chipset_svwks, 375 .init_chipset = init_chipset_svwks,
375 .init_hwif = init_hwif_svwks, 376 .port_ops = &svwks_port_ops,
376 .host_flags = IDE_HFLAGS_SVWKS, 377 .host_flags = IDE_HFLAGS_SVWKS,
377 .pio_mask = ATA_PIO4, 378 .pio_mask = ATA_PIO4,
378 .mwdma_mask = ATA_MWDMA2, 379 .mwdma_mask = ATA_MWDMA2,
@@ -380,7 +381,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
380 },{ /* 3 */ 381 },{ /* 3 */
381 .name = "SvrWks CSB6", 382 .name = "SvrWks CSB6",
382 .init_chipset = init_chipset_svwks, 383 .init_chipset = init_chipset_svwks,
383 .init_hwif = init_hwif_svwks, 384 .port_ops = &svwks_port_ops,
384 .host_flags = IDE_HFLAGS_SVWKS | IDE_HFLAG_SINGLE, 385 .host_flags = IDE_HFLAGS_SVWKS | IDE_HFLAG_SINGLE,
385 .pio_mask = ATA_PIO4, 386 .pio_mask = ATA_PIO4,
386 .mwdma_mask = ATA_MWDMA2, 387 .mwdma_mask = ATA_MWDMA2,
@@ -388,7 +389,7 @@ static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
388 },{ /* 4 */ 389 },{ /* 4 */
389 .name = "SvrWks HT1000", 390 .name = "SvrWks HT1000",
390 .init_chipset = init_chipset_svwks, 391 .init_chipset = init_chipset_svwks,
391 .init_hwif = init_hwif_svwks, 392 .port_ops = &svwks_port_ops,
392 .host_flags = IDE_HFLAGS_SVWKS | IDE_HFLAG_SINGLE, 393 .host_flags = IDE_HFLAGS_SVWKS | IDE_HFLAG_SINGLE,
393 .pio_mask = ATA_PIO4, 394 .pio_mask = ATA_PIO4,
394 .mwdma_mask = ATA_MWDMA2, 395 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 6bd9523cf642..22ac0f70c423 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -552,16 +552,6 @@ static void __devinit
552ide_init_sgiioc4(ide_hwif_t * hwif) 552ide_init_sgiioc4(ide_hwif_t * hwif)
553{ 553{
554 hwif->mmio = 1; 554 hwif->mmio = 1;
555 hwif->set_pio_mode = NULL; /* Sets timing for PIO mode */
556 hwif->set_dma_mode = &sgiioc4_set_dma_mode;
557 hwif->selectproc = NULL;/* Use the default routine to select drive */
558 hwif->reset_poll = NULL;/* No HBA specific reset_poll needed */
559 hwif->pre_reset = NULL; /* No HBA specific pre_set needed */
560 hwif->resetproc = &sgiioc4_resetproc;/* Reset DMA engine,
561 clear interrupts */
562 hwif->maskproc = &sgiioc4_maskproc; /* Mask on/off NIEN register */
563 hwif->quirkproc = NULL;
564
565 hwif->INB = &sgiioc4_INB; 555 hwif->INB = &sgiioc4_INB;
566 556
567 if (hwif->dma_base == 0) 557 if (hwif->dma_base == 0)
@@ -576,8 +566,17 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
576 hwif->dma_timeout = &ide_dma_timeout; 566 hwif->dma_timeout = &ide_dma_timeout;
577} 567}
578 568
569static const struct ide_port_ops sgiioc4_port_ops = {
570 .set_dma_mode = sgiioc4_set_dma_mode,
571 /* reset DMA engine, clear IRQs */
572 .resetproc = sgiioc4_resetproc,
573 /* mask on/off NIEN register */
574 .maskproc = sgiioc4_maskproc,
575};
576
579static const struct ide_port_info sgiioc4_port_info __devinitdata = { 577static const struct ide_port_info sgiioc4_port_info __devinitdata = {
580 .chipset = ide_pci, 578 .chipset = ide_pci,
579 .port_ops = &sgiioc4_port_ops,
581 .host_flags = IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ 580 .host_flags = IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
582 IDE_HFLAG_NO_AUTOTUNE, 581 IDE_HFLAG_NO_AUTOTUNE,
583 .mwdma_mask = ATA_MWDMA2_ONLY, 582 .mwdma_mask = ATA_MWDMA2_ONLY,
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index c9ecab8aeb61..3e4b99380709 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -735,14 +735,14 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif)
735} 735}
736 736
737/** 737/**
738 * ata66_siimage - check for 80 pin cable 738 * sil_cable_detect - cable detection
739 * @hwif: interface to check 739 * @hwif: interface to check
740 * 740 *
741 * Check for the presence of an ATA66 capable cable on the 741 * Check for the presence of an ATA66 capable cable on the
742 * interface. 742 * interface.
743 */ 743 */
744 744
745static u8 __devinit ata66_siimage(ide_hwif_t *hwif) 745static u8 __devinit sil_cable_detect(ide_hwif_t *hwif)
746{ 746{
747 struct pci_dev *dev = to_pci_dev(hwif->dev); 747 struct pci_dev *dev = to_pci_dev(hwif->dev);
748 unsigned long addr = siimage_selreg(hwif, 0); 748 unsigned long addr = siimage_selreg(hwif, 0);
@@ -769,25 +769,14 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
769{ 769{
770 u8 sata = is_sata(hwif); 770 u8 sata = is_sata(hwif);
771 771
772 hwif->set_pio_mode = &sil_set_pio_mode;
773 hwif->set_dma_mode = &sil_set_dma_mode;
774 hwif->quirkproc = &sil_quirkproc;
775
776 if (sata) { 772 if (sata) {
777 static int first = 1; 773 static int first = 1;
778 774
779 hwif->reset_poll = &sil_sata_reset_poll;
780 hwif->pre_reset = &sil_sata_pre_reset;
781 hwif->udma_filter = &sil_sata_udma_filter;
782
783 if (first) { 775 if (first) {
784 printk(KERN_INFO "siimage: For full SATA support you should use the libata sata_sil module.\n"); 776 printk(KERN_INFO "siimage: For full SATA support you should use the libata sata_sil module.\n");
785 first = 0; 777 first = 0;
786 } 778 }
787 } else 779 }
788 hwif->udma_filter = &sil_pata_udma_filter;
789
790 hwif->cable_detect = ata66_siimage;
791 780
792 if (hwif->dma_base == 0) 781 if (hwif->dma_base == 0)
793 return; 782 return;
@@ -802,21 +791,40 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
802 } 791 }
803} 792}
804 793
805#define DECLARE_SII_DEV(name_str) \ 794static const struct ide_port_ops sil_pata_port_ops = {
795 .set_pio_mode = sil_set_pio_mode,
796 .set_dma_mode = sil_set_dma_mode,
797 .quirkproc = sil_quirkproc,
798 .udma_filter = sil_pata_udma_filter,
799 .cable_detect = sil_cable_detect,
800};
801
802static const struct ide_port_ops sil_sata_port_ops = {
803 .set_pio_mode = sil_set_pio_mode,
804 .set_dma_mode = sil_set_dma_mode,
805 .reset_poll = sil_sata_reset_poll,
806 .pre_reset = sil_sata_pre_reset,
807 .quirkproc = sil_quirkproc,
808 .udma_filter = sil_sata_udma_filter,
809 .cable_detect = sil_cable_detect,
810};
811
812#define DECLARE_SII_DEV(name_str, p_ops) \
806 { \ 813 { \
807 .name = name_str, \ 814 .name = name_str, \
808 .init_chipset = init_chipset_siimage, \ 815 .init_chipset = init_chipset_siimage, \
809 .init_iops = init_iops_siimage, \ 816 .init_iops = init_iops_siimage, \
810 .init_hwif = init_hwif_siimage, \ 817 .init_hwif = init_hwif_siimage, \
818 .port_ops = p_ops, \
811 .pio_mask = ATA_PIO4, \ 819 .pio_mask = ATA_PIO4, \
812 .mwdma_mask = ATA_MWDMA2, \ 820 .mwdma_mask = ATA_MWDMA2, \
813 .udma_mask = ATA_UDMA6, \ 821 .udma_mask = ATA_UDMA6, \
814 } 822 }
815 823
816static const struct ide_port_info siimage_chipsets[] __devinitdata = { 824static const struct ide_port_info siimage_chipsets[] __devinitdata = {
817 /* 0 */ DECLARE_SII_DEV("SiI680"), 825 /* 0 */ DECLARE_SII_DEV("SiI680", &sil_pata_port_ops),
818 /* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA"), 826 /* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA", &sil_sata_port_ops),
819 /* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA") 827 /* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA", &sil_sata_port_ops)
820}; 828};
821 829
822/** 830/**
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 181b647e5ca9..4b0b85d8faf5 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -347,7 +347,7 @@ static void sis_set_dma_mode(ide_drive_t *drive, const u8 speed)
347 sis_program_timings(drive, speed); 347 sis_program_timings(drive, speed);
348} 348}
349 349
350static u8 sis5513_ata133_udma_filter(ide_drive_t *drive) 350static u8 sis_ata133_udma_filter(ide_drive_t *drive)
351{ 351{
352 struct pci_dev *dev = to_pci_dev(drive->hwif->dev); 352 struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
353 u32 regdw = 0; 353 u32 regdw = 0;
@@ -514,7 +514,7 @@ static const struct sis_laptop sis_laptop[] = {
514 { 0, } 514 { 0, }
515}; 515};
516 516
517static u8 __devinit ata66_sis5513(ide_hwif_t *hwif) 517static u8 __devinit sis_cable_detect(ide_hwif_t *hwif)
518{ 518{
519 struct pci_dev *pdev = to_pci_dev(hwif->dev); 519 struct pci_dev *pdev = to_pci_dev(hwif->dev);
520 const struct sis_laptop *lap = &sis_laptop[0]; 520 const struct sis_laptop *lap = &sis_laptop[0];
@@ -543,21 +543,22 @@ static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)
543 return ata66 ? ATA_CBL_PATA80 : ATA_CBL_PATA40; 543 return ata66 ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
544} 544}
545 545
546static void __devinit init_hwif_sis5513(ide_hwif_t *hwif) 546static const struct ide_port_ops sis_port_ops = {
547{ 547 .set_pio_mode = sis_set_pio_mode,
548 hwif->set_pio_mode = &sis_set_pio_mode; 548 .set_dma_mode = sis_set_dma_mode,
549 hwif->set_dma_mode = &sis_set_dma_mode; 549 .cable_detect = sis_cable_detect,
550 550};
551 if (chipset_family >= ATA_133)
552 hwif->udma_filter = sis5513_ata133_udma_filter;
553 551
554 hwif->cable_detect = ata66_sis5513; 552static const struct ide_port_ops sis_ata133_port_ops = {
555} 553 .set_pio_mode = sis_set_pio_mode,
554 .set_dma_mode = sis_set_dma_mode,
555 .udma_filter = sis_ata133_udma_filter,
556 .cable_detect = sis_cable_detect,
557};
556 558
557static const struct ide_port_info sis5513_chipset __devinitdata = { 559static const struct ide_port_info sis5513_chipset __devinitdata = {
558 .name = "SIS5513", 560 .name = "SIS5513",
559 .init_chipset = init_chipset_sis5513, 561 .init_chipset = init_chipset_sis5513,
560 .init_hwif = init_hwif_sis5513,
561 .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} }, 562 .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} },
562 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_NO_AUTODMA, 563 .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_NO_AUTODMA,
563 .pio_mask = ATA_PIO4, 564 .pio_mask = ATA_PIO4,
@@ -572,6 +573,11 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi
572 if (sis_find_family(dev) == 0) 573 if (sis_find_family(dev) == 0)
573 return -ENOTSUPP; 574 return -ENOTSUPP;
574 575
576 if (chipset_family >= ATA_133)
577 d.port_ops = &sis_ata133_port_ops;
578 else
579 d.port_ops = &sis_port_ops;
580
575 d.udma_mask = udma_rates[chipset_family]; 581 d.udma_mask = udma_rates[chipset_family];
576 582
577 return ide_setup_pci_device(dev, &d); 583 return ide_setup_pci_device(dev, &d);
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 40b3eeb2d847..66817fe1eeae 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -292,10 +292,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
292 292
293 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); 293 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));
294 294
295 hwif->set_pio_mode = &sl82c105_set_pio_mode;
296 hwif->set_dma_mode = &sl82c105_set_dma_mode;
297 hwif->resetproc = &sl82c105_resetproc;
298
299 if (!hwif->dma_base) 295 if (!hwif->dma_base)
300 return; 296 return;
301 297
@@ -321,11 +317,18 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
321 hwif->serialized = hwif->mate->serialized = 1; 317 hwif->serialized = hwif->mate->serialized = 1;
322} 318}
323 319
320static const struct ide_port_ops sl82c105_port_ops = {
321 .set_pio_mode = sl82c105_set_pio_mode,
322 .set_dma_mode = sl82c105_set_dma_mode,
323 .resetproc = sl82c105_resetproc,
324};
325
324static const struct ide_port_info sl82c105_chipset __devinitdata = { 326static const struct ide_port_info sl82c105_chipset __devinitdata = {
325 .name = "W82C105", 327 .name = "W82C105",
326 .init_chipset = init_chipset_sl82c105, 328 .init_chipset = init_chipset_sl82c105,
327 .init_hwif = init_hwif_sl82c105, 329 .init_hwif = init_hwif_sl82c105,
328 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, 330 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
331 .port_ops = &sl82c105_port_ops,
329 .host_flags = IDE_HFLAG_IO_32BIT | 332 .host_flags = IDE_HFLAG_IO_32BIT |
330 IDE_HFLAG_UNMASK_IRQS | 333 IDE_HFLAG_UNMASK_IRQS |
331/* FIXME: check for Compatibility mode in generic IDE PCI code */ 334/* FIXME: check for Compatibility mode in generic IDE PCI code */
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index eab557c45d1b..dae6e2c94d86 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -125,18 +125,16 @@ static u8 __devinit slc90e66_cable_detect(ide_hwif_t *hwif)
125 return (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 125 return (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
126} 126}
127 127
128static void __devinit init_hwif_slc90e66(ide_hwif_t *hwif) 128static const struct ide_port_ops slc90e66_port_ops = {
129{ 129 .set_pio_mode = slc90e66_set_pio_mode,
130 hwif->set_pio_mode = &slc90e66_set_pio_mode; 130 .set_dma_mode = slc90e66_set_dma_mode,
131 hwif->set_dma_mode = &slc90e66_set_dma_mode; 131 .cable_detect = slc90e66_cable_detect,
132 132};
133 hwif->cable_detect = slc90e66_cable_detect;
134}
135 133
136static const struct ide_port_info slc90e66_chipset __devinitdata = { 134static const struct ide_port_info slc90e66_chipset __devinitdata = {
137 .name = "SLC90E66", 135 .name = "SLC90E66",
138 .init_hwif = init_hwif_slc90e66,
139 .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} }, 136 .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} },
137 .port_ops = &slc90e66_port_ops,
140 .host_flags = IDE_HFLAG_LEGACY_IRQS, 138 .host_flags = IDE_HFLAG_LEGACY_IRQS,
141 .pio_mask = ATA_PIO4, 139 .pio_mask = ATA_PIO4,
142 .swdma_mask = ATA_SWDMA2_ONLY, 140 .swdma_mask = ATA_SWDMA2_ONLY,
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index c15435182e3c..14ce400a0eaf 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -157,11 +157,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
157 /* Store the system control register base for convenience... */ 157 /* Store the system control register base for convenience... */
158 hwif->config_data = sc_base; 158 hwif->config_data = sc_base;
159 159
160 hwif->set_pio_mode = &tc86c001_set_pio_mode;
161 hwif->set_dma_mode = &tc86c001_set_mode;
162
163 hwif->cable_detect = tc86c001_cable_detect;
164
165 if (!hwif->dma_base) 160 if (!hwif->dma_base)
166 return; 161 return;
167 162
@@ -187,10 +182,17 @@ static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev,
187 return err; 182 return err;
188} 183}
189 184
185static const struct ide_port_ops tc86c001_port_ops = {
186 .set_pio_mode = tc86c001_set_pio_mode,
187 .set_dma_mode = tc86c001_set_mode,
188 .cable_detect = tc86c001_cable_detect,
189};
190
190static const struct ide_port_info tc86c001_chipset __devinitdata = { 191static const struct ide_port_info tc86c001_chipset __devinitdata = {
191 .name = "TC86C001", 192 .name = "TC86C001",
192 .init_chipset = init_chipset_tc86c001, 193 .init_chipset = init_chipset_tc86c001,
193 .init_hwif = init_hwif_tc86c001, 194 .init_hwif = init_hwif_tc86c001,
195 .port_ops = &tc86c001_port_ops,
194 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD | 196 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_OFF_BOARD |
195 IDE_HFLAG_ABUSE_SET_DMA_MODE, 197 IDE_HFLAG_ABUSE_SET_DMA_MODE,
196 .pio_mask = ATA_PIO4, 198 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index 3316b197c779..db65a558d4ec 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -87,16 +87,15 @@ static void triflex_set_pio_mode(ide_drive_t *drive, const u8 pio)
87 triflex_set_mode(drive, XFER_PIO_0 + pio); 87 triflex_set_mode(drive, XFER_PIO_0 + pio);
88} 88}
89 89
90static void __devinit init_hwif_triflex(ide_hwif_t *hwif) 90static const struct ide_port_ops triflex_port_ops = {
91{ 91 .set_pio_mode = triflex_set_pio_mode,
92 hwif->set_pio_mode = &triflex_set_pio_mode; 92 .set_dma_mode = triflex_set_mode,
93 hwif->set_dma_mode = &triflex_set_mode; 93};
94}
95 94
96static const struct ide_port_info triflex_device __devinitdata = { 95static const struct ide_port_info triflex_device __devinitdata = {
97 .name = "TRIFLEX", 96 .name = "TRIFLEX",
98 .init_hwif = init_hwif_triflex,
99 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, 97 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
98 .port_ops = &triflex_port_ops,
100 .pio_mask = ATA_PIO4, 99 .pio_mask = ATA_PIO4,
101 .swdma_mask = ATA_SWDMA2, 100 .swdma_mask = ATA_SWDMA2,
102 .mwdma_mask = ATA_MWDMA2, 101 .mwdma_mask = ATA_MWDMA2,
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index 2b8f3a2837d7..47265030f87d 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -297,8 +297,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
297 hwif->dma_start = &trm290_dma_start; 297 hwif->dma_start = &trm290_dma_start;
298 hwif->ide_dma_end = &trm290_ide_dma_end; 298 hwif->ide_dma_end = &trm290_ide_dma_end;
299 hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; 299 hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
300
301 hwif->selectproc = &trm290_selectproc;
302#if 1 300#if 1
303 { 301 {
304 /* 302 /*
@@ -328,10 +326,15 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
328#endif 326#endif
329} 327}
330 328
329static const struct ide_port_ops trm290_port_ops = {
330 .selectproc = trm290_selectproc,
331};
332
331static const struct ide_port_info trm290_chipset __devinitdata = { 333static const struct ide_port_info trm290_chipset __devinitdata = {
332 .name = "TRM290", 334 .name = "TRM290",
333 .init_hwif = init_hwif_trm290, 335 .init_hwif = init_hwif_trm290,
334 .chipset = ide_trm290, 336 .chipset = ide_trm290,
337 .port_ops = &trm290_port_ops,
335 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 338 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
336#if 0 /* play it safe for now */ 339#if 0 /* play it safe for now */
337 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 340 IDE_HFLAG_TRUST_BIOS_FOR_DMA |
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index cff3cafedc47..bbd17bec6ffe 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -415,19 +415,17 @@ static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
415 return ATA_CBL_PATA40; 415 return ATA_CBL_PATA40;
416} 416}
417 417
418static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) 418static const struct ide_port_ops via_port_ops = {
419{ 419 .set_pio_mode = via_set_pio_mode,
420 hwif->set_pio_mode = &via_set_pio_mode; 420 .set_dma_mode = via_set_drive,
421 hwif->set_dma_mode = &via_set_drive; 421 .cable_detect = via82cxxx_cable_detect,
422 422};
423 hwif->cable_detect = via82cxxx_cable_detect;
424}
425 423
426static const struct ide_port_info via82cxxx_chipset __devinitdata = { 424static const struct ide_port_info via82cxxx_chipset __devinitdata = {
427 .name = "VP_IDE", 425 .name = "VP_IDE",
428 .init_chipset = init_chipset_via82cxxx, 426 .init_chipset = init_chipset_via82cxxx,
429 .init_hwif = init_hwif_via82cxxx,
430 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } }, 427 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
428 .port_ops = &via_port_ops,
431 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | 429 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST |
432 IDE_HFLAG_ABUSE_SET_DMA_MODE | 430 IDE_HFLAG_ABUSE_SET_DMA_MODE |
433 IDE_HFLAG_POST_SET_MODE | 431 IDE_HFLAG_POST_SET_MODE |