spi: pxa2xx: limit reaches -1
[safe/jmp/linux-2.6] / drivers / ide / trm290.c
index 0be27ca..4b42ca0 100644 (file)
@@ -171,9 +171,11 @@ static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
        local_irq_restore(flags);
 }
 
-static void trm290_selectproc (ide_drive_t *drive)
+static void trm290_dev_select(ide_drive_t *drive)
 {
        trm290_prepare_drive(drive, !!(drive->dev_flags & IDE_DFLAG_USING_DMA));
+
+       outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr);
 }
 
 static int trm290_dma_check(ide_drive_t *drive, struct ide_cmd *cmd)
@@ -198,9 +200,9 @@ static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
                return 1;
 
        outl(hwif->dmatable_dma | rw, hwif->dma_base);
-       drive->waiting_for_dma = 1;
        /* start DMA */
        outw(count * 2 - 1, hwif->dma_base + 2);
+
        return 0;
 }
 
@@ -211,11 +213,7 @@ static void trm290_dma_start(ide_drive_t *drive)
 
 static int trm290_dma_end(ide_drive_t *drive)
 {
-       u16 status;
-
-       drive->waiting_for_dma = 0;
-
-       status = inw(drive->hwif->dma_base + 2);
+       u16 status = inw(drive->hwif->dma_base + 2);
 
        trm290_prepare_drive(drive, 0);
 
@@ -302,8 +300,18 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 #endif
 }
 
-static const struct ide_port_ops trm290_port_ops = {
-       .selectproc             = trm290_selectproc,
+static const struct ide_tp_ops trm290_tp_ops = {
+       .exec_command           = ide_exec_command,
+       .read_status            = ide_read_status,
+       .read_altstatus         = ide_read_altstatus,
+       .write_devctl           = ide_write_devctl,
+
+       .dev_select             = trm290_dev_select,
+       .tf_load                = ide_tf_load,
+       .tf_read                = ide_tf_read,
+
+       .input_data             = ide_input_data,
+       .output_data            = ide_output_data,
 };
 
 static struct ide_dma_ops trm290_dma_ops = {
@@ -319,7 +327,7 @@ static struct ide_dma_ops trm290_dma_ops = {
 static const struct ide_port_info trm290_chipset __devinitdata = {
        .name           = DRV_NAME,
        .init_hwif      = init_hwif_trm290,
-       .port_ops       = &trm290_port_ops,
+       .tp_ops         = &trm290_tp_ops,
        .dma_ops        = &trm290_dma_ops,
        .host_flags     = IDE_HFLAG_TRM290 |
                          IDE_HFLAG_NO_ATAPI_DMA |