aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ata_piix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ata_piix.c')
-rw-r--r--drivers/scsi/ata_piix.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index deec0cef88d..87e0c36f155 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -68,8 +68,8 @@ enum {
68 PIIX_COMB_PATA_P0 = (1 << 1), 68 PIIX_COMB_PATA_P0 = (1 << 1),
69 PIIX_COMB = (1 << 2), /* combined mode enabled? */ 69 PIIX_COMB = (1 << 2), /* combined mode enabled? */
70 70
71 PIIX_PORT_PRESENT = (1 << 0), 71 PIIX_PORT_ENABLED = (1 << 0),
72 PIIX_PORT_ENABLED = (1 << 4), 72 PIIX_PORT_PRESENT = (1 << 4),
73 73
74 PIIX_80C_PRI = (1 << 5) | (1 << 4), 74 PIIX_80C_PRI = (1 << 5) | (1 << 4),
75 PIIX_80C_SEC = (1 << 7) | (1 << 6), 75 PIIX_80C_SEC = (1 << 7) | (1 << 6),
@@ -377,7 +377,9 @@ static void piix_pata_phy_reset(struct ata_port *ap)
377 * None (inherited from caller). 377 * None (inherited from caller).
378 * 378 *
379 * RETURNS: 379 * RETURNS:
380 * Non-zero if device detected, zero otherwise. 380 * Non-zero if port is enabled, it may or may not have a device
381 * attached in that case (PRESENT bit would only be set if BIOS probe
382 * was done). Zero is returned if port is disabled.
381 */ 383 */
382static int piix_sata_probe (struct ata_port *ap) 384static int piix_sata_probe (struct ata_port *ap)
383{ 385{
@@ -401,7 +403,7 @@ static int piix_sata_probe (struct ata_port *ap)
401 */ 403 */
402 404
403 for (i = 0; i < 4; i++) { 405 for (i = 0; i < 4; i++) {
404 mask = (PIIX_PORT_PRESENT << i) | (PIIX_PORT_ENABLED << i); 406 mask = (PIIX_PORT_ENABLED << i);
405 407
406 if ((orig_mask & mask) == mask) 408 if ((orig_mask & mask) == mask)
407 if (combined || (i == ap->hard_port_no)) 409 if (combined || (i == ap->hard_port_no))
@@ -566,18 +568,6 @@ static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
566 } 568 }
567} 569}
568 570
569/* move to PCI layer, integrate w/ MSI stuff */
570static void pci_enable_intx(struct pci_dev *pdev)
571{
572 u16 pci_command;
573
574 pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
575 if (pci_command & PCI_COMMAND_INTX_DISABLE) {
576 pci_command &= ~PCI_COMMAND_INTX_DISABLE;
577 pci_write_config_word(pdev, PCI_COMMAND, pci_command);
578 }
579}
580
581#define AHCI_PCI_BAR 5 571#define AHCI_PCI_BAR 5
582#define AHCI_GLOBAL_CTL 0x04 572#define AHCI_GLOBAL_CTL 0x04
583#define AHCI_ENABLE (1 << 31) 573#define AHCI_ENABLE (1 << 31)
@@ -675,7 +665,7 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
675 * message-signalled interrupts currently). 665 * message-signalled interrupts currently).
676 */ 666 */
677 if (port_info[0]->host_flags & PIIX_FLAG_CHECKINTR) 667 if (port_info[0]->host_flags & PIIX_FLAG_CHECKINTR)
678 pci_enable_intx(pdev); 668 pci_intx(pdev, 1);
679 669
680 if (combined) { 670 if (combined) {
681 port_info[sata_chan] = &piix_port_info[ent->driver_data]; 671 port_info[sata_chan] = &piix_port_info[ent->driver_data];