aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cypress.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_cypress.c')
-rw-r--r--drivers/ata/pata_cypress.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c
index 322043d8cf7f..fd55474e0d15 100644
--- a/drivers/ata/pata_cypress.c
+++ b/drivers/ata/pata_cypress.c
@@ -7,7 +7,7 @@
7 * linux/drivers/ide/pci/cy82c693.c Version 0.40 Sep. 10, 2002 7 * linux/drivers/ide/pci/cy82c693.c Version 0.40 Sep. 10, 2002
8 * 8 *
9 */ 9 */
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
@@ -59,7 +59,7 @@ static void cy82c693_error_handler(struct ata_port *ap)
59 * 59 *
60 * Called to do the PIO mode setup. 60 * Called to do the PIO mode setup.
61 */ 61 */
62 62
63static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev) 63static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)
64{ 64{
65 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 65 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -67,7 +67,7 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)
67 const unsigned long T = 1000000 / 33; 67 const unsigned long T = 1000000 / 33;
68 short time_16, time_8; 68 short time_16, time_8;
69 u32 addr; 69 u32 addr;
70 70
71 if (ata_timing_compute(adev, adev->pio_mode, &t, T, 1) < 0) { 71 if (ata_timing_compute(adev, adev->pio_mode, &t, T, 1) < 0) {
72 printk(KERN_ERR DRV_NAME ": mome computation failed.\n"); 72 printk(KERN_ERR DRV_NAME ": mome computation failed.\n");
73 return; 73 return;
@@ -75,20 +75,20 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)
75 75
76 time_16 = FIT(t.recover, 0, 15) | (FIT(t.active, 0, 15) << 4); 76 time_16 = FIT(t.recover, 0, 15) | (FIT(t.active, 0, 15) << 4);
77 time_8 = FIT(t.act8b, 0, 15) | (FIT(t.rec8b, 0, 15) << 4); 77 time_8 = FIT(t.act8b, 0, 15) | (FIT(t.rec8b, 0, 15) << 4);
78 78
79 if (adev->devno == 0) { 79 if (adev->devno == 0) {
80 pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); 80 pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr);
81 81
82 addr &= ~0x0F; /* Mask bits */ 82 addr &= ~0x0F; /* Mask bits */
83 addr |= FIT(t.setup, 0, 15); 83 addr |= FIT(t.setup, 0, 15);
84 84
85 pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr); 85 pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr);
86 pci_write_config_byte(pdev, CY82_IDE_MASTER_IOR, time_16); 86 pci_write_config_byte(pdev, CY82_IDE_MASTER_IOR, time_16);
87 pci_write_config_byte(pdev, CY82_IDE_MASTER_IOW, time_16); 87 pci_write_config_byte(pdev, CY82_IDE_MASTER_IOW, time_16);
88 pci_write_config_byte(pdev, CY82_IDE_MASTER_8BIT, time_8); 88 pci_write_config_byte(pdev, CY82_IDE_MASTER_8BIT, time_8);
89 } else { 89 } else {
90 pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); 90 pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr);
91 91
92 addr &= ~0xF0; /* Mask bits */ 92 addr &= ~0xF0; /* Mask bits */
93 addr |= (FIT(t.setup, 0, 15) << 4); 93 addr |= (FIT(t.setup, 0, 15) << 4);
94 94
@@ -106,15 +106,15 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)
106 * 106 *
107 * Called to do the DMA mode setup. 107 * Called to do the DMA mode setup.
108 */ 108 */
109 109
110static void cy82c693_set_dmamode(struct ata_port *ap, struct ata_device *adev) 110static void cy82c693_set_dmamode(struct ata_port *ap, struct ata_device *adev)
111{ 111{
112 int reg = CY82_INDEX_CHANNEL0 + ap->port_no; 112 int reg = CY82_INDEX_CHANNEL0 + ap->port_no;
113 113
114 /* Be afraid, be very afraid. Magic registers in low I/O space */ 114 /* Be afraid, be very afraid. Magic registers in low I/O space */
115 outb(reg, 0x22); 115 outb(reg, 0x22);
116 outb(adev->dma_mode - XFER_MW_DMA_0, 0x23); 116 outb(adev->dma_mode - XFER_MW_DMA_0, 0x23);
117 117
118 /* 0x50 gives the best behaviour on the Alpha's using this chip */ 118 /* 0x50 gives the best behaviour on the Alpha's using this chip */
119 outb(CY82_INDEX_TIMEOUT, 0x22); 119 outb(CY82_INDEX_TIMEOUT, 0x22);
120 outb(0x50, 0x23); 120 outb(0x50, 0x23);
@@ -143,7 +143,7 @@ static struct ata_port_operations cy82c693_port_ops = {
143 .set_piomode = cy82c693_set_piomode, 143 .set_piomode = cy82c693_set_piomode,
144 .set_dmamode = cy82c693_set_dmamode, 144 .set_dmamode = cy82c693_set_dmamode,
145 .mode_filter = ata_pci_default_filter, 145 .mode_filter = ata_pci_default_filter,
146 146
147 .tf_load = ata_tf_load, 147 .tf_load = ata_tf_load,
148 .tf_read = ata_tf_read, 148 .tf_read = ata_tf_read,
149 .check_status = ata_check_status, 149 .check_status = ata_check_status,
@@ -167,11 +167,11 @@ static struct ata_port_operations cy82c693_port_ops = {
167 167
168 .irq_handler = ata_interrupt, 168 .irq_handler = ata_interrupt,
169 .irq_clear = ata_bmdma_irq_clear, 169 .irq_clear = ata_bmdma_irq_clear,
170 170
171 .port_start = ata_port_start, 171 .port_start = ata_port_start,
172 .port_stop = ata_port_stop, 172 .port_stop = ata_port_stop,
173 .host_stop = ata_host_stop 173 .host_stop = ata_host_stop
174}; 174};
175 175
176static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 176static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
177{ 177{
@@ -183,13 +183,13 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i
183 .port_ops = &cy82c693_port_ops 183 .port_ops = &cy82c693_port_ops
184 }; 184 };
185 static struct ata_port_info *port_info[1] = { &info }; 185 static struct ata_port_info *port_info[1] = { &info };
186 186
187 /* Devfn 1 is the ATA primary. The secondary is magic and on devfn2. For the 187 /* Devfn 1 is the ATA primary. The secondary is magic and on devfn2. For the
188 moment we don't handle the secondary. FIXME */ 188 moment we don't handle the secondary. FIXME */
189 189
190 if (PCI_FUNC(pdev->devfn) != 1) 190 if (PCI_FUNC(pdev->devfn) != 1)
191 return -ENODEV; 191 return -ENODEV;
192 192
193 return ata_pci_init_one(pdev, port_info, 1); 193 return ata_pci_init_one(pdev, port_info, 1);
194} 194}
195 195