diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-12 19:16:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-12 19:16:41 -0400 |
commit | ab9c232286c2b77be78441c2d8396500b045777e (patch) | |
tree | 17570e159e4fb1ba36f1c363a7abef9b55909275 /drivers/ata/pata_ixp4xx_cf.c | |
parent | 8bd0983e05757e5c1f7a3342cd09badae93c167d (diff) | |
parent | 2855568b1ee4f58ef2c0a13ddfceb4b0b216b7ed (diff) |
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (119 commits)
[libata] struct pci_dev related cleanups
libata: use ata_exec_internal() for PMP register access
libata: implement ATA_PFLAG_RESETTING
libata: add @timeout to ata_exec_internal[_sg]()
ahci: fix notification handling
ahci: clean up PORT_IRQ_BAD_PMP enabling
ahci: kill leftover from enabling NCQ over PMP
libata: wrap schedule_timeout_uninterruptible() in loop
libata: skip suppress reporting if ATA_EHI_QUIET
libata: clear ehi description after initial host report
pata_jmicron: match vendor and class code only
libata: add ST9160821AS / 3.ALD to NCQ blacklist
pata_acpi: ACPI driver support
libata-core: Expose gtm methods for driver use
libata: add HDT722516DLA380 to NCQ blacklist
libata: blacklist NCQ on Seagate Barracuda ST380817AS
[libata] Turn on ACPI by default
libata_scsi: Fix ATAPI transfer lengths
libata: correct handling of SRST reset sequences
libata: Integrate ACPI-based PATA/SATA hotplug - version 5
...
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 5dea3584c6c2..fcd532afbf2e 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -26,12 +26,11 @@ | |||
26 | #define DRV_NAME "pata_ixp4xx_cf" | 26 | #define DRV_NAME "pata_ixp4xx_cf" |
27 | #define DRV_VERSION "0.2" | 27 | #define DRV_VERSION "0.2" |
28 | 28 | ||
29 | static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error) | 29 | static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) |
30 | { | 30 | { |
31 | int i; | 31 | struct ata_device *dev; |
32 | 32 | ||
33 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 33 | ata_link_for_each_dev(dev, link) { |
34 | struct ata_device *dev = &ap->device[i]; | ||
35 | if (ata_dev_enabled(dev)) { | 34 | if (ata_dev_enabled(dev)) { |
36 | ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); | 35 | ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); |
37 | dev->pio_mode = XFER_PIO_0; | 36 | dev->pio_mode = XFER_PIO_0; |
@@ -49,7 +48,7 @@ static void ixp4xx_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
49 | unsigned int i; | 48 | unsigned int i; |
50 | unsigned int words = buflen >> 1; | 49 | unsigned int words = buflen >> 1; |
51 | u16 *buf16 = (u16 *) buf; | 50 | u16 *buf16 = (u16 *) buf; |
52 | struct ata_port *ap = adev->ap; | 51 | struct ata_port *ap = adev->link->ap; |
53 | void __iomem *mmio = ap->ioaddr.data_addr; | 52 | void __iomem *mmio = ap->ioaddr.data_addr; |
54 | struct ixp4xx_pata_data *data = ap->host->dev->platform_data; | 53 | struct ixp4xx_pata_data *data = ap->host->dev->platform_data; |
55 | 54 | ||
@@ -108,7 +107,6 @@ static struct ata_port_operations ixp4xx_port_ops = { | |||
108 | .set_mode = ixp4xx_set_mode, | 107 | .set_mode = ixp4xx_set_mode, |
109 | .mode_filter = ata_pci_default_filter, | 108 | .mode_filter = ata_pci_default_filter, |
110 | 109 | ||
111 | .port_disable = ata_port_disable, | ||
112 | .tf_load = ata_tf_load, | 110 | .tf_load = ata_tf_load, |
113 | .tf_read = ata_tf_read, | 111 | .tf_read = ata_tf_read, |
114 | .exec_command = ata_exec_command, | 112 | .exec_command = ata_exec_command, |
@@ -128,14 +126,17 @@ static struct ata_port_operations ixp4xx_port_ops = { | |||
128 | .irq_handler = ata_interrupt, | 126 | .irq_handler = ata_interrupt, |
129 | .irq_clear = ata_bmdma_irq_clear, | 127 | .irq_clear = ata_bmdma_irq_clear, |
130 | .irq_on = ata_irq_on, | 128 | .irq_on = ata_irq_on, |
131 | .irq_ack = ata_dummy_irq_ack, | ||
132 | 129 | ||
133 | .port_start = ata_port_start, | 130 | .port_start = ata_port_start, |
134 | }; | 131 | }; |
135 | 132 | ||
136 | static void ixp4xx_setup_port(struct ata_ioports *ioaddr, | 133 | static void ixp4xx_setup_port(struct ata_ioports *ioaddr, |
137 | struct ixp4xx_pata_data *data) | 134 | struct ixp4xx_pata_data *data, |
135 | unsigned long raw_cs0, unsigned long raw_cs1) | ||
138 | { | 136 | { |
137 | unsigned long raw_cmd = raw_cs0; | ||
138 | unsigned long raw_ctl = raw_cs1 + 0x06; | ||
139 | |||
139 | ioaddr->cmd_addr = data->cs0; | 140 | ioaddr->cmd_addr = data->cs0; |
140 | ioaddr->altstatus_addr = data->cs1 + 0x06; | 141 | ioaddr->altstatus_addr = data->cs1 + 0x06; |
141 | ioaddr->ctl_addr = data->cs1 + 0x06; | 142 | ioaddr->ctl_addr = data->cs1 + 0x06; |
@@ -161,7 +162,12 @@ static void ixp4xx_setup_port(struct ata_ioports *ioaddr, | |||
161 | *(unsigned long *)&ioaddr->device_addr ^= 0x03; | 162 | *(unsigned long *)&ioaddr->device_addr ^= 0x03; |
162 | *(unsigned long *)&ioaddr->status_addr ^= 0x03; | 163 | *(unsigned long *)&ioaddr->status_addr ^= 0x03; |
163 | *(unsigned long *)&ioaddr->command_addr ^= 0x03; | 164 | *(unsigned long *)&ioaddr->command_addr ^= 0x03; |
165 | |||
166 | raw_cmd ^= 0x03; | ||
167 | raw_ctl ^= 0x03; | ||
164 | #endif | 168 | #endif |
169 | |||
170 | ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", raw_cmd, raw_ctl); | ||
165 | } | 171 | } |
166 | 172 | ||
167 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | 173 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) |
@@ -206,7 +212,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
206 | ap->pio_mask = 0x1f; /* PIO4 */ | 212 | ap->pio_mask = 0x1f; /* PIO4 */ |
207 | ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; | 213 | ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; |
208 | 214 | ||
209 | ixp4xx_setup_port(&ap->ioaddr, data); | 215 | ixp4xx_setup_port(ap, data, cs0->start, cs1->start); |
210 | 216 | ||
211 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); | 217 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); |
212 | 218 | ||