aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/hpt366.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r--drivers/ide/pci/hpt366.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index ce8a5449a574..c33d0b0f11c9 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.04 Jun 4, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.06 Jun 27, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -182,6 +182,7 @@ static const char *bad_ata66_4[] = {
182 "IC35L040AVER07-0", 182 "IC35L040AVER07-0",
183 "IC35L060AVER07-0", 183 "IC35L060AVER07-0",
184 "WDC AC310200R", 184 "WDC AC310200R",
185 "MAXTOR STM3320620A",
185 NULL 186 NULL
186}; 187};
187 188
@@ -1513,18 +1514,28 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
1513 goto init_single; 1514 goto init_single;
1514 1515
1515 /* 1516 /*
1516 * HPT36x chips are single channel and 1517 * HPT36x chips have one channel per function and have
1517 * do not seem to have the channel enable bit... 1518 * both channel enable bits located differently and visible
1519 * to both functions -- really stupid design decision... :-(
1520 * Bit 4 is for the primary channel, bit 5 for the secondary.
1518 */ 1521 */
1519 d->channels = 1; 1522 d->channels = 1;
1520 d->enablebits[0].reg = 0; 1523 d->enablebits[0].mask = d->enablebits[0].val = 0x10;
1521 1524
1522 if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) { 1525 if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) {
1523 u8 pin1 = 0, pin2 = 0; 1526 u8 mcr1 = 0, pin1 = 0, pin2 = 0;
1524 int ret; 1527 int ret;
1525 1528
1526 pci_set_drvdata(dev2, info[rev]); 1529 pci_set_drvdata(dev2, info[rev]);
1527 1530
1531 /*
1532 * Now we'll have to force both channels enabled if
1533 * at least one of them has been enabled by BIOS...
1534 */
1535 pci_read_config_byte(dev, 0x50, &mcr1);
1536 if (mcr1 & 0x30)
1537 pci_write_config_byte(dev, 0x50, mcr1 | 0x30);
1538
1528 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1); 1539 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1);
1529 pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); 1540 pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2);
1530 if (pin1 != pin2 && dev->irq == dev2->irq) { 1541 if (pin1 != pin2 && dev->irq == dev2->irq) {