]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/pata_winbond.c
[MIPS] VPE loader: convert from struct class_ device to struct device
[linux-2.6-omap-h63xx.git] / drivers / ata / pata_winbond.c
index cc4ad271afb58be4b21010216efd3146c8ddb9df..549cbbe9fd07f21162baa54cd16270fc3f79b6b1 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/platform_device.h>
 
 #define DRV_NAME "pata_winbond"
-#define DRV_VERSION "0.0.2"
+#define DRV_VERSION "0.0.3"
 
 #define NR_HOST 4      /* Two winbond controllers, two channels each */
 
@@ -94,7 +94,7 @@ static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev)
 
 static void winbond_data_xfer(struct ata_device *adev, unsigned char *buf, unsigned int buflen, int write_data)
 {
-       struct ata_port *ap = adev->ap;
+       struct ata_port *ap = adev->link->ap;
        int slop = buflen & 3;
 
        if (ata_id_has_dword_io(adev->id)) {
@@ -138,7 +138,6 @@ static struct scsi_host_template winbond_sht = {
 };
 
 static struct ata_port_operations winbond_port_ops = {
-       .port_disable   = ata_port_disable,
        .set_piomode    = winbond_set_piomode,
 
        .tf_load        = ata_tf_load,
@@ -160,9 +159,8 @@ static struct ata_port_operations winbond_port_ops = {
 
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
-       .irq_ack        = ata_irq_ack,
 
-       .port_start     = ata_port_start,
+       .port_start     = ata_sff_port_start,
 };
 
 /**
@@ -199,6 +197,7 @@ static __init int winbond_init_one(unsigned long port)
 
        for (i = 0; i < 2 ; i ++) {
                unsigned long cmd_port = 0x1F0 - (0x80 * i);
+               unsigned long ctl_port = cmd_port + 0x206;
                struct ata_host *host;
                struct ata_port *ap;
                void __iomem *cmd_addr, *ctl_addr;
@@ -214,14 +213,16 @@ static __init int winbond_init_one(unsigned long port)
                host = ata_host_alloc(&pdev->dev, 1);
                if (!host)
                        goto err_unregister;
+               ap = host->ports[0];
 
                rc = -ENOMEM;
                cmd_addr = devm_ioport_map(&pdev->dev, cmd_port, 8);
-               ctl_addr = devm_ioport_map(&pdev->dev, cmd_port + 0x0206, 1);
+               ctl_addr = devm_ioport_map(&pdev->dev, ctl_port, 1);
                if (!cmd_addr || !ctl_addr)
                        goto err_unregister;
 
-               ap = host->ports[0];
+               ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", cmd_port, ctl_port);
+
                ap->ops = &winbond_port_ops;
                ap->pio_mask = 0x1F;
                ap->flags |= ATA_FLAG_SLAVE_POSS;