diff options
Diffstat (limited to 'drivers/ide/pci/trm290.c')
| -rw-r--r-- | drivers/ide/pci/trm290.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index 2b8f3a2837d7..15ee38f7ad3f 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c | |||
| @@ -214,7 +214,7 @@ static void trm290_dma_start(ide_drive_t *drive) | |||
| 214 | { | 214 | { |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | static int trm290_ide_dma_end (ide_drive_t *drive) | 217 | static int trm290_dma_end(ide_drive_t *drive) |
| 218 | { | 218 | { |
| 219 | u16 status; | 219 | u16 status; |
| 220 | 220 | ||
| @@ -225,7 +225,7 @@ static int trm290_ide_dma_end (ide_drive_t *drive) | |||
| 225 | return status != 0x00ff; | 225 | return status != 0x00ff; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | static int trm290_ide_dma_test_irq (ide_drive_t *drive) | 228 | static int trm290_dma_test_irq(ide_drive_t *drive) |
| 229 | { | 229 | { |
| 230 | u16 status; | 230 | u16 status; |
| 231 | 231 | ||
| @@ -254,22 +254,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) | |||
| 254 | hwif->config_data = cfg_base; | 254 | hwif->config_data = cfg_base; |
| 255 | hwif->dma_base = (cfg_base + 4) ^ (hwif->channel ? 0x80 : 0); | 255 | hwif->dma_base = (cfg_base + 4) ^ (hwif->channel ? 0x80 : 0); |
| 256 | 256 | ||
| 257 | printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", | 257 | printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", |
| 258 | hwif->name, hwif->dma_base, hwif->dma_base + 3); | 258 | hwif->name, hwif->dma_base, hwif->dma_base + 3); |
| 259 | 259 | ||
| 260 | if (!request_region(hwif->dma_base, 4, hwif->name)) { | 260 | if (ide_allocate_dma_engine(hwif)) |
| 261 | printk(KERN_CONT " -- Error, ports in use.\n"); | ||
| 262 | return; | 261 | return; |
| 263 | } | ||
| 264 | |||
| 265 | hwif->dmatable_cpu = pci_alloc_consistent(dev, PRD_ENTRIES * PRD_BYTES, | ||
| 266 | &hwif->dmatable_dma); | ||
| 267 | if (!hwif->dmatable_cpu) { | ||
| 268 | printk(KERN_CONT " -- Error, unable to allocate DMA table.\n"); | ||
| 269 | release_region(hwif->dma_base, 4); | ||
| 270 | return; | ||
| 271 | } | ||
| 272 | printk(KERN_CONT "\n"); | ||
| 273 | 262 | ||
| 274 | local_irq_save(flags); | 263 | local_irq_save(flags); |
| 275 | /* put config reg into first byte of hwif->select_data */ | 264 | /* put config reg into first byte of hwif->select_data */ |
| @@ -291,14 +280,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) | |||
| 291 | /* sharing IRQ with mate */ | 280 | /* sharing IRQ with mate */ |
| 292 | hwif->irq = hwif->mate->irq; | 281 | hwif->irq = hwif->mate->irq; |
| 293 | 282 | ||
| 294 | hwif->dma_host_set = &trm290_dma_host_set; | ||
| 295 | hwif->dma_setup = &trm290_dma_setup; | ||
| 296 | hwif->dma_exec_cmd = &trm290_dma_exec_cmd; | ||
| 297 | hwif->dma_start = &trm290_dma_start; | ||
| 298 | hwif->ide_dma_end = &trm290_ide_dma_end; | ||
| 299 | hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; | ||
| 300 | |||
| 301 | hwif->selectproc = &trm290_selectproc; | ||
| 302 | #if 1 | 283 | #if 1 |
| 303 | { | 284 | { |
| 304 | /* | 285 | /* |
| @@ -328,10 +309,27 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) | |||
| 328 | #endif | 309 | #endif |
| 329 | } | 310 | } |
| 330 | 311 | ||
| 312 | static const struct ide_port_ops trm290_port_ops = { | ||
| 313 | .selectproc = trm290_selectproc, | ||
| 314 | }; | ||
| 315 | |||
| 316 | static struct ide_dma_ops trm290_dma_ops = { | ||
| 317 | .dma_host_set = trm290_dma_host_set, | ||
| 318 | .dma_setup = trm290_dma_setup, | ||
| 319 | .dma_exec_cmd = trm290_dma_exec_cmd, | ||
| 320 | .dma_start = trm290_dma_start, | ||
| 321 | .dma_end = trm290_dma_end, | ||
| 322 | .dma_test_irq = trm290_dma_test_irq, | ||
| 323 | .dma_lost_irq = ide_dma_lost_irq, | ||
| 324 | .dma_timeout = ide_dma_timeout, | ||
| 325 | }; | ||
| 326 | |||
| 331 | static const struct ide_port_info trm290_chipset __devinitdata = { | 327 | static const struct ide_port_info trm290_chipset __devinitdata = { |
| 332 | .name = "TRM290", | 328 | .name = "TRM290", |
| 333 | .init_hwif = init_hwif_trm290, | 329 | .init_hwif = init_hwif_trm290, |
| 334 | .chipset = ide_trm290, | 330 | .chipset = ide_trm290, |
| 331 | .port_ops = &trm290_port_ops, | ||
| 332 | .dma_ops = &trm290_dma_ops, | ||
| 335 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | 333 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | |
| 336 | #if 0 /* play it safe for now */ | 334 | #if 0 /* play it safe for now */ |
| 337 | IDE_HFLAG_TRUST_BIOS_FOR_DMA | | 335 | IDE_HFLAG_TRUST_BIOS_FOR_DMA | |
