diff options
-rw-r--r-- | drivers/ata/pata_sis.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index c434c4ef4e4b..d9486fcd59f2 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -43,6 +43,34 @@ struct sis_chipset { | |||
43 | up code later */ | 43 | up code later */ |
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct sis_laptop { | ||
47 | u16 device; | ||
48 | u16 subvendor; | ||
49 | u16 subdevice; | ||
50 | }; | ||
51 | |||
52 | static const struct sis_laptop sis_laptop[] = { | ||
53 | /* devid, subvendor, subdev */ | ||
54 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ | ||
55 | /* end marker */ | ||
56 | { 0, } | ||
57 | }; | ||
58 | |||
59 | static int sis_short_ata40(struct pci_dev *dev) | ||
60 | { | ||
61 | const struct sis_laptop *lap = &sis_laptop[0]; | ||
62 | |||
63 | while (lap->device) { | ||
64 | if (lap->device == dev->device && | ||
65 | lap->subvendor == dev->subsystem_vendor && | ||
66 | lap->subdevice == dev->subsystem_device) | ||
67 | return 1; | ||
68 | lap++; | ||
69 | } | ||
70 | |||
71 | return 0; | ||
72 | } | ||
73 | |||
46 | /** | 74 | /** |
47 | * sis_port_base - return PCI configuration base for dev | 75 | * sis_port_base - return PCI configuration base for dev |
48 | * @adev: device | 76 | * @adev: device |
@@ -79,7 +107,7 @@ static int sis_133_pre_reset(struct ata_port *ap) | |||
79 | 107 | ||
80 | /* The top bit of this register is the cable detect bit */ | 108 | /* The top bit of this register is the cable detect bit */ |
81 | pci_read_config_word(pdev, 0x50 + 2 * ap->port_no, &tmp); | 109 | pci_read_config_word(pdev, 0x50 + 2 * ap->port_no, &tmp); |
82 | if (tmp & 0x8000) | 110 | if ((tmp & 0x8000) && !sis_short_ata40(pdev)) |
83 | ap->cbl = ATA_CBL_PATA40; | 111 | ap->cbl = ATA_CBL_PATA40; |
84 | else | 112 | else |
85 | ap->cbl = ATA_CBL_PATA80; | 113 | ap->cbl = ATA_CBL_PATA80; |
@@ -127,7 +155,7 @@ static int sis_66_pre_reset(struct ata_port *ap) | |||
127 | /* Older chips keep cable detect in bits 4/5 of reg 0x48 */ | 155 | /* Older chips keep cable detect in bits 4/5 of reg 0x48 */ |
128 | pci_read_config_byte(pdev, 0x48, &tmp); | 156 | pci_read_config_byte(pdev, 0x48, &tmp); |
129 | tmp >>= ap->port_no; | 157 | tmp >>= ap->port_no; |
130 | if (tmp & 0x10) | 158 | if ((tmp & 0x10) && !sis_short_ata40(pdev)) |
131 | ap->cbl = ATA_CBL_PATA40; | 159 | ap->cbl = ATA_CBL_PATA40; |
132 | else | 160 | else |
133 | ap->cbl = ATA_CBL_PATA80; | 161 | ap->cbl = ATA_CBL_PATA80; |