diff options
Diffstat (limited to 'drivers/ide/pci/slc90e66.c')
-rw-r--r-- | drivers/ide/pci/slc90e66.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index a6cf810c4699..427f95b25fde 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c | |||
@@ -118,23 +118,23 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) | 121 | static u8 __devinit slc90e66_cable_detect(ide_hwif_t *hwif) |
122 | { | 122 | { |
123 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 123 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
124 | u8 reg47 = 0; | 124 | u8 reg47 = 0, mask = hwif->channel ? 0x01 : 0x02; |
125 | u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ | ||
126 | |||
127 | hwif->set_pio_mode = &slc90e66_set_pio_mode; | ||
128 | hwif->set_dma_mode = &slc90e66_set_dma_mode; | ||
129 | 125 | ||
130 | pci_read_config_byte(dev, 0x47, ®47); | 126 | pci_read_config_byte(dev, 0x47, ®47); |
131 | 127 | ||
132 | if (hwif->dma_base == 0) | 128 | /* bit[0(1)]: 0:80, 1:40 */ |
133 | return; | 129 | return (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |
130 | } | ||
131 | |||
132 | static void __devinit init_hwif_slc90e66(ide_hwif_t *hwif) | ||
133 | { | ||
134 | hwif->set_pio_mode = &slc90e66_set_pio_mode; | ||
135 | hwif->set_dma_mode = &slc90e66_set_dma_mode; | ||
134 | 136 | ||
135 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) | 137 | hwif->cable_detect = slc90e66_cable_detect; |
136 | /* bit[0(1)]: 0:80, 1:40 */ | ||
137 | hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | ||
138 | } | 138 | } |
139 | 139 | ||
140 | static const struct ide_port_info slc90e66_chipset __devinitdata = { | 140 | static const struct ide_port_info slc90e66_chipset __devinitdata = { |