Commit 8ccd6848 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] update for pdc202xx_old driver

- fix bug introduced by my recent fixes
  (do not try to disable 66MHz clock on PDC20246)
- cleanup cable verification code a bit
- remove unused macros (leftovers from driver split-up)
  and duplicated define from pdc202xx_old.h
parent a936e3de
......@@ -397,37 +397,18 @@ static int config_chipset_for_dma (ide_drive_t *drive)
u8 ultra_66 = ((id->dma_ultra & 0x0010) ||
(id->dma_ultra & 0x0008)) ? 1 : 0;
switch(dev->device) {
case PCI_DEVICE_ID_PROMISE_20267:
case PCI_DEVICE_ID_PROMISE_20265:
case PCI_DEVICE_ID_PROMISE_20263:
case PCI_DEVICE_ID_PROMISE_20262:
cable = pdc202xx_old_cable_detect(hwif);
#if PDC202_DEBUG_CABLE
printk(KERN_DEBUG "%s: %s-pin cable, %s-pin cable, %d\n",
hwif->name, hwif->udma_four ? "80" : "40",
cable ? "40" : "80", cable);
#endif /* PDC202_DEBUG_CABLE */
break;
case PCI_DEVICE_ID_PROMISE_20246:
ultra_66 = 0;
break;
default:
BUG();
}
if (dev->device != PCI_DEVICE_ID_PROMISE_20246)
cable = pdc202xx_old_cable_detect(hwif);
else
ultra_66 = 0;
if ((ultra_66) && (cable)) {
#ifdef DEBUG
printk(KERN_DEBUG "ULTRA 66/100/133: %s channel of Ultra 66/100/133 "
"requires an 80-pin cable for Ultra66 operation.\n",
hwif->channel ? "Secondary" : "Primary");
printk(KERN_DEBUG " Switching to Ultra33 mode.\n");
#endif /* DEBUG */
if (ultra_66 && cable) {
printk(KERN_WARNING "Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary");
printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name);
}
pdc_old_disable_66MHz_clock(drive->hwif);
if (dev->device != PCI_DEVICE_ID_PROMISE_20246)
pdc_old_disable_66MHz_clock(drive->hwif);
drive_pci = 0x60 + (drive->dn << 2);
pci_read_config_dword(dev, drive_pci, &drive_conf);
......
......@@ -5,8 +5,6 @@
#include <linux/pci.h>
#include <linux/ide.h>
#define DISPLAY_PDC202XX_TIMINGS
#ifndef SPLIT_BYTE
#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4)))
#endif
......@@ -171,32 +169,6 @@ static void decode_registers (u8 registers, u8 value)
#endif /* PDC202XX_DECODE_REGISTER_INFO */
#define set_2regs(a, b) \
do { \
hwif->OUTB((a + adj), indexreg); \
hwif->OUTB(b, datareg); \
} while(0)
#define set_ultra(a, b, c) \
do { \
set_2regs(0x10,(a)); \
set_2regs(0x11,(b)); \
set_2regs(0x12,(c)); \
} while(0)
#define set_ata2(a, b) \
do { \
set_2regs(0x0e,(a)); \
set_2regs(0x0f,(b)); \
} while(0)
#define set_pio(a, b, c) \
do { \
set_2regs(0x0c,(a)); \
set_2regs(0x0d,(b)); \
set_2regs(0x13,(c)); \
} while(0)
#define DISPLAY_PDC202XX_TIMINGS
static void init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment