aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_legacy.c')
-rw-r--r--drivers/ata/pata_legacy.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 3f830f0fe2cc..f72c6c5b820f 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -108,6 +108,7 @@ struct legacy_controller {
108 struct ata_port_operations *ops; 108 struct ata_port_operations *ops;
109 unsigned int pio_mask; 109 unsigned int pio_mask;
110 unsigned int flags; 110 unsigned int flags;
111 unsigned int pflags;
111 int (*setup)(struct platform_device *, struct legacy_probe *probe, 112 int (*setup)(struct platform_device *, struct legacy_probe *probe,
112 struct legacy_data *data); 113 struct legacy_data *data);
113}; 114};
@@ -284,9 +285,11 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
284 unsigned char *buf, unsigned int buflen, int rw) 285 unsigned char *buf, unsigned int buflen, int rw)
285{ 286{
286 int slop = buflen & 3; 287 int slop = buflen & 3;
288 struct ata_port *ap = dev->link->ap;
289
287 /* 32bit I/O capable *and* we need to write a whole number of dwords */ 290 /* 32bit I/O capable *and* we need to write a whole number of dwords */
288 if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) { 291 if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)
289 struct ata_port *ap = dev->link->ap; 292 && (ap->pflags & ATA_PFLAG_PIO32)) {
290 unsigned long flags; 293 unsigned long flags;
291 294
292 local_irq_save(flags); 295 local_irq_save(flags);
@@ -736,7 +739,8 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
736 struct ata_port *ap = adev->link->ap; 739 struct ata_port *ap = adev->link->ap;
737 int slop = buflen & 3; 740 int slop = buflen & 3;
738 741
739 if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) { 742 if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)
743 && (ap->pflags & ATA_PFLAG_PIO32)) {
740 if (rw == WRITE) 744 if (rw == WRITE)
741 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); 745 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
742 else 746 else
@@ -858,27 +862,30 @@ static struct ata_port_operations winbond_port_ops = {
858 862
859static struct legacy_controller controllers[] = { 863static struct legacy_controller controllers[] = {
860 {"BIOS", &legacy_port_ops, 0x1F, 864 {"BIOS", &legacy_port_ops, 0x1F,
861 ATA_FLAG_NO_IORDY, NULL }, 865 ATA_FLAG_NO_IORDY, 0, NULL },
862 {"Snooping", &simple_port_ops, 0x1F, 866 {"Snooping", &simple_port_ops, 0x1F,
863 0 , NULL }, 867 0, 0, NULL },
864 {"PDC20230", &pdc20230_port_ops, 0x7, 868 {"PDC20230", &pdc20230_port_ops, 0x7,
865 ATA_FLAG_NO_IORDY, NULL }, 869 ATA_FLAG_NO_IORDY,
870 ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE, NULL },
866 {"HT6560A", &ht6560a_port_ops, 0x07, 871 {"HT6560A", &ht6560a_port_ops, 0x07,
867 ATA_FLAG_NO_IORDY, NULL }, 872 ATA_FLAG_NO_IORDY, 0, NULL },
868 {"HT6560B", &ht6560b_port_ops, 0x1F, 873 {"HT6560B", &ht6560b_port_ops, 0x1F,
869 ATA_FLAG_NO_IORDY, NULL }, 874 ATA_FLAG_NO_IORDY, 0, NULL },
870 {"OPTI82C611A", &opti82c611a_port_ops, 0x0F, 875 {"OPTI82C611A", &opti82c611a_port_ops, 0x0F,
871 0 , NULL }, 876 0, 0, NULL },
872 {"OPTI82C46X", &opti82c46x_port_ops, 0x0F, 877 {"OPTI82C46X", &opti82c46x_port_ops, 0x0F,
873 0 , NULL }, 878 0, 0, NULL },
874 {"QDI6500", &qdi6500_port_ops, 0x07, 879 {"QDI6500", &qdi6500_port_ops, 0x07,
875 ATA_FLAG_NO_IORDY, qdi_port }, 880 ATA_FLAG_NO_IORDY,
881 ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE, qdi_port },
876 {"QDI6580", &qdi6580_port_ops, 0x1F, 882 {"QDI6580", &qdi6580_port_ops, 0x1F,
877 0 , qdi_port }, 883 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE, qdi_port },
878 {"QDI6580DP", &qdi6580dp_port_ops, 0x1F, 884 {"QDI6580DP", &qdi6580dp_port_ops, 0x1F,
879 0 , qdi_port }, 885 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE, qdi_port },
880 {"W83759A", &winbond_port_ops, 0x1F, 886 {"W83759A", &winbond_port_ops, 0x1F,
881 0 , winbond_port } 887 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE,
888 winbond_port }
882}; 889};
883 890
884/** 891/**
@@ -1008,6 +1015,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
1008 ap->ops = ops; 1015 ap->ops = ops;
1009 ap->pio_mask = pio_modes; 1016 ap->pio_mask = pio_modes;
1010 ap->flags |= ATA_FLAG_SLAVE_POSS | iordy; 1017 ap->flags |= ATA_FLAG_SLAVE_POSS | iordy;
1018 ap->pflags |= controller->pflags;
1011 ap->ioaddr.cmd_addr = io_addr; 1019 ap->ioaddr.cmd_addr = io_addr;
1012 ap->ioaddr.altstatus_addr = ctrl_addr; 1020 ap->ioaddr.altstatus_addr = ctrl_addr;
1013 ap->ioaddr.ctl_addr = ctrl_addr; 1021 ap->ioaddr.ctl_addr = ctrl_addr;
@@ -1032,6 +1040,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
1032 return 0; 1040 return 0;
1033 } 1041 }
1034 } 1042 }
1043 ata_host_detach(host);
1035fail: 1044fail:
1036 platform_device_unregister(pdev); 1045 platform_device_unregister(pdev);
1037 return ret; 1046 return ret;