Commit e2a9752a authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

sata_promise: Switch to cable method, clean up some bits as a result

Signed-off-by: default avatarAlan Cox <number6@the-village.bc.nu>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 2e41e8e6
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "sata_promise.h" #include "sata_promise.h"
#define DRV_NAME "sata_promise" #define DRV_NAME "sata_promise"
#define DRV_VERSION "2.00" #define DRV_VERSION "2.01"
enum { enum {
...@@ -131,7 +131,7 @@ static void pdc_freeze(struct ata_port *ap); ...@@ -131,7 +131,7 @@ static void pdc_freeze(struct ata_port *ap);
static void pdc_thaw(struct ata_port *ap); static void pdc_thaw(struct ata_port *ap);
static void pdc_error_handler(struct ata_port *ap); static void pdc_error_handler(struct ata_port *ap);
static void pdc_post_internal_cmd(struct ata_queued_cmd *qc); static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
static int pdc_cable_detect(struct ata_port *ap);
static struct scsi_host_template pdc_ata_sht = { static struct scsi_host_template pdc_ata_sht = {
.module = THIS_MODULE, .module = THIS_MODULE,
...@@ -166,6 +166,7 @@ static const struct ata_port_operations pdc_sata_ops = { ...@@ -166,6 +166,7 @@ static const struct ata_port_operations pdc_sata_ops = {
.thaw = pdc_thaw, .thaw = pdc_thaw,
.error_handler = pdc_error_handler, .error_handler = pdc_error_handler,
.post_internal_cmd = pdc_post_internal_cmd, .post_internal_cmd = pdc_post_internal_cmd,
.cable_detect = pdc_cable_detect,
.data_xfer = ata_data_xfer, .data_xfer = ata_data_xfer,
.irq_handler = pdc_interrupt, .irq_handler = pdc_interrupt,
.irq_clear = pdc_irq_clear, .irq_clear = pdc_irq_clear,
...@@ -374,18 +375,18 @@ static void pdc_reset_port(struct ata_port *ap) ...@@ -374,18 +375,18 @@ static void pdc_reset_port(struct ata_port *ap)
readl(mmio); /* flush */ readl(mmio); /* flush */
} }
static void pdc_pata_cbl_detect(struct ata_port *ap) static int pdc_cable_detect(struct ata_port *ap)
{ {
u8 tmp; u8 tmp;
void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
tmp = readb(mmio); if (!sata_scr_valid(ap)) {
tmp = readb(mmio);
if (tmp & 0x01) { if (tmp & 0x01)
ap->cbl = ATA_CBL_PATA40; return ATA_CBL_PATA40;
ap->udma_mask &= ATA_UDMA_MASK_40C; return ATA_CBL_PATA80;
} else }
ap->cbl = ATA_CBL_PATA80; return ATA_CBL_SATA;
} }
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
...@@ -555,13 +556,6 @@ static void pdc_thaw(struct ata_port *ap) ...@@ -555,13 +556,6 @@ static void pdc_thaw(struct ata_port *ap)
readl(mmio + PDC_CTLSTAT); /* flush */ readl(mmio + PDC_CTLSTAT); /* flush */
} }
static int pdc_pre_reset(struct ata_port *ap)
{
if (!sata_scr_valid(ap))
pdc_pata_cbl_detect(ap);
return ata_std_prereset(ap);
}
static void pdc_error_handler(struct ata_port *ap) static void pdc_error_handler(struct ata_port *ap)
{ {
ata_reset_fn_t hardreset; ata_reset_fn_t hardreset;
...@@ -574,7 +568,7 @@ static void pdc_error_handler(struct ata_port *ap) ...@@ -574,7 +568,7 @@ static void pdc_error_handler(struct ata_port *ap)
hardreset = sata_std_hardreset; hardreset = sata_std_hardreset;
/* perform recovery */ /* perform recovery */
ata_do_eh(ap, pdc_pre_reset, ata_std_softreset, hardreset, ata_do_eh(ap, ata_std_prereset, ata_std_softreset, hardreset,
ata_std_postreset); ata_std_postreset);
} }
......
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