aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/arm/palm_bk3710.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:23 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:23 -0400
commitb552a2c1dd01ab2380ea9429899591aa743f02e7 (patch)
treee80670e032c1f69ed62b40b753625ec634e97efb /drivers/ide/arm/palm_bk3710.c
parent04216fa1befbf8c737b7bf3bcc636009723f40d9 (diff)
palm_bk3710: use ->init_dma method
* Move DMA setup to palm_bk3710_init_dma(). * Convert the driver to use ->init_dma method. Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm/palm_bk3710.c')
-rw-r--r--drivers/ide/arm/palm_bk3710.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 7ed79e7f3110..8fa34e26443a 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -317,6 +317,22 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
317 return ATA_CBL_PATA80; 317 return ATA_CBL_PATA80;
318} 318}
319 319
320static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
321 const struct ide_port_info *d)
322{
323 unsigned long base =
324 hwif->io_ports[IDE_DATA_OFFSET] - IDE_PALM_ATA_PRI_REG_OFFSET;
325
326 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
327
328 if (ide_allocate_dma_engine(hwif))
329 return -1;
330
331 ide_setup_dma(hwif, base);
332
333 return 0;
334}
335
320static const struct ide_port_ops palm_bk3710_ports_ops = { 336static const struct ide_port_ops palm_bk3710_ports_ops = {
321 .set_pio_mode = palm_bk3710_set_pio_mode, 337 .set_pio_mode = palm_bk3710_set_pio_mode,
322 .set_dma_mode = palm_bk3710_set_dma_mode, 338 .set_dma_mode = palm_bk3710_set_dma_mode,
@@ -324,8 +340,8 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
324}; 340};
325 341
326static const struct ide_port_info __devinitdata palm_bk3710_port_info = { 342static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
343 .init_dma = palm_bk3710_init_dma,
327 .port_ops = &palm_bk3710_ports_ops, 344 .port_ops = &palm_bk3710_ports_ops,
328 .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
329 .pio_mask = ATA_PIO4, 345 .pio_mask = ATA_PIO4,
330 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */ 346 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
331 .mwdma_mask = ATA_MWDMA2, 347 .mwdma_mask = ATA_MWDMA2,
@@ -392,11 +408,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
392 hwif->mmio = 1; 408 hwif->mmio = 1;
393 default_hwif_mmiops(hwif); 409 default_hwif_mmiops(hwif);
394 410
395 printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
396
397 if (ide_allocate_dma_engine(hwif) == 0)
398 ide_setup_dma(hwif, mem->start);
399
400 idx[0] = i; 411 idx[0] = i;
401 412
402 ide_device_add(idx, &palm_bk3710_port_info); 413 ide_device_add(idx, &palm_bk3710_port_info);