aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/au1xxx-ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/au1xxx-ide.c')
-rw-r--r--drivers/ide/au1xxx-ide.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c
index d3a9d6c15328..46013644c965 100644
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -50,7 +50,7 @@ static _auide_hwif auide_hwif;
50 50
51#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) 51#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)
52 52
53void auide_insw(unsigned long port, void *addr, u32 count) 53static inline void auide_insw(unsigned long port, void *addr, u32 count)
54{ 54{
55 _auide_hwif *ahwif = &auide_hwif; 55 _auide_hwif *ahwif = &auide_hwif;
56 chan_tab_t *ctp; 56 chan_tab_t *ctp;
@@ -68,7 +68,7 @@ void auide_insw(unsigned long port, void *addr, u32 count)
68 ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); 68 ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);
69} 69}
70 70
71void auide_outsw(unsigned long port, void *addr, u32 count) 71static inline void auide_outsw(unsigned long port, void *addr, u32 count)
72{ 72{
73 _auide_hwif *ahwif = &auide_hwif; 73 _auide_hwif *ahwif = &auide_hwif;
74 chan_tab_t *ctp; 74 chan_tab_t *ctp;
@@ -236,7 +236,7 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
236 if (++count >= PRD_ENTRIES) { 236 if (++count >= PRD_ENTRIES) {
237 printk(KERN_WARNING "%s: DMA table too small\n", 237 printk(KERN_WARNING "%s: DMA table too small\n",
238 drive->name); 238 drive->name);
239 goto use_pio_instead; 239 return 0;
240 } 240 }
241 241
242 /* Lets enable intr for the last descriptor only */ 242 /* Lets enable intr for the last descriptor only */
@@ -272,16 +272,11 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
272 if (count) 272 if (count)
273 return 1; 273 return 1;
274 274
275 use_pio_instead:
276 ide_destroy_dmatable(drive);
277
278 return 0; /* revert to PIO for this request */ 275 return 0; /* revert to PIO for this request */
279} 276}
280 277
281static int auide_dma_end(ide_drive_t *drive) 278static int auide_dma_end(ide_drive_t *drive)
282{ 279{
283 ide_destroy_dmatable(drive);
284
285 return 0; 280 return 0;
286} 281}
287 282
@@ -292,12 +287,9 @@ static void auide_dma_start(ide_drive_t *drive )
292 287
293static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) 288static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
294{ 289{
295 if (auide_build_dmatable(drive, cmd) == 0) { 290 if (auide_build_dmatable(drive, cmd) == 0)
296 ide_map_sg(drive, cmd);
297 return 1; 291 return 1;
298 }
299 292
300 drive->waiting_for_dma = 1;
301 return 0; 293 return 0;
302} 294}
303 295
@@ -322,16 +314,11 @@ static void auide_dma_host_set(ide_drive_t *drive, int on)
322 314
323static void auide_ddma_tx_callback(int irq, void *param) 315static void auide_ddma_tx_callback(int irq, void *param)
324{ 316{
325 _auide_hwif *ahwif = (_auide_hwif*)param;
326 ahwif->drive->waiting_for_dma = 0;
327} 317}
328 318
329static void auide_ddma_rx_callback(int irq, void *param) 319static void auide_ddma_rx_callback(int irq, void *param)
330{ 320{
331 _auide_hwif *ahwif = (_auide_hwif*)param;
332 ahwif->drive->waiting_for_dma = 0;
333} 321}
334
335#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 322#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
336 323
337static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) 324static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags)
@@ -353,7 +340,6 @@ static const struct ide_dma_ops au1xxx_dma_ops = {
353 .dma_end = auide_dma_end, 340 .dma_end = auide_dma_end,
354 .dma_test_irq = auide_dma_test_irq, 341 .dma_test_irq = auide_dma_test_irq,
355 .dma_lost_irq = ide_dma_lost_irq, 342 .dma_lost_irq = ide_dma_lost_irq,
356 .dma_timeout = ide_dma_timeout,
357}; 343};
358 344
359static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) 345static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
@@ -481,9 +467,9 @@ static const struct ide_tp_ops au1xxx_tp_ops = {
481 .exec_command = ide_exec_command, 467 .exec_command = ide_exec_command,
482 .read_status = ide_read_status, 468 .read_status = ide_read_status,
483 .read_altstatus = ide_read_altstatus, 469 .read_altstatus = ide_read_altstatus,
470 .write_devctl = ide_write_devctl,
484 471
485 .set_irq = ide_set_irq, 472 .dev_select = ide_dev_select,
486
487 .tf_load = ide_tf_load, 473 .tf_load = ide_tf_load,
488 .tf_read = ide_tf_read, 474 .tf_read = ide_tf_read,
489 475