aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it821x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/it821x.c')
-rw-r--r--drivers/ide/pci/it821x.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 4a1508a707cc..46edd083b348 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -63,7 +63,6 @@
63#include <linux/types.h> 63#include <linux/types.h>
64#include <linux/module.h> 64#include <linux/module.h>
65#include <linux/pci.h> 65#include <linux/pci.h>
66#include <linux/hdreg.h>
67#include <linux/ide.h> 66#include <linux/ide.h>
68#include <linux/init.h> 67#include <linux/init.h>
69 68
@@ -446,8 +445,7 @@ static u8 it821x_cable_detect(ide_hwif_t *hwif)
446static void it821x_quirkproc(ide_drive_t *drive) 445static void it821x_quirkproc(ide_drive_t *drive)
447{ 446{
448 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif); 447 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
449 struct hd_driveid *id = drive->id; 448 u16 *id = drive->id;
450 u16 *idbits = (u16 *)drive->id;
451 449
452 if (!itdev->smart) { 450 if (!itdev->smart) {
453 /* 451 /*
@@ -466,36 +464,36 @@ static void it821x_quirkproc(ide_drive_t *drive)
466 */ 464 */
467 465
468 /* Check for RAID v native */ 466 /* Check for RAID v native */
469 if(strstr(id->model, "Integrated Technology Express")) { 467 if (strstr((char *)&id[ATA_ID_PROD],
468 "Integrated Technology Express")) {
470 /* In raid mode the ident block is slightly buggy 469 /* In raid mode the ident block is slightly buggy
471 We need to set the bits so that the IDE layer knows 470 We need to set the bits so that the IDE layer knows
472 LBA28. LBA48 and DMA ar valid */ 471 LBA28. LBA48 and DMA ar valid */
473 id->capability |= 3; /* LBA28, DMA */ 472 id[ATA_ID_CAPABILITY] |= (3 << 8); /* LBA28, DMA */
474 id->command_set_2 |= 0x0400; /* LBA48 valid */ 473 id[ATA_ID_COMMAND_SET_2] |= 0x0400; /* LBA48 valid */
475 id->cfs_enable_2 |= 0x0400; /* LBA48 on */ 474 id[ATA_ID_CFS_ENABLE_2] |= 0x0400; /* LBA48 on */
476 /* Reporting logic */ 475 /* Reporting logic */
477 printk(KERN_INFO "%s: IT8212 %sRAID %d volume", 476 printk(KERN_INFO "%s: IT8212 %sRAID %d volume",
478 drive->name, 477 drive->name, id[147] ? "Bootable " : "",
479 idbits[147] ? "Bootable ":"", 478 id[ATA_ID_CSFO]);
480 idbits[129]); 479 if (id[ATA_ID_CSFO] != 1)
481 if(idbits[129] != 1) 480 printk(KERN_CONT "(%dK stripe)", id[146]);
482 printk("(%dK stripe)", idbits[146]); 481 printk(KERN_CONT ".\n");
483 printk(".\n");
484 } else { 482 } else {
485 /* Non RAID volume. Fixups to stop the core code 483 /* Non RAID volume. Fixups to stop the core code
486 doing unsupported things */ 484 doing unsupported things */
487 id->field_valid &= 3; 485 id[ATA_ID_FIELD_VALID] &= 3;
488 id->queue_depth = 0; 486 id[ATA_ID_QUEUE_DEPTH] = 0;
489 id->command_set_1 = 0; 487 id[ATA_ID_COMMAND_SET_1] = 0;
490 id->command_set_2 &= 0xC400; 488 id[ATA_ID_COMMAND_SET_2] &= 0xC400;
491 id->cfsse &= 0xC000; 489 id[ATA_ID_CFSSE] &= 0xC000;
492 id->cfs_enable_1 = 0; 490 id[ATA_ID_CFS_ENABLE_1] = 0;
493 id->cfs_enable_2 &= 0xC400; 491 id[ATA_ID_CFS_ENABLE_2] &= 0xC400;
494 id->csf_default &= 0xC000; 492 id[ATA_ID_CSF_DEFAULT] &= 0xC000;
495 id->word127 = 0; 493 id[127] = 0;
496 id->dlf = 0; 494 id[ATA_ID_DLF] = 0;
497 id->csfo = 0; 495 id[ATA_ID_CSFO] = 0;
498 id->cfa_power = 0; 496 id[ATA_ID_CFA_POWER] = 0;
499 printk(KERN_INFO "%s: Performing identify fixups.\n", 497 printk(KERN_INFO "%s: Performing identify fixups.\n",
500 drive->name); 498 drive->name);
501 } 499 }
@@ -505,8 +503,8 @@ static void it821x_quirkproc(ide_drive_t *drive)
505 * IDE core that DMA is supported (it821x hardware 503 * IDE core that DMA is supported (it821x hardware
506 * takes care of DMA mode programming). 504 * takes care of DMA mode programming).
507 */ 505 */
508 if (id->capability & 1) { 506 if (ata_id_has_dma(id)) {
509 id->dma_mword |= 0x0101; 507 id[ATA_ID_MWDMA_MODES] |= 0x0101;
510 drive->current_speed = XFER_MW_DMA_0; 508 drive->current_speed = XFER_MW_DMA_0;
511 } 509 }
512 } 510 }
@@ -588,7 +586,7 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
588 hwif->mwdma_mask = ATA_MWDMA2; 586 hwif->mwdma_mask = ATA_MWDMA2;
589} 587}
590 588
591static void __devinit it8212_disable_raid(struct pci_dev *dev) 589static void it8212_disable_raid(struct pci_dev *dev)
592{ 590{
593 /* Reset local CPU, and set BIOS not ready */ 591 /* Reset local CPU, and set BIOS not ready */
594 pci_write_config_byte(dev, 0x5E, 0x01); 592 pci_write_config_byte(dev, 0x5E, 0x01);
@@ -605,7 +603,7 @@ static void __devinit it8212_disable_raid(struct pci_dev *dev)
605 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); 603 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20);
606} 604}
607 605
608static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev) 606static unsigned int init_chipset_it821x(struct pci_dev *dev)
609{ 607{
610 u8 conf; 608 u8 conf;
611 static char *mode[2] = { "pass through", "smart" }; 609 static char *mode[2] = { "pass through", "smart" };
@@ -687,6 +685,8 @@ static struct pci_driver driver = {
687 .id_table = it821x_pci_tbl, 685 .id_table = it821x_pci_tbl,
688 .probe = it821x_init_one, 686 .probe = it821x_init_one,
689 .remove = __devexit_p(it821x_remove), 687 .remove = __devexit_p(it821x_remove),
688 .suspend = ide_pci_suspend,
689 .resume = ide_pci_resume,
690}; 690};
691 691
692static int __init it821x_ide_init(void) 692static int __init it821x_ide_init(void)