diff options
Diffstat (limited to 'drivers/ide/pci/tc86c001.c')
-rw-r--r-- | drivers/ide/pci/tc86c001.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index 9fbbb4f2dd54..2ef2ed2f2b32 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c | |||
@@ -160,6 +160,19 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) | |||
160 | return 0; | 160 | return 0; |
161 | } | 161 | } |
162 | 162 | ||
163 | static u8 __devinit tc86c001_cable_detect(ide_hwif_t *hwif) | ||
164 | { | ||
165 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
166 | unsigned long sc_base = pci_resource_start(dev, 5); | ||
167 | u16 scr1 = inw(sc_base + 0x00); | ||
168 | |||
169 | /* | ||
170 | * System Control 1 Register bit 13 (PDIAGN): | ||
171 | * 0=80-pin cable, 1=40-pin cable | ||
172 | */ | ||
173 | return (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | ||
174 | } | ||
175 | |||
163 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | 176 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) |
164 | { | 177 | { |
165 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 178 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
@@ -183,6 +196,8 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
183 | 196 | ||
184 | hwif->busproc = &tc86c001_busproc; | 197 | hwif->busproc = &tc86c001_busproc; |
185 | 198 | ||
199 | hwif->cable_detect = tc86c001_cable_detect; | ||
200 | |||
186 | if (!hwif->dma_base) | 201 | if (!hwif->dma_base) |
187 | return; | 202 | return; |
188 | 203 | ||
@@ -196,15 +211,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
196 | hwif->rqsize = 0xffff; | 211 | hwif->rqsize = 0xffff; |
197 | 212 | ||
198 | hwif->dma_start = &tc86c001_dma_start; | 213 | hwif->dma_start = &tc86c001_dma_start; |
199 | |||
200 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) { | ||
201 | /* | ||
202 | * System Control 1 Register bit 13 (PDIAGN): | ||
203 | * 0=80-pin cable, 1=40-pin cable | ||
204 | */ | ||
205 | scr1 = inw(sc_base + 0x00); | ||
206 | hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | ||
207 | } | ||
208 | } | 214 | } |
209 | 215 | ||
210 | static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev, | 216 | static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev, |