aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_sil680.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_sil680.c')
-rw-r--r--drivers/ata/pata_sil680.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index ed79fabe025c..1cb67b221c28 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -33,7 +33,7 @@
33#include <linux/libata.h> 33#include <linux/libata.h>
34 34
35#define DRV_NAME "pata_sil680" 35#define DRV_NAME "pata_sil680"
36#define DRV_VERSION "0.4.1" 36#define DRV_VERSION "0.4.5"
37 37
38/** 38/**
39 * sil680_selreg - return register base 39 * sil680_selreg - return register base
@@ -139,10 +139,13 @@ static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev)
139 139
140 unsigned long tfaddr = sil680_selreg(ap, 0x02); 140 unsigned long tfaddr = sil680_selreg(ap, 0x02);
141 unsigned long addr = sil680_seldev(ap, adev, 0x04); 141 unsigned long addr = sil680_seldev(ap, adev, 0x04);
142 unsigned long addr_mask = 0x80 + 4 * ap->port_no;
142 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 143 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
143 int pio = adev->pio_mode - XFER_PIO_0; 144 int pio = adev->pio_mode - XFER_PIO_0;
144 int lowest_pio = pio; 145 int lowest_pio = pio;
146 int port_shift = 4 * adev->devno;
145 u16 reg; 147 u16 reg;
148 u8 mode;
146 149
147 struct ata_device *pair = ata_dev_pair(adev); 150 struct ata_device *pair = ata_dev_pair(adev);
148 151
@@ -153,10 +156,17 @@ static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev)
153 pci_write_config_word(pdev, tfaddr, speed_t[lowest_pio]); 156 pci_write_config_word(pdev, tfaddr, speed_t[lowest_pio]);
154 157
155 pci_read_config_word(pdev, tfaddr-2, &reg); 158 pci_read_config_word(pdev, tfaddr-2, &reg);
159 pci_read_config_byte(pdev, addr_mask, &mode);
160
156 reg &= ~0x0200; /* Clear IORDY */ 161 reg &= ~0x0200; /* Clear IORDY */
157 if (ata_pio_need_iordy(adev)) 162 mode &= ~(3 << port_shift); /* Clear IORDY and DMA bits */
163
164 if (ata_pio_need_iordy(adev)) {
158 reg |= 0x0200; /* Enable IORDY */ 165 reg |= 0x0200; /* Enable IORDY */
166 mode |= 1 << port_shift;
167 }
159 pci_write_config_word(pdev, tfaddr-2, reg); 168 pci_write_config_word(pdev, tfaddr-2, reg);
169 pci_write_config_byte(pdev, addr_mask, mode);
160} 170}
161 171
162/** 172/**