aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_marvell.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-03-07 11:48:09 -0500
committerJeff Garzik <jeff@garzik.org>2007-04-28 14:15:56 -0400
commit307c6054ad67428ad4e2bd4e5faae54fc4f8bcd2 (patch)
tree9d510c9e59b396ff5f3695eba6c60aa29bdcbcca /drivers/ata/pata_marvell.c
parent5816fbbf22470b687964462e6c1f18165b291f22 (diff)
pata_marvell: Cable and reset fixes
There are two changes here. Firstly we switch to a cable detect method, secondly the old code forgot to call ata_std_prereset() but somehow managed to work anyway. Fix the missing call. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_marvell.c')
-rw-r--r--drivers/ata/pata_marvell.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 6dd7c4ef3e66..d9b94a1b6954 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -20,7 +20,7 @@
20#include <linux/ata.h> 20#include <linux/ata.h>
21 21
22#define DRV_NAME "pata_marvell" 22#define DRV_NAME "pata_marvell"
23#define DRV_VERSION "0.1.1" 23#define DRV_VERSION "0.1.4"
24 24
25/** 25/**
26 * marvell_pre_reset - check for 40/80 pin 26 * marvell_pre_reset - check for 40/80 pin
@@ -52,22 +52,23 @@ static int marvell_pre_reset(struct ata_port *ap)
52 if ((pdev->device == 0x6145) && (ap->port_no == 0) && 52 if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
53 (!(devices & 0x10))) /* PATA enable ? */ 53 (!(devices & 0x10))) /* PATA enable ? */
54 return -ENOENT; 54 return -ENOENT;
55 return ata_std_prereset(ap);
56}
55 57
58static int marvell_cable_detect(struct ata_port *ap)
59{
56 /* Cable type */ 60 /* Cable type */
57 switch(ap->port_no) 61 switch(ap->port_no)
58 { 62 {
59 case 0: 63 case 0:
60 if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1) 64 if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
61 ap->cbl = ATA_CBL_PATA40; 65 return ATA_CBL_PATA40;
62 else 66 return ATA_CBL_PATA80;
63 ap->cbl = ATA_CBL_PATA80;
64 break;
65
66 case 1: /* Legacy SATA port */ 67 case 1: /* Legacy SATA port */
67 ap->cbl = ATA_CBL_SATA; 68 return ATA_CBL_SATA;
68 break;
69 } 69 }
70 return ata_std_prereset(ap); 70 BUG();
71 return 0; /* Our BUG macro needs the right markup */
71} 72}
72 73
73/** 74/**
@@ -123,6 +124,7 @@ static const struct ata_port_operations marvell_ops = {
123 .thaw = ata_bmdma_thaw, 124 .thaw = ata_bmdma_thaw,
124 .error_handler = marvell_error_handler, 125 .error_handler = marvell_error_handler,
125 .post_internal_cmd = ata_bmdma_post_internal_cmd, 126 .post_internal_cmd = ata_bmdma_post_internal_cmd,
127 .cable_detect = marvell_cable_detect,
126 128
127 /* BMDMA handling is PCI ATA format, use helpers */ 129 /* BMDMA handling is PCI ATA format, use helpers */
128 .bmdma_setup = ata_bmdma_setup, 130 .bmdma_setup = ata_bmdma_setup,