git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
asus_acpi: convert to seq_file
[safe/jmp/linux-2.6]
/
drivers
/
ata
/
pata_ns87415.c
diff --git
a/drivers/ata/pata_ns87415.c
b/drivers/ata/pata_ns87415.c
index
03a52ce
..
061aa1c
100644
(file)
--- a/
drivers/ata/pata_ns87415.c
+++ b/
drivers/ata/pata_ns87415.c
@@
-1,7
+1,7
@@
/*
* pata_ns87415.c - NS87415 (non PARISC) PATA
*
/*
* pata_ns87415.c - NS87415 (non PARISC) PATA
*
- * (C) 2005 Red Hat <alan@
redhat.com
>
+ * (C) 2005 Red Hat <alan@
lxorguk.ukuu.org.uk
>
*
* This is a fairly generic MWDMA controller. It has some limitations
* as it requires timing reloads on PIO/DMA transitions but it is otherwise
*
* This is a fairly generic MWDMA controller. It has some limitations
* as it requires timing reloads on PIO/DMA transitions but it is otherwise
@@
-66,8
+66,8
@@
static void ns87415_set_mode(struct ata_port *ap, struct ata_device *adev, u8 mo
ata_timing_compute(adev, adev->pio_mode, &t, T, 0);
ata_timing_compute(adev, adev->pio_mode, &t, T, 0);
- clocking = 17 -
FIT
(t.active, 2, 17);
- clocking |= (16 -
FIT
(t.recover, 1, 16)) << 4;
+ clocking = 17 -
clamp_val
(t.active, 2, 17);
+ clocking |= (16 -
clamp_val
(t.recover, 1, 16)) << 4;
/* Use the same timing for read and write bytes */
clocking |= (clocking << 8);
pci_write_config_word(dev, timing, clocking);
/* Use the same timing for read and write bytes */
clocking |= (clocking << 8);
pci_write_config_word(dev, timing, clocking);
@@
-138,7
+138,7
@@
static void ns87415_bmdma_setup(struct ata_queued_cmd *qc)
dmactl |= ATA_DMA_WR;
iowrite8(dmactl, ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
/* issue r/w command */
dmactl |= ATA_DMA_WR;
iowrite8(dmactl, ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
/* issue r/w command */
- ap->ops->exec_command(ap, &qc->tf);
+ ap->ops->
sff_
exec_command(ap, &qc->tf);
}
/**
}
/**
@@
-306,7
+306,7
@@
static struct ata_port_operations ns87415_pata_ops = {
.bmdma_setup = ns87415_bmdma_setup,
.bmdma_start = ns87415_bmdma_start,
.bmdma_stop = ns87415_bmdma_stop,
.bmdma_setup = ns87415_bmdma_setup,
.bmdma_start = ns87415_bmdma_start,
.bmdma_stop = ns87415_bmdma_stop,
- .
irq_clear
= ns87415_irq_clear,
+ .
sff_irq_clear
= ns87415_irq_clear,
.cable_detect = ata_cable_40wire,
.set_piomode = ns87415_set_piomode,
.cable_detect = ata_cable_40wire,
.set_piomode = ns87415_set_piomode,
@@
-315,8
+315,8
@@
static struct ata_port_operations ns87415_pata_ops = {
#if defined(CONFIG_SUPERIO)
static struct ata_port_operations ns87560_pata_ops = {
.inherits = &ns87415_pata_ops,
#if defined(CONFIG_SUPERIO)
static struct ata_port_operations ns87560_pata_ops = {
.inherits = &ns87415_pata_ops,
- .
tf_read
= ns87560_tf_read,
- .
check_status
= ns87560_check_status,
+ .
sff_tf_read
= ns87560_tf_read,
+ .
sff_check_status
= ns87560_check_status,
.bmdma_status = ns87560_bmdma_status,
};
#endif
.bmdma_status = ns87560_bmdma_status,
};
#endif
@@
-325,6
+325,13
@@
static struct scsi_host_template ns87415_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
ATA_BMDMA_SHT(DRV_NAME),
};
+static void ns87415_fixup(struct pci_dev *pdev)
+{
+ /* Select 512 byte sectors */
+ pci_write_config_byte(pdev, 0x55, 0xEE);
+ /* Select PIO0 8bit clocking */
+ pci_write_config_byte(pdev, 0x54, 0xB7);
+}
/**
* ns87415_init_one - Register 87415 ATA PCI device with kernel services
/**
* ns87415_init_one - Register 87415 ATA PCI device with kernel services
@@
-346,8
+353,8
@@
static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
static int printed_version;
static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS,
static int printed_version;
static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS,
- .pio_mask =
0x1f, /* pio0-4 */
- .mwdma_mask =
0x07, /* mwdma0-2 */
+ .pio_mask =
ATA_PIO4,
+ .mwdma_mask =
ATA_MWDMA2,
.port_ops = &ns87415_pata_ops,
};
const struct ata_port_info *ppi[] = { &info, NULL };
.port_ops = &ns87415_pata_ops,
};
const struct ata_port_info *ppi[] = { &info, NULL };
@@
-355,8
+362,8
@@
static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
#if defined(CONFIG_SUPERIO)
static const struct ata_port_info info87560 = {
.flags = ATA_FLAG_SLAVE_POSS,
#if defined(CONFIG_SUPERIO)
static const struct ata_port_info info87560 = {
.flags = ATA_FLAG_SLAVE_POSS,
- .pio_mask =
0x1f, /* pio0-4 */
- .mwdma_mask =
0x07, /* mwdma0-2 */
+ .pio_mask =
ATA_PIO4,
+ .mwdma_mask =
ATA_MWDMA2,
.port_ops = &ns87560_pata_ops,
};
.port_ops = &ns87560_pata_ops,
};
@@
-371,10
+378,8
@@
static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
if (rc)
return rc;
if (rc)
return rc;
- /* Select 512 byte sectors */
- pci_write_config_byte(pdev, 0x55, 0xEE);
- /* Select PIO0 8bit clocking */
- pci_write_config_byte(pdev, 0x54, 0xB7);
+ ns87415_fixup(pdev);
+
return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL);
}
return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL);
}
@@
-384,6
+389,23
@@
static const struct pci_device_id ns87415_pci_tbl[] = {
{ } /* terminate list */
};
{ } /* terminate list */
};
+#ifdef CONFIG_PM
+static int ns87415_reinit_one(struct pci_dev *pdev)
+{
+ struct ata_host *host = dev_get_drvdata(&pdev->dev);
+ int rc;
+
+ rc = ata_pci_device_do_resume(pdev);
+ if (rc)
+ return rc;
+
+ ns87415_fixup(pdev);
+
+ ata_host_resume(host);
+ return 0;
+}
+#endif
+
static struct pci_driver ns87415_pci_driver = {
.name = DRV_NAME,
.id_table = ns87415_pci_tbl,
static struct pci_driver ns87415_pci_driver = {
.name = DRV_NAME,
.id_table = ns87415_pci_tbl,
@@
-391,7
+413,7
@@
static struct pci_driver ns87415_pci_driver = {
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
- .resume =
ata_pci_device_resum
e,
+ .resume =
ns87415_reinit_on
e,
#endif
};
#endif
};