aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 8332e97a9de3..bb18415d3d63 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -87,6 +87,7 @@ const struct ata_port_operations ata_bmdma32_port_ops = {
87 .inherits = &ata_bmdma_port_ops, 87 .inherits = &ata_bmdma_port_ops,
88 88
89 .sff_data_xfer = ata_sff_data_xfer32, 89 .sff_data_xfer = ata_sff_data_xfer32,
90 .port_start = ata_sff_port_start32,
90}; 91};
91EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); 92EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops);
92 93
@@ -769,6 +770,9 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf,
769 void __iomem *data_addr = ap->ioaddr.data_addr; 770 void __iomem *data_addr = ap->ioaddr.data_addr;
770 unsigned int words = buflen >> 2; 771 unsigned int words = buflen >> 2;
771 int slop = buflen & 3; 772 int slop = buflen & 3;
773
774 if (!(ap->pflags & ATA_PFLAG_PIO32))
775 return ata_sff_data_xfer(dev, buf, buflen, rw);
772 776
773 /* Transfer multiple of 4 bytes */ 777 /* Transfer multiple of 4 bytes */
774 if (rw == READ) 778 if (rw == READ)
@@ -2402,6 +2406,29 @@ int ata_sff_port_start(struct ata_port *ap)
2402EXPORT_SYMBOL_GPL(ata_sff_port_start); 2406EXPORT_SYMBOL_GPL(ata_sff_port_start);
2403 2407
2404/** 2408/**
2409 * ata_sff_port_start32 - Set port up for dma.
2410 * @ap: Port to initialize
2411 *
2412 * Called just after data structures for each port are
2413 * initialized. Allocates space for PRD table if the device
2414 * is DMA capable SFF.
2415 *
2416 * May be used as the port_start() entry in ata_port_operations for
2417 * devices that are capable of 32bit PIO.
2418 *
2419 * LOCKING:
2420 * Inherited from caller.
2421 */
2422int ata_sff_port_start32(struct ata_port *ap)
2423{
2424 ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
2425 if (ap->ioaddr.bmdma_addr)
2426 return ata_port_start(ap);
2427 return 0;
2428}
2429EXPORT_SYMBOL_GPL(ata_sff_port_start32);
2430
2431/**
2405 * ata_sff_std_ports - initialize ioaddr with standard port offsets. 2432 * ata_sff_std_ports - initialize ioaddr with standard port offsets.
2406 * @ioaddr: IO address structure to be initialized 2433 * @ioaddr: IO address structure to be initialized
2407 * 2434 *