Merge ../linux-2.6-watchdog-mm
[pandora-kernel.git] / drivers / ata / pata_it821x.c
index af39097..e8afd48 100644 (file)
@@ -80,7 +80,7 @@
 
 
 #define DRV_NAME "pata_it821x"
-#define DRV_VERSION "0.3.2"
+#define DRV_VERSION "0.3.3"
 
 struct it821x_dev
 {
@@ -476,6 +476,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc)
 /**
  *     it821x_smart_set_mode   -       mode setting
  *     @ap: interface to set up
+ *     @unused: device that failed (error only)
  *
  *     Use a non standard set_mode function. We don't want to be tuned.
  *     The BIOS configured everything. Our job is not to fiddle. We
@@ -483,7 +484,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc)
  *     and respect them.
  */
 
-static void it821x_smart_set_mode(struct ata_port *ap)
+static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused)
 {
        int dma_enabled = 0;
        int i;
@@ -512,6 +513,7 @@ static void it821x_smart_set_mode(struct ata_port *ap)
                        }
                }
        }
+       return 0;
 }
 
 /**
@@ -666,16 +668,16 @@ static struct scsi_host_template it821x_sht = {
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
        .sg_tablesize           = LIBATA_MAX_PRD,
-       /* 255 sectors to begin with. This is locked in smart mode but not
-          in pass through */
-       .max_sectors            = 255,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
+       .resume                 = ata_scsi_device_resume,
+       .suspend                = ata_scsi_device_suspend,
 };
 
 static struct ata_port_operations it821x_smart_port_ops = {
@@ -703,7 +705,7 @@ static struct ata_port_operations it821x_smart_port_ops = {
 
        .qc_prep        = ata_qc_prep,
        .qc_issue       = it821x_smart_qc_issue_prot,
-       .eng_timeout    = ata_eng_timeout,
+
        .data_xfer      = ata_pio_data_xfer,
 
        .irq_handler    = ata_interrupt,
@@ -739,7 +741,7 @@ static struct ata_port_operations it821x_passthru_port_ops = {
 
        .qc_prep        = ata_qc_prep,
        .qc_issue       = it821x_passthru_qc_issue_prot,
-       .eng_timeout    = ata_eng_timeout,
+
        .data_xfer      = ata_pio_data_xfer,
 
        .irq_clear      = ata_bmdma_irq_clear,
@@ -808,17 +810,28 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        return ata_pci_init_one(pdev, port_info, 2);
 }
 
-static struct pci_device_id it821x[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8211), },
-       { PCI_DEVICE(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212), },
-       { 0, },
+static int it821x_reinit_one(struct pci_dev *pdev)
+{
+       /* Resume - turn raid back off if need be */
+       if (it8212_noraid)
+               it821x_disable_raid(pdev);
+       return ata_pci_device_resume(pdev);
+}
+
+static const struct pci_device_id it821x[] = {
+       { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), },
+       { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), },
+
+       { },
 };
 
 static struct pci_driver it821x_pci_driver = {
-        .name          = DRV_NAME,
+       .name           = DRV_NAME,
        .id_table       = it821x,
        .probe          = it821x_init_one,
-       .remove         = ata_pci_remove_one
+       .remove         = ata_pci_remove_one,
+       .suspend        = ata_pci_device_suspend,
+       .resume         = it821x_reinit_one,
 };
 
 static int __init it821x_init(void)
@@ -826,13 +839,11 @@ static int __init it821x_init(void)
        return pci_register_driver(&it821x_pci_driver);
 }
 
-
 static void __exit it821x_exit(void)
 {
        pci_unregister_driver(&it821x_pci_driver);
 }
 
-
 MODULE_AUTHOR("Alan Cox");
 MODULE_DESCRIPTION("low-level driver for the IT8211/IT8212 IDE RAID controller");
 MODULE_LICENSE("GPL");