Commit 307c6054 authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

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: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 5816fbbf
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/ata.h> #include <linux/ata.h>
#define DRV_NAME "pata_marvell" #define DRV_NAME "pata_marvell"
#define DRV_VERSION "0.1.1" #define DRV_VERSION "0.1.4"
/** /**
* marvell_pre_reset - check for 40/80 pin * marvell_pre_reset - check for 40/80 pin
...@@ -52,22 +52,23 @@ static int marvell_pre_reset(struct ata_port *ap) ...@@ -52,22 +52,23 @@ static int marvell_pre_reset(struct ata_port *ap)
if ((pdev->device == 0x6145) && (ap->port_no == 0) && if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
(!(devices & 0x10))) /* PATA enable ? */ (!(devices & 0x10))) /* PATA enable ? */
return -ENOENT; return -ENOENT;
return ata_std_prereset(ap);
}
static int marvell_cable_detect(struct ata_port *ap)
{
/* Cable type */ /* Cable type */
switch(ap->port_no) switch(ap->port_no)
{ {
case 0: case 0:
if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1) if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
ap->cbl = ATA_CBL_PATA40; return ATA_CBL_PATA40;
else return ATA_CBL_PATA80;
ap->cbl = ATA_CBL_PATA80;
break;
case 1: /* Legacy SATA port */ case 1: /* Legacy SATA port */
ap->cbl = ATA_CBL_SATA; return ATA_CBL_SATA;
break;
} }
return ata_std_prereset(ap); BUG();
return 0; /* Our BUG macro needs the right markup */
} }
/** /**
...@@ -123,6 +124,7 @@ static const struct ata_port_operations marvell_ops = { ...@@ -123,6 +124,7 @@ static const struct ata_port_operations marvell_ops = {
.thaw = ata_bmdma_thaw, .thaw = ata_bmdma_thaw,
.error_handler = marvell_error_handler, .error_handler = marvell_error_handler,
.post_internal_cmd = ata_bmdma_post_internal_cmd, .post_internal_cmd = ata_bmdma_post_internal_cmd,
.cable_detect = marvell_cable_detect,
/* BMDMA handling is PCI ATA format, use helpers */ /* BMDMA handling is PCI ATA format, use helpers */
.bmdma_setup = ata_bmdma_setup, .bmdma_setup = ata_bmdma_setup,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment