aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/aec62xx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 15:58:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 15:58:57 -0500
commit9135f1901ee6449dfe338adf6e40e9c2025b8150 (patch)
tree05e1ab38563a93cf0df8c05d21062b85b14f8491 /drivers/ide/pci/aec62xx.c
parent124d3b7041f9a0ca7c43a6293e1cae4576c32fd5 (diff)
parentd59823fa44f7d9babf586b3c705db314aa0f9822 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (95 commits) ide-tape: remove idetape_config_t typedef ide-tape: remove mtio.h related comments ide-tape: make function name more accurate ide-tape: remove unused sense packet commands. ide-tape: use generic byteorder macros ide-tape: remove EXPERIMENTAL driver status ide-tape: use generic scsi commands ide-tape: remove struct idetape_block_size_page_t ide-tape: remove structs os_partition_t, os_dat_entry_t, os_dat_t ide-tape: remove struct idetape_parameter_block_descriptor_t ide-tape: remove struct idetape_medium_partition_page_t ide-tape: remove struct idetape_data_compression_page_t ide-tape: remove struct idetape_inquiry_result_t ide-tape: remove struct idetape_capabilities_page_t ide-tape: remove IDETAPE_DEBUG_BUGS ide-tape: remove IDETAPE_DEBUG_INFO ide-tape: dump gcw fields on error in idetape_identify_device() ide-tape: remove struct idetape_mode_parameter_header_t ide-tape: remove struct idetape_request_sense_result_t ide-tape: remove dead code ...
Diffstat (limited to 'drivers/ide/pci/aec62xx.c')
-rw-r--r--drivers/ide/pci/aec62xx.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 824df78c7012..cfb3265bc1a8 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -7,7 +7,6 @@
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/pci.h> 9#include <linux/pci.h>
10#include <linux/delay.h>
11#include <linux/hdreg.h> 10#include <linux/hdreg.h>
12#include <linux/ide.h> 11#include <linux/ide.h>
13#include <linux/init.h> 12#include <linux/init.h>
@@ -166,6 +165,16 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch
166 return dev->irq; 165 return dev->irq;
167} 166}
168 167
168static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif)
169{
170 struct pci_dev *dev = to_pci_dev(hwif->dev);
171 u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
172
173 pci_read_config_byte(dev, 0x49, &ata66);
174
175 return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
176}
177
169static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) 178static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
170{ 179{
171 struct pci_dev *dev = to_pci_dev(hwif->dev); 180 struct pci_dev *dev = to_pci_dev(hwif->dev);
@@ -174,21 +183,10 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
174 183
175 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) 184 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
176 hwif->set_dma_mode = &aec6210_set_mode; 185 hwif->set_dma_mode = &aec6210_set_mode;
177 else 186 else {
178 hwif->set_dma_mode = &aec6260_set_mode; 187 hwif->set_dma_mode = &aec6260_set_mode;
179 188
180 if (hwif->dma_base == 0) 189 hwif->cable_detect = atp86x_cable_detect;
181 return;
182
183 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
184 return;
185
186 if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
187 u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
188
189 pci_read_config_byte(dev, 0x49, &ata66);
190
191 hwif->cbl = (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
192 } 190 }
193} 191}
194 192