diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-29 13:48:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-29 13:48:21 -0400 |
commit | f73b0a08eae0e28c50db5dd5ab8245546918bfb6 (patch) | |
tree | eddc8c063acc7c70a975a0dadf26655159704b22 /drivers/ata/pata_qdi.c | |
parent | 6b06d2cc6d52830e3e0c001006b26255f47184dd (diff) | |
parent | 225036314e768bbfe8331ea9b0e91ca101afe427 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (86 commits)
SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
pata_hpt37x: Further small fixes
pata_hpt3x2n: Add HPT371N support and other bits
ata: printk warning fixes
libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
ahci: consolidate common port flags
ata_timing: ensure t->cycle is always correct
libata: add missing call to ->cable_detect() in new EH path
pata_amd: remove contamination added during cable_detect conversion
libata: Handle drives that require a spin-up command before first access
libata: HPA support
libata: kill probe_ent and related helpers
libata: convert the remaining PATA drivers to new init model
libata: convert the remaining SATA drivers to new init model
libata: convert ata_pci_init_native_mode() users to new init model
libata: convert drivers with combined SATA/PATA ports to new init model
libata: add init helpers including ata_pci_prepare_native_host()
libata: convert native PCI host handling to new init model
libata: convert legacy PCI host handling to new init model
...
Diffstat (limited to 'drivers/ata/pata_qdi.c')
-rw-r--r-- | drivers/ata/pata_qdi.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c index c3810012f3f4..27685ce63ceb 100644 --- a/drivers/ata/pata_qdi.c +++ b/drivers/ata/pata_qdi.c | |||
@@ -183,13 +183,13 @@ static struct ata_port_operations qdi6500_port_ops = { | |||
183 | .thaw = ata_bmdma_thaw, | 183 | .thaw = ata_bmdma_thaw, |
184 | .error_handler = ata_bmdma_error_handler, | 184 | .error_handler = ata_bmdma_error_handler, |
185 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 185 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
186 | .cable_detect = ata_cable_40wire, | ||
186 | 187 | ||
187 | .qc_prep = ata_qc_prep, | 188 | .qc_prep = ata_qc_prep, |
188 | .qc_issue = qdi_qc_issue_prot, | 189 | .qc_issue = qdi_qc_issue_prot, |
189 | 190 | ||
190 | .data_xfer = qdi_data_xfer, | 191 | .data_xfer = qdi_data_xfer, |
191 | 192 | ||
192 | .irq_handler = ata_interrupt, | ||
193 | .irq_clear = ata_bmdma_irq_clear, | 193 | .irq_clear = ata_bmdma_irq_clear, |
194 | .irq_on = ata_irq_on, | 194 | .irq_on = ata_irq_on, |
195 | .irq_ack = ata_irq_ack, | 195 | .irq_ack = ata_irq_ack, |
@@ -211,13 +211,13 @@ static struct ata_port_operations qdi6580_port_ops = { | |||
211 | .thaw = ata_bmdma_thaw, | 211 | .thaw = ata_bmdma_thaw, |
212 | .error_handler = ata_bmdma_error_handler, | 212 | .error_handler = ata_bmdma_error_handler, |
213 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 213 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
214 | .cable_detect = ata_cable_40wire, | ||
214 | 215 | ||
215 | .qc_prep = ata_qc_prep, | 216 | .qc_prep = ata_qc_prep, |
216 | .qc_issue = qdi_qc_issue_prot, | 217 | .qc_issue = qdi_qc_issue_prot, |
217 | 218 | ||
218 | .data_xfer = qdi_data_xfer, | 219 | .data_xfer = qdi_data_xfer, |
219 | 220 | ||
220 | .irq_handler = ata_interrupt, | ||
221 | .irq_clear = ata_bmdma_irq_clear, | 221 | .irq_clear = ata_bmdma_irq_clear, |
222 | .irq_on = ata_irq_on, | 222 | .irq_on = ata_irq_on, |
223 | .irq_ack = ata_irq_ack, | 223 | .irq_ack = ata_irq_ack, |
@@ -238,8 +238,9 @@ static struct ata_port_operations qdi6580_port_ops = { | |||
238 | 238 | ||
239 | static __init int qdi_init_one(unsigned long port, int type, unsigned long io, int irq, int fast) | 239 | static __init int qdi_init_one(unsigned long port, int type, unsigned long io, int irq, int fast) |
240 | { | 240 | { |
241 | struct ata_probe_ent ae; | ||
242 | struct platform_device *pdev; | 241 | struct platform_device *pdev; |
242 | struct ata_host *host; | ||
243 | struct ata_port *ap; | ||
243 | void __iomem *io_addr, *ctl_addr; | 244 | void __iomem *io_addr, *ctl_addr; |
244 | int ret; | 245 | int ret; |
245 | 246 | ||
@@ -257,34 +258,31 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i | |||
257 | if (!io_addr || !ctl_addr) | 258 | if (!io_addr || !ctl_addr) |
258 | goto fail; | 259 | goto fail; |
259 | 260 | ||
260 | memset(&ae, 0, sizeof(struct ata_probe_ent)); | 261 | ret = -ENOMEM; |
261 | INIT_LIST_HEAD(&ae.node); | 262 | host = ata_host_alloc(&pdev->dev, 1); |
262 | ae.dev = &pdev->dev; | 263 | if (!host) |
264 | goto fail; | ||
265 | ap = host->ports[0]; | ||
263 | 266 | ||
264 | if (type == 6580) { | 267 | if (type == 6580) { |
265 | ae.port_ops = &qdi6580_port_ops; | 268 | ap->ops = &qdi6580_port_ops; |
266 | ae.pio_mask = 0x1F; | 269 | ap->pio_mask = 0x1F; |
267 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | 270 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
268 | } else { | 271 | } else { |
269 | ae.port_ops = &qdi6500_port_ops; | 272 | ap->ops = &qdi6500_port_ops; |
270 | ae.pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */ | 273 | ap->pio_mask = 0x07; /* Actually PIO3 !IORDY is possible */ |
271 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | | 274 | ap->flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY; |
272 | ATA_FLAG_NO_IORDY; | ||
273 | } | 275 | } |
274 | 276 | ||
275 | ae.sht = &qdi_sht; | 277 | ap->ioaddr.cmd_addr = io_addr; |
276 | ae.n_ports = 1; | 278 | ap->ioaddr.altstatus_addr = ctl_addr; |
277 | ae.irq = irq; | 279 | ap->ioaddr.ctl_addr = ctl_addr; |
278 | ae.irq_flags = 0; | 280 | ata_std_ports(&ap->ioaddr); |
279 | ae.port[0].cmd_addr = io_addr; | ||
280 | ae.port[0].altstatus_addr = ctl_addr; | ||
281 | ae.port[0].ctl_addr = ctl_addr; | ||
282 | ata_std_ports(&ae.port[0]); | ||
283 | 281 | ||
284 | /* | 282 | /* |
285 | * Hook in a private data structure per channel | 283 | * Hook in a private data structure per channel |
286 | */ | 284 | */ |
287 | ae.private_data = &qdi_data[nr_qdi_host]; | 285 | ap->private_data = &qdi_data[nr_qdi_host]; |
288 | 286 | ||
289 | qdi_data[nr_qdi_host].timing = port; | 287 | qdi_data[nr_qdi_host].timing = port; |
290 | qdi_data[nr_qdi_host].fast = fast; | 288 | qdi_data[nr_qdi_host].fast = fast; |
@@ -292,8 +290,9 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i | |||
292 | 290 | ||
293 | printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io); | 291 | printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io); |
294 | 292 | ||
295 | ret = -ENODEV; | 293 | /* activate */ |
296 | if (!ata_device_add(&ae)) | 294 | ret = ata_host_activate(host, irq, ata_interrupt, 0, &qdi_sht); |
295 | if (ret) | ||
297 | goto fail; | 296 | goto fail; |
298 | 297 | ||
299 | qdi_host[nr_qdi_host++] = dev_get_drvdata(&pdev->dev); | 298 | qdi_host[nr_qdi_host++] = dev_get_drvdata(&pdev->dev); |