diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
commit | ac95beedf8bc97b24f9540d4da9952f07221c023 (patch) | |
tree | c29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/hpt366.c | |
parent | 4a27214d7be31e122db4102166f49ec15958e8e9 (diff) |
ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to
'struct ide_port_ops'.
* Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
and ide_hwif_t.
* Update host drivers and core code accordingly.
While at it:
* Rename ata66_*() cable detect functions to *_cable_detect() to match
the standard naming. (Suggested by Sergei Shtylyov)
v2:
* Fix build for bast-ide. (Noticed by Andrew Morton)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 27 |
1 files changed, 16 insertions, 11 deletions
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 | ||
1408 | static 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 | |||
1419 | static const struct ide_port_info hpt366_chipsets[] __devinitdata = { | 1418 | static 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, |