diff options
Diffstat (limited to 'drivers/ide/icside.c')
-rw-r--r-- | drivers/ide/icside.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c index 415d7e24f2b6..51ce404fe532 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c | |||
@@ -307,15 +307,14 @@ static void icside_dma_start(ide_drive_t *drive) | |||
307 | enable_dma(ec->dma); | 307 | enable_dma(ec->dma); |
308 | } | 308 | } |
309 | 309 | ||
310 | static int icside_dma_setup(ide_drive_t *drive) | 310 | static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) |
311 | { | 311 | { |
312 | ide_hwif_t *hwif = drive->hwif; | 312 | ide_hwif_t *hwif = drive->hwif; |
313 | struct expansion_card *ec = ECARD_DEV(hwif->dev); | 313 | struct expansion_card *ec = ECARD_DEV(hwif->dev); |
314 | struct icside_state *state = ecard_get_drvdata(ec); | 314 | struct icside_state *state = ecard_get_drvdata(ec); |
315 | struct request *rq = hwif->rq; | ||
316 | unsigned int dma_mode; | 315 | unsigned int dma_mode; |
317 | 316 | ||
318 | if (rq_data_dir(rq)) | 317 | if (cmd->tf_flags & IDE_TFLAG_WRITE) |
319 | dma_mode = DMA_MODE_WRITE; | 318 | dma_mode = DMA_MODE_WRITE; |
320 | else | 319 | else |
321 | dma_mode = DMA_MODE_READ; | 320 | dma_mode = DMA_MODE_READ; |
@@ -325,8 +324,6 @@ static int icside_dma_setup(ide_drive_t *drive) | |||
325 | */ | 324 | */ |
326 | BUG_ON(dma_channel_active(ec->dma)); | 325 | BUG_ON(dma_channel_active(ec->dma)); |
327 | 326 | ||
328 | hwif->sg_nents = ide_build_sglist(drive, rq); | ||
329 | |||
330 | /* | 327 | /* |
331 | * Ensure that we have the right interrupt routed. | 328 | * Ensure that we have the right interrupt routed. |
332 | */ | 329 | */ |
@@ -346,7 +343,7 @@ static int icside_dma_setup(ide_drive_t *drive) | |||
346 | * Tell the DMA engine about the SG table and | 343 | * Tell the DMA engine about the SG table and |
347 | * data direction. | 344 | * data direction. |
348 | */ | 345 | */ |
349 | set_dma_sg(ec->dma, hwif->sg_table, hwif->sg_nents); | 346 | set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents); |
350 | set_dma_mode(ec->dma, dma_mode); | 347 | set_dma_mode(ec->dma, dma_mode); |
351 | 348 | ||
352 | drive->waiting_for_dma = 1; | 349 | drive->waiting_for_dma = 1; |
@@ -354,12 +351,6 @@ static int icside_dma_setup(ide_drive_t *drive) | |||
354 | return 0; | 351 | return 0; |
355 | } | 352 | } |
356 | 353 | ||
357 | static void icside_dma_exec_cmd(ide_drive_t *drive, u8 cmd) | ||
358 | { | ||
359 | /* issue cmd to drive */ | ||
360 | ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD, NULL); | ||
361 | } | ||
362 | |||
363 | static int icside_dma_test_irq(ide_drive_t *drive) | 354 | static int icside_dma_test_irq(ide_drive_t *drive) |
364 | { | 355 | { |
365 | ide_hwif_t *hwif = drive->hwif; | 356 | ide_hwif_t *hwif = drive->hwif; |
@@ -383,7 +374,6 @@ static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d) | |||
383 | static const struct ide_dma_ops icside_v6_dma_ops = { | 374 | static const struct ide_dma_ops icside_v6_dma_ops = { |
384 | .dma_host_set = icside_dma_host_set, | 375 | .dma_host_set = icside_dma_host_set, |
385 | .dma_setup = icside_dma_setup, | 376 | .dma_setup = icside_dma_setup, |
386 | .dma_exec_cmd = icside_dma_exec_cmd, | ||
387 | .dma_start = icside_dma_start, | 377 | .dma_start = icside_dma_start, |
388 | .dma_end = icside_dma_end, | 378 | .dma_end = icside_dma_end, |
389 | .dma_test_irq = icside_dma_test_irq, | 379 | .dma_test_irq = icside_dma_test_irq, |
@@ -419,6 +409,10 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base, | |||
419 | hw->chipset = ide_acorn; | 409 | hw->chipset = ide_acorn; |
420 | } | 410 | } |
421 | 411 | ||
412 | static const struct ide_port_info icside_v5_port_info = { | ||
413 | .host_flags = IDE_HFLAG_NO_DMA, | ||
414 | }; | ||
415 | |||
422 | static int __devinit | 416 | static int __devinit |
423 | icside_register_v5(struct icside_state *state, struct expansion_card *ec) | 417 | icside_register_v5(struct icside_state *state, struct expansion_card *ec) |
424 | { | 418 | { |
@@ -445,7 +439,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) | |||
445 | 439 | ||
446 | icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec); | 440 | icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec); |
447 | 441 | ||
448 | host = ide_host_alloc(NULL, hws); | 442 | host = ide_host_alloc(&icside_v5_port_info, hws); |
449 | if (host == NULL) | 443 | if (host == NULL) |
450 | return -ENODEV; | 444 | return -ENODEV; |
451 | 445 | ||
@@ -453,7 +447,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) | |||
453 | 447 | ||
454 | ecard_set_drvdata(ec, state); | 448 | ecard_set_drvdata(ec, state); |
455 | 449 | ||
456 | ret = ide_host_register(host, NULL, hws); | 450 | ret = ide_host_register(host, &icside_v5_port_info, hws); |
457 | if (ret) | 451 | if (ret) |
458 | goto err_free; | 452 | goto err_free; |
459 | 453 | ||