aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pdc202xx_old.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-03-09 07:24:15 -0500
committerJeff Garzik <jeff@garzik.org>2007-04-28 14:15:56 -0400
commita0fcdc0259e98d1c16d96baea9ba8a8603e41791 (patch)
tree568c6a99b5e38486c84b5145ac2e3719b8c62720 /drivers/ata/pata_pdc202xx_old.c
parent6a3d586d8e8a50e4cfd7f8c36d82a53c5614e05b (diff)
[libata] Update several PATA drivers for new ->cable_detect hook
All patches authored and signed-off-by Alan Cox, sent on Mar 7, 2007. I merely combined them all into a single patch. Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_pdc202xx_old.c')
-rw-r--r--drivers/ata/pata_pdc202xx_old.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index a764ce8252aa..ee636beb05e1 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -22,45 +22,17 @@
22#include <linux/libata.h> 22#include <linux/libata.h>
23 23
24#define DRV_NAME "pata_pdc202xx_old" 24#define DRV_NAME "pata_pdc202xx_old"
25#define DRV_VERSION "0.4.0" 25#define DRV_VERSION "0.4.2"
26 26
27/** 27static int pdc2026x_cable_detect(struct ata_port *ap)
28 * pdc2024x_pre_reset - probe begin
29 * @ap: ATA port
30 *
31 * Set up cable type and use generic probe init
32 */
33
34static int pdc2024x_pre_reset(struct ata_port *ap)
35{
36 ap->cbl = ATA_CBL_PATA40;
37 return ata_std_prereset(ap);
38}
39
40
41static void pdc2024x_error_handler(struct ata_port *ap)
42{
43 ata_bmdma_drive_eh(ap, pdc2024x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
44}
45
46
47static int pdc2026x_pre_reset(struct ata_port *ap)
48{ 28{
49 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 29 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
50 u16 cis; 30 u16 cis;
51 31
52 pci_read_config_word(pdev, 0x50, &cis); 32 pci_read_config_word(pdev, 0x50, &cis);
53 if (cis & (1 << (10 + ap->port_no))) 33 if (cis & (1 << (10 + ap->port_no)))
54 ap->cbl = ATA_CBL_PATA80; 34 return ATA_CBL_PATA80;
55 else 35 return ATA_CBL_PATA40;
56 ap->cbl = ATA_CBL_PATA40;
57
58 return ata_std_prereset(ap);
59}
60
61static void pdc2026x_error_handler(struct ata_port *ap)
62{
63 ata_bmdma_drive_eh(ap, pdc2026x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
64} 36}
65 37
66/** 38/**
@@ -291,8 +263,9 @@ static struct ata_port_operations pdc2024x_port_ops = {
291 263
292 .freeze = ata_bmdma_freeze, 264 .freeze = ata_bmdma_freeze,
293 .thaw = ata_bmdma_thaw, 265 .thaw = ata_bmdma_thaw,
294 .error_handler = pdc2024x_error_handler, 266 .error_handler = ata_bmdma_error_handler,
295 .post_internal_cmd = ata_bmdma_post_internal_cmd, 267 .post_internal_cmd = ata_bmdma_post_internal_cmd,
268 .cable_detect = ata_cable_40wire,
296 269
297 .bmdma_setup = ata_bmdma_setup, 270 .bmdma_setup = ata_bmdma_setup,
298 .bmdma_start = ata_bmdma_start, 271 .bmdma_start = ata_bmdma_start,
@@ -325,8 +298,9 @@ static struct ata_port_operations pdc2026x_port_ops = {
325 298
326 .freeze = ata_bmdma_freeze, 299 .freeze = ata_bmdma_freeze,
327 .thaw = ata_bmdma_thaw, 300 .thaw = ata_bmdma_thaw,
328 .error_handler = pdc2026x_error_handler, 301 .error_handler = ata_bmdma_error_handler,
329 .post_internal_cmd = ata_bmdma_post_internal_cmd, 302 .post_internal_cmd = ata_bmdma_post_internal_cmd,
303 .cable_detect = pdc2026x_cable_detect,
330 304
331 .bmdma_setup = ata_bmdma_setup, 305 .bmdma_setup = ata_bmdma_setup,
332 .bmdma_start = pdc2026x_bmdma_start, 306 .bmdma_start = pdc2026x_bmdma_start,