diff options
Diffstat (limited to 'drivers/ata/pata_amd.c')
-rw-r--r-- | drivers/ata/pata_amd.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 04048fcf6305..c5779ad4abca 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c | |||
@@ -119,27 +119,28 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse | |||
119 | } | 119 | } |
120 | 120 | ||
121 | /** | 121 | /** |
122 | * amd_probe_init - perform reset handling | 122 | * amd_pre_reset - perform reset handling |
123 | * @ap: ATA port | 123 | * @link: ATA link |
124 | * @deadline: deadline jiffies for the operation | 124 | * @deadline: deadline jiffies for the operation |
125 | * | 125 | * |
126 | * Reset sequence checking enable bits to see which ports are | 126 | * Reset sequence checking enable bits to see which ports are |
127 | * active. | 127 | * active. |
128 | */ | 128 | */ |
129 | 129 | ||
130 | static int amd_pre_reset(struct ata_port *ap, unsigned long deadline) | 130 | static int amd_pre_reset(struct ata_link *link, unsigned long deadline) |
131 | { | 131 | { |
132 | static const struct pci_bits amd_enable_bits[] = { | 132 | static const struct pci_bits amd_enable_bits[] = { |
133 | { 0x40, 1, 0x02, 0x02 }, | 133 | { 0x40, 1, 0x02, 0x02 }, |
134 | { 0x40, 1, 0x01, 0x01 } | 134 | { 0x40, 1, 0x01, 0x01 } |
135 | }; | 135 | }; |
136 | 136 | ||
137 | struct ata_port *ap = link->ap; | ||
137 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 138 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
138 | 139 | ||
139 | if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no])) | 140 | if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no])) |
140 | return -ENOENT; | 141 | return -ENOENT; |
141 | 142 | ||
142 | return ata_std_prereset(ap, deadline); | 143 | return ata_std_prereset(link, deadline); |
143 | } | 144 | } |
144 | 145 | ||
145 | static void amd_error_handler(struct ata_port *ap) | 146 | static void amd_error_handler(struct ata_port *ap) |
@@ -221,25 +222,26 @@ static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
221 | 222 | ||
222 | /** | 223 | /** |
223 | * nv_probe_init - cable detection | 224 | * nv_probe_init - cable detection |
224 | * @ap: ATA port | 225 | * @lin: ATA link |
225 | * | 226 | * |
226 | * Perform cable detection. The BIOS stores this in PCI config | 227 | * Perform cable detection. The BIOS stores this in PCI config |
227 | * space for us. | 228 | * space for us. |
228 | */ | 229 | */ |
229 | 230 | ||
230 | static int nv_pre_reset(struct ata_port *ap, unsigned long deadline) | 231 | static int nv_pre_reset(struct ata_link *link, unsigned long deadline) |
231 | { | 232 | { |
232 | static const struct pci_bits nv_enable_bits[] = { | 233 | static const struct pci_bits nv_enable_bits[] = { |
233 | { 0x50, 1, 0x02, 0x02 }, | 234 | { 0x50, 1, 0x02, 0x02 }, |
234 | { 0x50, 1, 0x01, 0x01 } | 235 | { 0x50, 1, 0x01, 0x01 } |
235 | }; | 236 | }; |
236 | 237 | ||
238 | struct ata_port *ap = link->ap; | ||
237 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 239 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
238 | 240 | ||
239 | if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) | 241 | if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) |
240 | return -ENOENT; | 242 | return -ENOENT; |
241 | 243 | ||
242 | return ata_std_prereset(ap, deadline); | 244 | return ata_std_prereset(link, deadline); |
243 | } | 245 | } |
244 | 246 | ||
245 | static void nv_error_handler(struct ata_port *ap) | 247 | static void nv_error_handler(struct ata_port *ap) |
@@ -268,6 +270,9 @@ static int nv_cable_detect(struct ata_port *ap) | |||
268 | pci_read_config_word(pdev, 0x62 - 2 * ap->port_no, &udma); | 270 | pci_read_config_word(pdev, 0x62 - 2 * ap->port_no, &udma); |
269 | if ((udma & 0xC4) == 0xC4 || (udma & 0xC400) == 0xC400) | 271 | if ((udma & 0xC4) == 0xC4 || (udma & 0xC400) == 0xC400) |
270 | cbl = ATA_CBL_PATA80; | 272 | cbl = ATA_CBL_PATA80; |
273 | /* And a triple check across suspend/resume with ACPI around */ | ||
274 | if (ata_acpi_cbl_80wire(ap)) | ||
275 | cbl = ATA_CBL_PATA80; | ||
271 | return cbl; | 276 | return cbl; |
272 | } | 277 | } |
273 | 278 | ||
@@ -327,7 +332,6 @@ static struct scsi_host_template amd_sht = { | |||
327 | }; | 332 | }; |
328 | 333 | ||
329 | static struct ata_port_operations amd33_port_ops = { | 334 | static struct ata_port_operations amd33_port_ops = { |
330 | .port_disable = ata_port_disable, | ||
331 | .set_piomode = amd33_set_piomode, | 335 | .set_piomode = amd33_set_piomode, |
332 | .set_dmamode = amd33_set_dmamode, | 336 | .set_dmamode = amd33_set_dmamode, |
333 | .mode_filter = ata_pci_default_filter, | 337 | .mode_filter = ata_pci_default_filter, |
@@ -356,13 +360,11 @@ static struct ata_port_operations amd33_port_ops = { | |||
356 | .irq_handler = ata_interrupt, | 360 | .irq_handler = ata_interrupt, |
357 | .irq_clear = ata_bmdma_irq_clear, | 361 | .irq_clear = ata_bmdma_irq_clear, |
358 | .irq_on = ata_irq_on, | 362 | .irq_on = ata_irq_on, |
359 | .irq_ack = ata_irq_ack, | ||
360 | 363 | ||
361 | .port_start = ata_port_start, | 364 | .port_start = ata_sff_port_start, |
362 | }; | 365 | }; |
363 | 366 | ||
364 | static struct ata_port_operations amd66_port_ops = { | 367 | static struct ata_port_operations amd66_port_ops = { |
365 | .port_disable = ata_port_disable, | ||
366 | .set_piomode = amd66_set_piomode, | 368 | .set_piomode = amd66_set_piomode, |
367 | .set_dmamode = amd66_set_dmamode, | 369 | .set_dmamode = amd66_set_dmamode, |
368 | .mode_filter = ata_pci_default_filter, | 370 | .mode_filter = ata_pci_default_filter, |
@@ -391,13 +393,11 @@ static struct ata_port_operations amd66_port_ops = { | |||
391 | .irq_handler = ata_interrupt, | 393 | .irq_handler = ata_interrupt, |
392 | .irq_clear = ata_bmdma_irq_clear, | 394 | .irq_clear = ata_bmdma_irq_clear, |
393 | .irq_on = ata_irq_on, | 395 | .irq_on = ata_irq_on, |
394 | .irq_ack = ata_irq_ack, | ||
395 | 396 | ||
396 | .port_start = ata_port_start, | 397 | .port_start = ata_sff_port_start, |
397 | }; | 398 | }; |
398 | 399 | ||
399 | static struct ata_port_operations amd100_port_ops = { | 400 | static struct ata_port_operations amd100_port_ops = { |
400 | .port_disable = ata_port_disable, | ||
401 | .set_piomode = amd100_set_piomode, | 401 | .set_piomode = amd100_set_piomode, |
402 | .set_dmamode = amd100_set_dmamode, | 402 | .set_dmamode = amd100_set_dmamode, |
403 | .mode_filter = ata_pci_default_filter, | 403 | .mode_filter = ata_pci_default_filter, |
@@ -426,13 +426,11 @@ static struct ata_port_operations amd100_port_ops = { | |||
426 | .irq_handler = ata_interrupt, | 426 | .irq_handler = ata_interrupt, |
427 | .irq_clear = ata_bmdma_irq_clear, | 427 | .irq_clear = ata_bmdma_irq_clear, |
428 | .irq_on = ata_irq_on, | 428 | .irq_on = ata_irq_on, |
429 | .irq_ack = ata_irq_ack, | ||
430 | 429 | ||
431 | .port_start = ata_port_start, | 430 | .port_start = ata_sff_port_start, |
432 | }; | 431 | }; |
433 | 432 | ||
434 | static struct ata_port_operations amd133_port_ops = { | 433 | static struct ata_port_operations amd133_port_ops = { |
435 | .port_disable = ata_port_disable, | ||
436 | .set_piomode = amd133_set_piomode, | 434 | .set_piomode = amd133_set_piomode, |
437 | .set_dmamode = amd133_set_dmamode, | 435 | .set_dmamode = amd133_set_dmamode, |
438 | .mode_filter = ata_pci_default_filter, | 436 | .mode_filter = ata_pci_default_filter, |
@@ -461,13 +459,11 @@ static struct ata_port_operations amd133_port_ops = { | |||
461 | .irq_handler = ata_interrupt, | 459 | .irq_handler = ata_interrupt, |
462 | .irq_clear = ata_bmdma_irq_clear, | 460 | .irq_clear = ata_bmdma_irq_clear, |
463 | .irq_on = ata_irq_on, | 461 | .irq_on = ata_irq_on, |
464 | .irq_ack = ata_irq_ack, | ||
465 | 462 | ||
466 | .port_start = ata_port_start, | 463 | .port_start = ata_sff_port_start, |
467 | }; | 464 | }; |
468 | 465 | ||
469 | static struct ata_port_operations nv100_port_ops = { | 466 | static struct ata_port_operations nv100_port_ops = { |
470 | .port_disable = ata_port_disable, | ||
471 | .set_piomode = nv100_set_piomode, | 467 | .set_piomode = nv100_set_piomode, |
472 | .set_dmamode = nv100_set_dmamode, | 468 | .set_dmamode = nv100_set_dmamode, |
473 | .mode_filter = ata_pci_default_filter, | 469 | .mode_filter = ata_pci_default_filter, |
@@ -496,13 +492,11 @@ static struct ata_port_operations nv100_port_ops = { | |||
496 | .irq_handler = ata_interrupt, | 492 | .irq_handler = ata_interrupt, |
497 | .irq_clear = ata_bmdma_irq_clear, | 493 | .irq_clear = ata_bmdma_irq_clear, |
498 | .irq_on = ata_irq_on, | 494 | .irq_on = ata_irq_on, |
499 | .irq_ack = ata_irq_ack, | ||
500 | 495 | ||
501 | .port_start = ata_port_start, | 496 | .port_start = ata_sff_port_start, |
502 | }; | 497 | }; |
503 | 498 | ||
504 | static struct ata_port_operations nv133_port_ops = { | 499 | static struct ata_port_operations nv133_port_ops = { |
505 | .port_disable = ata_port_disable, | ||
506 | .set_piomode = nv133_set_piomode, | 500 | .set_piomode = nv133_set_piomode, |
507 | .set_dmamode = nv133_set_dmamode, | 501 | .set_dmamode = nv133_set_dmamode, |
508 | .mode_filter = ata_pci_default_filter, | 502 | .mode_filter = ata_pci_default_filter, |
@@ -531,9 +525,8 @@ static struct ata_port_operations nv133_port_ops = { | |||
531 | .irq_handler = ata_interrupt, | 525 | .irq_handler = ata_interrupt, |
532 | .irq_clear = ata_bmdma_irq_clear, | 526 | .irq_clear = ata_bmdma_irq_clear, |
533 | .irq_on = ata_irq_on, | 527 | .irq_on = ata_irq_on, |
534 | .irq_ack = ata_irq_ack, | ||
535 | 528 | ||
536 | .port_start = ata_port_start, | 529 | .port_start = ata_sff_port_start, |
537 | }; | 530 | }; |
538 | 531 | ||
539 | static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | 532 | static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) |